Beta and other priors in Dynare

Dear Johanes, dear all,

I am trying to understand better how priors are set up in Dynare. Apologies in advance if this is very basic. I set beta priors and I get densities that are balanced around the mean I set, but I would expect more skewness. Let me be more specific with an (abstract) example. I set

kappaa1 , beta_pdf , 0.56 , 0.1

According to my calculations, the corresponding parameters of the beta-distribution are alpha = 0.8198 and beta = 0.6442. Indeed, this is confirmed by running the following commands:

X = betarnd(0.8198, 0.6442, 1000000, 1);
mean(X)
var(X)

where mean(X) and var(X) will be arbitrarily close to 0.56 and 0.1 - up to a numerical error. However, the:

histogram(X)

looks vastly different than the plot that Dynare produces for the prior. I am sure I am doing something wrong, or I misunderstood something… Thanks a lot!

Best,
Kyriacos

Dear Kyriacos,

The discrepancy that you obtain is normal, because you are comparing two different distributions. The 0.1 in the Dynare mod-file is the standard deviation, not the variance.

Note that Dynare internally provides a function that computes the alpha and beta parameters given the mean and variance (and not the standard deviation, I admit this is a bit confusing…):

>> [alpha,beta] = beta_specification(0.56, 0.1^2)
alpha =  13.238
beta =  10.402

Using these parameters, you can verify that the histogram is the same as the prior plot produced by Dynare.

Best,

thanks a lot! I was sure it was a stupid mistake… :frowning: