A basic question for model comparison

This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location where you will have to reset your password.
Forum rules
This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location (https://forum.dynare.org) where you will have to reset your password.

A basic question for model comparison

Postby jiholee » Sat Sep 29, 2007 2:09 pm

Hello,

I have two mod files to compare using v_3.065 .
To compare them, what should I do?

I found the following command

model_comparison example1.mod, example2.mod;

1) Should I have to estimate each mod file in the same directory in advance?
2) Where should I include this command to implement?

Many thanks,

Jiho
jiholee
 
Posts: 10
Joined: Tue Jun 26, 2007 1:56 pm

Re: A basic question for model comparison

Postby StephaneAdjemian » Sat Sep 29, 2007 3:23 pm

Hi Jiho,

I never use this function (so I don't know how to call it)... But you don't really need it if you want to compare two (or more models). You just have to compare the marginal densities (eventually weighted by a discrete prior distribution over the models).

Say you have two models A and B to be compared. You write two mod files A.mod and B.mod where you define the models and write all is needed to estimate each model. After the estimation, you can execute the following command on the matlab prompt:

Code: Select all
load A_results;
mdA = oo_.MarginalDensity.LaplaceApproximation;
load B_results;
mdB = oo_.MarginalDensity.LaplaceApproximation;


mdA and mdB are the (logged) marginal densities of models A et B. Say you have a prior for these models (pA for model A and pB for model B where pA+pB = 1, pA>0 and pB>0). Then the posterior probability of model A is given by

Code: Select all
exp(log(pA)+mdA) / ( exp(log(pA)+mdA) + exp(log(pB)+mdB) )


and the posterior probability of model B is given by:

Code: Select all
exp(log(pB)+mdB) / ( exp(log(pA)+mdA) + exp(log(pB)+mdB) )


You may experience overflow problems and have to adapt slightly these formulas to overcome this issue (see lines 62-63 in model_comparison.m). Obviously if you run a metropolis you can use the Modified Harmonic Mean estimator of the marginal density instead of the Laplace Approximation.

Best,
Stéphane.
StephaneAdjemian
 
Posts: 429
Joined: Wed Jan 05, 2005 4:24 pm
Location: Paris, France.

Thank you

Postby jiholee » Sat Sep 29, 2007 4:25 pm

Thank you very much, Stéphane.

Best regards,

Jiho
jiholee
 
Posts: 10
Joined: Tue Jun 26, 2007 1:56 pm


Return to Dynare help

Who is online

Users browsing this forum: Google [Bot] and 8 guests