Hi Fabio
I am experiencing a minor problem when I use your code for the model.
I am using the DYNARE CODE and the notes that you have posted on your website.
Now I want to simulate the model in DYNARE with different parameter values. (I.e. in a loop where a parameter have 3 different values, in order to see the how it for example changes the IRFs)
The code works fine when i USE the steady state file ss_CMR_baseline_US.mat that is in the folder already. However, when I try to change the parameter values in ss_CMR_baseline_US.mat in the workspace and run the mod file no changes occurs. I have also tried to run ss_CMR_baseline.m to create a new steady state file (And I have removed the % signs at the bottom where it saves the parameter values) with different parameters, but when I try to run the code for ss_CMR_baseline.m an error occurs that says:
- Code: Select all
Error using erfc
Input must be real and full.
Error in normcdf>localnormcdf (line 124)
p(todo) = 0.5 * erfc(-z ./ sqrt(2));
Error in normcdf (line 46)
[varargout{1:max(1,nargout)}] = localnormcdf(uflag,x,varargin{:});
Error in funcontract2CMR (line 9)
WW = [
Error in @(x)funcontract2CMR(x,RkXUU,sigmaUU,ReXUU,muUU)
Error in trustnleqn (line 200)
F = feval(funfcn{3},reshape(xTrial,sizes.xRows,sizes.xCols),varargin{:});
Error in fsolve (line 366)
[x,FVAL,JACOB,EXITFLAG,OUTPUT,msgData]=...
Error in SS_CMR_baseline (line 108)
p = fsolve(@(x) funcontract2CMR(x,RkXUU,sigmaUU,ReXUU,muUU), x0, ...
So it seems to me that the error occurs when calculating the values in ss_CMR_baseline.m, and I don't know how to fix this.
So my questions are:
1) What am I missing? Why can't I just change the parameter in the workspace for the file ss_CMR_baseline_US.mat in order to change the values of the parameters and get different results?
2) Do you(or any in the forum) know how to fix the problem when running ss_CMR_baseline.m
3) Is there another way to change the values of the parameters than through the steady state file?
I would really appreciate all the help I can get.
Best regards