Dear all,

I have a simple dynamic model that boils down to 4 constraints to identify 4 endogenous variables, H, Y, hbar and m. I wish to dynamically calibrate 3 parameters (A, v and B) so as to minimize the squared distance of the 3 (out of 4) simulated variables with the data. I have the data for Y, m and H. However, I’m having a hard time solving the issue as I don’t know whether it is possible to deal with parameters as if they were time-varying. I could also treat them as variables, yet declaring them as parameters seems to me way simpler. In any case, I should define an objective function equal to the squared deviation between the simulated and observed variables. I don’t know how to construct this function as it should have as an argument the vectors of values of the 3 parameters, to then use fminsearch to minimize it.

Is there a way to define an objective function that:

- receives as an input 3 vectors (or unique longer vector) for the 3 shocks I wish to calibrate
- Simulates deterministically the model over 21 periods
- Returns a scalar which equals the sum of the squared deviations between the 3 simulated endogenous variables and the data I have?

I hereby attached the .mod file with the baseline model treating my 3 shocks/time-varying parameter as standard (invariant over time) parameters.

model3.log (1.7 KB)

Thank you in advance.