# Setting priors following inverse gamma distribution

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?

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

```[p6,p7] = inverse_gamma_specification(mean,variance,lb, type, use_fzero_flag, name); ```

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),

``````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.

1. 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).
1. As I said and as the manual clearly documents, you never provide hyperparameters. Hence,
1. 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.

Thank you for your concrete posts.