Page 1 of 1

setting priors following inverse gamma distribution

PostPosted: Fri Mar 11, 2016 6:13 am
by earsmall
Usually setting priors in estimation using dynare, we specify two parameters, mean and std.dev.
However, as for parameters following inverse gamma distributions (usually magnitude of shocks), the two are not mean and std.dev but two hyperparameters,s and nu.

As far as I know, the function below computes these two hyper parameters.

function [s,nu] = inverse_gamma_specification(mu, sigma2, lb, type, use_fzero_flag, name)

In my case, I implemented pre-sample analysis (AR-1) to have parameters of persistence and magnitude of shock.
The former is nothing but autoregressive coefficient (rho_x) but what about the latter?

Now, I want to compute s and nu by using the above function but do not know how to specify first two arguments, mu and sigma2.
Regarding mu, I could use std.dev of residuals obtained from the AR(1) estimates. But what about variance?

Is there any criterion in setting s and nu for parameters of the magnitude of shock?

Re: setting priors following inverse gamma distribution

PostPosted: Fri Mar 11, 2016 6:49 am
by jpfeifer
Please explain what exactly you are trying to do. In the estimated_params-block all distributions including the inverse gamma are parameterized using mean and standard deviation. Dynare then internally computes the corresponding hyperparameters.

In the unstable version, the syntax is
Code: Select all
[p6,p7] = inverse_gamma_specification(mean,variance,lb, type, use_fzero_flag, name);

Re: setting priors following inverse gamma distribution

PostPosted: Fri Mar 11, 2016 6:57 am
by earsmall
In short, my questions are as follows.

1.If I want to set priors using dynare as below,

As for A_t = rho_A * A_(t-1) + epsilon_A where epsilon_A~N(0,Eps_A^2),

Code: Select all
estimated_params ;
...
...
stderr EPS_A,      starting_value,    lower_bound,   upper_bound,  INV_GAMMA_PDF,    p(1),    p(2)


I want to know whether p(1)=s and p(2)=nu which are hyperparameters of shape and scale or p(1)=mean and p(2)=std.dev.



2. Is there any usual way to set these two?
: If p(1)=mean and p(2)=std.dev,I think it is reasonable to set these two using standard deviation of residuals obtained by fitting AR(1), A_t = rho_A * A_(t-1) + epsilon_A. By doing so, I can set p(1).
As for p(2), i think it is ok to set half value of p(1).

Re: setting priors following inverse gamma distribution

PostPosted: Fri Mar 11, 2016 7:29 am
by jpfeifer
1. As I said and as the manual clearly documents, you never provide hyperparameters. Hence,
p(1)=mean and p(2)=std.dev.


2. You are confusing the standard deviation of a shock with your uncertainty about this standard deviation, which is what you are trying to specify. You cannot use the in-sample standard deviation of shocks to specify the uncertainty about this value. Additionally, even if this were possible, you would not want to do this. The prior must be independent of the data.

Re: setting priors following inverse gamma distribution

PostPosted: Fri Mar 11, 2016 8:20 am
by earsmall
Thank you for your concrete posts.
It is very helpful.