Marginal likelihood code

I know it is a stupid question…but I really can not find the marginal data density code in manual or user guide.is it in the “estimate”?I don not think it works when I code “marginal_density()” after "estimate"command. :blush:
I will be really grateful if someone can give a example.
btw,Is it the same as marginal likelihood?I believe many people had compared two models by this index,really need a help!
yaliallen

The log marginal data density will be computed automatically by the estimation-command if you use Bayesian estimation. As written in the manual, it is stored in oo_.MarginalDensity.
Yes, this it the statistic used for model comparison and is also referred to a the marginal likelihood or model evidence.

[quote=“jpfeifer”]The log marginal data density will be computed automatically by the estimation-command if you use Bayesian estimation. As written in the manual, it is stored in oo_.MarginalDensity.
Yes, this it the statistic used for model comparison and is also referred to a the marginal likelihood or model evidence.[/quote]

thank you mr pfeifer for helping me. but i cannot find where to see this output. if i should type a additional code “oo_.MarginalDensity” under estimation? I try this,but it shows:

[quote]??? Reference to non-existent field ‘MarginalDensity’.

Error in ==> LJWSIGEQZ at 1805
oo_.MarginalDensity;

Error in ==> dynare at 120
evalin(‘base’,fname) ;[/quote]

or

[quote]Starting Dynare (version 4.3.3).
Starting preprocessing of the model file …
ERROR: LJWSIGEQZ.mod:127.69-71: syntax error, unexpected NAME[/quote]

if not,as [Marginal Data Density) said,I didn’t say the same result with my code. :open_mouth:
really want to know what goes wrong…Thank u!
attachments is my code and data
LJWSIGEQZ.mod (3.08 KB)
data07.m (294 Bytes)

The marginal data density is a Bayesian concept. You are estimating the model with ML and not with Bayesian techniques. That won’t work.