Fixing some parameters, then estimating the remaining ones

dear all,

pretty simple. I have a code (the smets wouters 2007 from AER website) and it works. Now I want simply to fix one parameter to a certain value and re-estimate the other parameters of the model. I thought it was enough to fix the parameter in the parameter section of the code to the desired level and comment out that parameter from the list of parameters to be estimated. It does not work. I get the follwing error message:

??? Error using ==> lt
Matrix dimensions must agree.

Error in ==> DsgeLikelihood at 17
if options_.mode_compute ~= 1 & any(xparam1 <

Error in ==> initial_estimation_checks at 20
[fval,cost_flag,ys,trend_coeff,info] = DsgeLikelihood(xparam1,gend,data);

Error in ==> dynare_estimation at 249

Error in ==> usmodel_BBG at 335

Error in ==> dynare at 26
evalin(‘base’,fname) ;

ever happened to anybody? any idea? It seems as if xparam1 is keeping track of the number of parameters to estimate…but I’m certainly not an expert of bayesian estimation in dynare…

thanks a lot
happy thanksgiving!



well I guess what you did should be sufficient provided you didnt forget to declare it in the block “parameters”…
Could you post your mod-file?


I guess you need the following three files…any help is deeply appreciated!

usmodel_data.xls (191 KB)
usmodel_stst.m (868 Bytes)
usmodel_BBG.mod (12.2 KB)


first the way you choose to update parameters to be estimated in your mod-file by calling the function usmodel_stst.m, doesnt work on my machine, maybe due to a different Dynare version (I’m using v4).
Actually, I’m used to update parameters I wanna estimate by including them directly inside the block “model” and removing their names from the block “parameters”. Plz see the attached file.

Besides, there’s smth I don’t really get in your paramaters definition. precisely I dont see the point to create auxiliary variables as “constepinf”. For instance, you wanna estimate the parameter “cpie”. So you set its value to 1.005 at the beginning, then you redefine it as follows cpie=1+constepinf/100, knowing that constepinf=(cpie-1)*100. Why don’t you write down directly inside the block model: #cpie=1.005 ?

usmodel_BBG.mod (12.9 KB)