Estimation with several different datasets

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.

Estimation with several different datasets

Postby MrDrouf » Sat Apr 12, 2014 10:18 pm

Hi,

I have a simple problem, yet I can't find an efficient solution. I have a DSGE model to estimate using several datasets. Let me explain: one model, one set of parameters to estimate using maximum likelihood, but 17 different datasets for 17 different countries. I cannot simply merge the data together as it would imply some temporal link between the data of a country with another country.

If I was having to do it myself, I would just compute the log-likelihood for each country dataset and add them together.

How can you do that in dynare ?

One tedious/inefficient solution would be to have in your file 17 version of the model with identical parameters...

Best,

Adrien
MrDrouf
 
Posts: 1
Joined: Sat Apr 12, 2014 10:13 pm

Re: Estimation with several different datasets

Postby jpfeifer » Mon Apr 14, 2014 8:51 am

Put the data in subsequent sheets of an Excel file and loop over those sheets by reading out the data and saving it to a fixed datafile that is called within the mod-file. That is, use something along the lines of
Use something along the lines of
Code: Select all
for ii=1:n_countries
    temp=xlsread('my_excel_file',ii);
    y=temp(:,1);
    c=temp(:,2);
    invest=temp(:,3);
    save('my_data_file','y','c','invest');
    dynare mymodel noclearall
    my_results{ii,1}=oo_:
end
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany


Return to Dynare help

Who is online

Users browsing this forum: No registered users and 6 guests