Laplace Approximation =minus infinity and inaccurate result

This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location where you will have to reset your password.
Forum rules
This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location (https://forum.dynare.org) where you will have to reset your password.

Laplace Approximation =minus infinity and inaccurate result

Postby aadegboye abiodun » Thu Nov 13, 2014 9:23 pm

Dear Dynare friends/helpers,
I run the attached codes on Dynare 4.4.2 and got some teribble error message. it reads

'' Matrix is singular to working precision
Matrix is singular, close to singular or badly scaled. Results may be inaccurate.
RCOND=NaN ...

The log data density is negative infinity.

A guide on what steps to take would be helpful. Someone should kindly assist.

Here is my model codes
Attachments
abiodungboy.mod
(5.81 KiB) Downloaded 126 times
aadegboye abiodun
 
Posts: 18
Joined: Sat Nov 01, 2014 9:05 pm

Re: Laplace Approximation =minus infinity and inaccurate res

Postby jpfeifer » Fri Nov 14, 2014 9:19 am

There is no datafile
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: Laplace Approximation =minus infinity and inaccurate res

Postby aadegboye abiodun » Fri Nov 14, 2014 8:45 pm

Dear jpfeifer,

I HAVE JUST ATTACHED THE DATAFILE AS REQUESTED. YOUR EFFORT IS APPRECIATED.
Last edited by aadegboye abiodun on Fri Nov 14, 2014 9:11 pm, edited 1 time in total.
aadegboye abiodun
 
Posts: 18
Joined: Sat Nov 01, 2014 9:05 pm

Re: Laplace Approximation =minus infinity and inaccurate res

Postby aadegboye abiodun » Fri Nov 14, 2014 9:08 pm

hi,
I try to attach the datafile again
Attachments
aadegboyedata.xls
(93 KiB) Downloaded 139 times
aadegboye abiodun
 
Posts: 18
Joined: Sat Nov 01, 2014 9:05 pm

Re: Laplace Approximation =minus infinity and inaccurate res

Postby jpfeifer » Sat Nov 15, 2014 7:46 am

Before looking at the Laplace, try fixing the other issues with your model first. For example:
1. You are neglecting the parameter dependence in your estimation. You need to set hpid and mpif in each iteration, because you are estimating gamad. Define them as model-local variables. See Pfeifer(2013): "A Guide to Specifying Observation Equations for the Estimation of DSGE Models" https://sites.google.com/site/pfeiferecon/Pfeifer_2013_Observation_Equations.pdf for more information.

2. Plot your data. y seems to have a massive seasonal pattern at the end. You need to deal with seasonal adjustment before estimation. See again Pfeifer(2013): "A Guide to Specifying Observation Equations for the Estimation of DSGE Models" https://sites.google.com/site/pfeiferecon/Pfeifer_2013_Observation_Equations.pdf for more information.

3. Similarly, amp looks like a step function. Fitting a continuous AR-process to this most probably won't work.

4. Check identification. You have
==== Identification analysis ====

Testing prior mean
Evaluating simulated moment uncertainty ... please wait
Doing 402 replicas of length 300 periods.
Simulated moment uncertainty ... done!

WARNING !!!
The rank of H (model) is deficient!

phigy is not identified in the model!
[dJ/d(phigy)=0 for all tau elements in the model solution!]

You estimate phigy but it does not appear in any equation.
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: Laplace Approximation =minus infinity and inaccurate res

Postby aadegboye abiodun » Mon Nov 17, 2014 9:12 pm

Dear jpfeifer,
Your effort is appreciated. Kindly guide on the following.
1. how to use one sided HP filter
2. is AR(1) process suggesting a stationarity in my model e.g. in log A= rho (log A) + eps_a? I treat it as a stationary factor in my model. I'm I right? Kindly guide.
I appreciate your effort in guiding me.
aadegboye abiodun
 
Posts: 18
Joined: Sat Nov 01, 2014 9:05 pm

Re: Laplace Approximation =minus infinity and inaccurate res

Postby jpfeifer » Wed Nov 19, 2014 5:08 pm

1. See https://ideas.repec.org/c/dge/qmrbcd/181.html
2. An AR-process in Dynare is both continuous (no discrete jumps) and mean-reverting. The step function in one of your observables where the variables stays constant for a long time and then jumps seems to contradict this and might lead to problems.
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: Laplace Approximation =minus infinity and inaccurate res

Postby aadegboye abiodun » Sun Nov 30, 2014 11:16 am

dear jpfeifer,

I HAVE FOUND YOUR GUIDE BEFORE NOW VERY HELPFUL.
I have removed trend and seasonality from my data. I use one sided hp filter as suggested in your paper, ' GUIDE TO SPECIFYING OBSERVATION EQUATIONS'. FOR THE MODEL I HAVE EXPRESSED THE PARAMETERS DIRECTLY. HOWEVER THE RESULTS IS YET TO COME OUT. THE ERRORS ....MATRIX IS BADLY SCALED, SINGULAR ETC STILL SHOWS.
MY MODEL CODES AND DATAFILE ARE ATTACHED. I SHOULD BE GLAD TO RECEIVE FURTHER GUIDE ON HOW TO MOVE FORWARD. KINDLY ASSIST WITH GUIDE TO GET MY MODEL CODE RUN.
Attachments
ola_waleee.xls
(46.5 KiB) Downloaded 129 times
biodunmodel.mod.mod
(5.76 KiB) Downloaded 127 times
aadegboye abiodun
 
Posts: 18
Joined: Sat Nov 01, 2014 9:05 pm

Re: Laplace Approximation =minus infinity and inaccurate res

Postby aadegboye abiodun » Tue Dec 02, 2014 8:22 pm

Dear jpfeifer,
I should be glad to receive some guide as earlier requested in my post on the subject.
aadegboye abiodun
 
Posts: 18
Joined: Sat Nov 01, 2014 9:05 pm

Re: Laplace Approximation =minus infinity and inaccurate res

Postby jpfeifer » Wed Dec 03, 2014 10:29 am

Add
Code: Select all
estimated_params_init(use_calibration);
end;

before estimation. Then follow the error messages. For example
Cannot use parameter values from calibration as they violate the prior bounds.Error using check_prior_bounds (line 39)
Initial value(s) of comega, aeta, phidebt, phigove, aystab, exrstab are outside parameter bounds. Potentially, you should set prior_trunc=0. If you used the
mode_file-option, check whether your mode-file is consistent with the priors.

If you look at comega, your calibrated value is 0.8 but your prior mean is 0.7 with a standard error of 0.01 only. Essentially you are saying, the 0.8 you calibrated your model to will never happen.
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany


Return to Dynare help

Who is online

Users browsing this forum: No registered users and 10 guests