Page 1 of 1
Using Dynare to Estimate SOE model - Help with Error
Posted:
Sat Jul 24, 2010 5:41 am
by mreames_unimelb
Hi Dynare community,
I am trying to use Dynare to estimate a SOE model for Australia as published in the AER Volume 42 Issue 1, Pages 24 - 41 "A structural Model of Australia as a Small Open Economy"
I have specified the log-linerised equations and priors as per the paper but when I try to estimate the model I obtain the following error.
??? Error using ==> print_info at 39
Blanchard Kahn conditions are not satisfied: no stable equilibrium
Error in ==> initial_estimation_checks at 101
print_info(info, options_.noprint)
Error in ==> dynare_estimation_1 at 334
initial_estimation_checks(xparam1,gend,data,data_index,number_of_observations,no_more_missing_observations);
Error in ==> dynare_estimation at 62
dynare_estimation_1(var_list,varargin{:});
Error in ==> SmallOEDSGE_Estim at 393
dynare_estimation(var_list_);
Error in ==> dynare at 132
evalin('base',fname) ;
I have read the forum posts adressing BK conditions but still cannot seem to ammend the mod file to get it working.
This is a crucial step in my honors research essay and I am starting to panic that it might never work. I am somewhat new to Dynare and would really appreciate the help of the experienced Dynare community so I can learn what my mistake might be.
I have attached the paper, my mod file, and the data I am loading for those kind enough to have a look at my issue.
Re: Using Dynare to Estimate SOE model - Help with Error
Posted:
Sun Jul 25, 2010 6:38 am
by mreames_unimelb
Today I ran a Simulation file (attached) of the same model and got the following warning followed by output containing a fair few NaN's
...
There are 4 eigenvalue(s) larger than 1 in modulus
for 4 forward-looking variable(s)
There are 4 eigenvalue(s) larger than 1 in modulus
for 4 forward-looking variable(s)
The rank condition is verified.
Warning: Matrix is close to singular or badly scaled.
Results may be inaccurate. RCOND = 2.576815e-036.
> In dr1 at 396
In resol at 128
In stoch_simul at 42
In SmallOEDSGE_Sim at 296
In dynare at 132
Warning: Matrix is singular to working precision.
> In dr1 at 407
In resol at 128
In stoch_simul at 42
In SmallOEDSGE_Sim at 296
In dynare at 132
MODEL SUMMARY
Number of variables: 27
Number of stochastic shocks: 11
Number of state variables: 18
Number of jumpers: 4
Number of static variables: 9
MATRIX OF COVARIANCE OF EXOGENOUS SHOCKS....
I think this may be related to the instability when i try to estimate the model. However I am still unsure what might be causing the error or what the remedy might be.
I hope someone out there in the Dynare community can come to my rescue.
Re: Using Dynare to Estimate SOE model - Help with Error
Posted:
Mon Jul 26, 2010 1:00 pm
by jpfeifer
A few quick thoughts.
1. Use the version of the paper at Niemarks homepage. Some things seem to have changed, particularly some equations in the appendix.
2. It is very uncommon to have a NK-model with prices in levels (as they have unit roots). The most common way is to have only inflation in the model. Doing otherwise might give you trouble with the BK conditions.
3. Note that point 2 is also the reason why the appendix of the paper states for some equations "or" version where the price level in levels has been replaced the inflation rate.
4. To be precise, replace w-p with a variable rw for real wage (the reason being that you cannot separately identify the nominal wage and the price level but only their ratio, i.e. the difference in logs, which is the real wage). Then delete equations A 14 and A 17 as they are the same as the other two equations stating the same relations in the appendix. Also delete p_star and p from the variable declaration. Note that these are also the variables where the NaN appear in the policy functions.
5. Althoug the paper is already published, I am not sure if it is correct. I am no expert in NOEM models, but the specified Taylor-rule that results from the papers posterior seems to violate the Taylor principle, i.e. the coefficient on inflation must be larger than 1.
6. The same seems to be true for other parameters. If I change the deltas and do steps 1-5, I get a running version.
Re: Using Dynare to Estimate SOE model - Help with Error
Posted:
Mon Jul 26, 2010 1:39 pm
by mreames_unimelb
Thanks for taking the time to look at my issue and post a comprehensive reply.
I hate to be a pest, but I ran the mod file you put up I got the same error as I pasted in my original query.
Was there something else I had to do? Or possibly different versions of Dynare? (I am running 4.1.2) Or perhaps i misunderstood one of the steps you outlined?
Thanks again for your support
Re: Using Dynare to Estimate SOE model - Help with Error
Posted:
Tue Jul 27, 2010 6:21 am
by jpfeifer
Hi, in the version I posted, I only corrected the model. However, your prior specification was still incorrect (see the Dynare manual).
1. You did not specify any starting values. So I set them to the running values from the simulated model. Having correct initial values is crucial because all optimization routines compare their output to this value.
2. The starting value for delta_x of 0.05 is too unlikely with a normal-distribution of mean 1 and standard deviation 0.05, so I set the standard deviation to 1. You can try to experiment with different starting values and prior distributions.
3. You used realmax as the upper bound of uniform distributions. I am not sure how Dynare treats the resulting improper prior. So I set the upper bound to 10 which is still huge.
Re: Using Dynare to Estimate SOE model - Help with Error
Posted:
Fri Jul 30, 2010 4:58 am
by mreames_unimelb
Thanks for your advice - you are correct - this has solved the problem.
I am now trying to resolve why my estimation output differs so much from the published paper. I suspect I am not mapping the model and data analogues correctly via the measurement equations; or, I am not representing the exogenous unrestricted VAR correctly. I was hoping to get your thoughts on this.
1. How would you specify the measurement equations in Dynare for a given type of observable series? what transformations should be carried out on the observable series from their raw levels.
2. Is the way I have represented the VAR in Dynare ok? I just did this is an ad hoc fashion - estimating the lag co-efficients seperately and leaving the error terms to Dynare to sort out. It feels a bit suspect to me. Can i represent matrices in the model file?
As always your help is appreciated and informative.
NB: The related code and journal article can be found in the previous posts in this thread.