Estimation with several different datasets


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…



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

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