Generalized method of moments in Dynare

The source was really detailed and clear but it doesn’t answer my question. In this practice guide too they are ‘estimating’ the value of variables and transition functions for a ‘given’ value of parameter. What I want is to calculate the values of parameter by minimizing the squared difference between data and model prediction.
How can that be done in Dynare?