estimating variance structural shock, transforms of stderr

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.

estimating variance structural shock, transforms of stderr

Postby jefflovejapan » Sat Dec 04, 2010 6:42 am

In Dynare you can use stderr VARIABLE_NAME to estimate the standard error of a variable, but is it possible to estimate its variance directly (i.e., estimate its posterior distribution)? In an (unfinished) 2007 paper titled "Prior Distributions in Dynare", Stephane Adjemian writes, "Note that if someone wishes to use an inverted gamma distribution as a prior, then he should use the INV_GAMMA2_PDF word in the estimated_params block. This distribution is often used as a prior for the variance of a structural shock or measurement error."

Is it possible to estimate the variance of a variable directly, either through estimating a transform of stderr, or through some other means? I was hoping to do this, for the exogenous variable a - the stochastic component of an AR(1) process:

In the model block:
Code: Select all
#varianceofa=(stderr a)^2;


And then in the estimated_params block:
Code: Select all
varianceofa, inv_gamma2_pdf, 0.5, 0.15;


But it doesn't seem to be possible to refer to stderr in the model block. Is it possible to do this or something like it in Dynare?
jefflovejapan
 
Posts: 13
Joined: Sat Aug 21, 2010 5:47 am

to clarify

Postby jefflovejapan » Sat Dec 11, 2010 4:17 am

How does one go about estimating the variance of a shock instead of its standard error in dynare? From Stephane's paper it seems that this is possible to do in Dynare, but there's no mention of it on the site or in the manual or user's guide.
jefflovejapan
 
Posts: 13
Joined: Sat Aug 21, 2010 5:47 am

Re: estimating variance structural shock, transforms of stderr

Postby jpfeifer » Sat Dec 11, 2010 7:30 am

You have a shock called epsilon and you want to estimate its variance called varianceepsilon, which you initialize as a parameter. Now redefine the shock by entering it everywhere in the equation as
Code: Select all
...+sqrt(varianceepsilon)*epsilon

Then set the stderr of epsilon to 1:
Code: Select all
var epsilon; stderr 1;

Remember var(sqrt(varianceepsilon)*epsilon)=varianceepsilon*1. Now you do not estimate the standard deviation as usually, but rather estimate varianceepsilon, i.e. you omitt the
Code: Select all
var epsilon, inv_gamma_pdf, 0.5, 0.15;

from the estimated_params block as you want to keep it at 1, but simply add
Code: Select all
varianceepsilon, 0.7, , , inv_gamma_pdf, 0.5, 0.15;

of course with the correct prior mean and variance for your parameter.
------------
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

Brilliant

Postby jefflovejapan » Sat Dec 11, 2010 8:23 am

Thank you very much!
jefflovejapan
 
Posts: 13
Joined: Sat Aug 21, 2010 5:47 am


Return to Dynare help

Who is online

Users browsing this forum: Google [Bot] and 7 guests