# Marginal Data Density

Dear All,

I was conducting a model comparison using Dynare. I am following the same comparison analysis proposed by An and Schorfheide (2007). Hence, I am trying to compare different models using the log of the marginal data density (for example, as reported in Tables 4,5, and 6). Using the estimation command in Dynare, I get (after the posterior maximization) this result:
Log data density [Laplace approximation] is -825.875694
This one is the marginal data density (The marginal data density is calculated as the integral of the likelihood function with respect to the prior density of the parameters), isn’t it?
Is it calculated as the one reported in formula (47) of An and Schorfheide (2007)? Or is it given by a different formula?

Thanks very much for your help and support!

MatlabNerd

Hi,
I actually have the same doubt. Is the log data density computed by Dynare the same as the marginal data density? The latter is obtained by integrating the product of the likelihood function and the prior density over the parameters, i.e. p(Y) = \int L(theta|Y)p(theta)dtheta.

Thanks in advance!

Best,

sorry,but…how to see the log data sensity
what is the command?
yaliallen

Hi,
Usually it appears after the estimation, you don´t need an additional command.

Here is an example:

ESTIMATION RESULTS
**
Log data density is -1530.312695.**

parameters
prior mean post. mean 90% HPD interval prior pstdev

h 0.500 0.8981 0.8668 0.9287 beta 0.2000
phi_L 0.750 0.1810 0.1206 0.2359 beta 0.1000
xi_L 0.500 0.1394 0.0003 0.2796 beta 0.2500
eta_C 0.500 0.2751 0.1313 0.4190 invg 5.0000
eta_I 0.500 0.3149 0.1229 0.5124 invg 5.0000
S_I 5.000 5.2423 3.6382 6.7151 invg 1.5000
phi_Hd 0.750 0.2352 0.1670 0.3021 beta 0.1000
xi_Hd 0.500 0.1380 0.0009 0.2801 beta 0.2500
phi_Hf 0.750 0.5095 0.3436 0.6987 beta 0.1000
xi_Hf 0.500 0.2280 0.0004 0.5000 beta 0.2500
phi_F 0.750 0.2878 0.2023 0.3749 beta 0.1000