Calibration with Dynare

Hi I am learning dynare so this may seem to be a stupid question… but is there any example about how to calibrating a model with dynare? I couldn’t find such on the internet
I am now using fminsearch so each iteration dynare will recalculate everything and generate simulated moments, but this is horribly slow;
also, what’s the best way to feed parameters to dynare? E.g. in my main .m file, I specify the parameters I will be using and then call dynare. I am trying to use global, but dynare can’t seem to read global parameters.

For looping over parameters, see [Loop over parameters)
Regarding calibration: what exactly do you mean?

I mean exactly how do you calibrate a model with matlab and dynare?

What’s I’m trying to do is making a function, the input is the parameter values and then the function will call for dynare and simulate business cycle moments and the outputs are the moments that are used for calibration. And then I’ll try to minimize the distance between the simulated moments with data moments by trying different parameter values by hand.

I’m studying on my own so I’m not sure this is the right way to do calibration. I’m trying to use fminsearch function to minimize the distance. But it’s too slow.

Can you suggest some examples on how to calibrate a model? Thanks!

I figured it out… Use set param value and resol. Thanks!