Merging IRFs from various models - M.File

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.

Merging IRFs from various models - M.File

Postby Philipp » Wed Jul 20, 2011 3:57 pm

Dear Dynare users,

When you have a model with several different specifications that you wish to compare, Dynare doesn't handle to merge the IRF's produced. This has to be done in matlab particularly with an m.file. My impression was, that it is quite tricky to compute such a code, therefor I post the one I used for my last work. If you have suggestions for improvement, please point them out to me. I suppose that this will be of help to all the beginning Dynare users.

2 comments:

1. make sure the IRFs of your models that you wish to compare have the same dimensions.
2. make sure your IRF matrices do all have the same variables ( you compare the effect on y of model 1 with the effect of y on model 2)

My best wishes,

Philipp
Attachments
irfmerge.m
This file helps to merge IRFs produced by Dynare.
(1.57 KiB) Downloaded 226 times
Philipp
 
Posts: 36
Joined: Mon Apr 18, 2011 9:01 pm
Location: State Secretariate for Economic Affairs

Re: Merging IRFs from various models - M.File

Postby GOODLUCK » Wed Jan 08, 2014 12:13 pm

Hello, Philipp,
Thank you for your kindness to post the .m file. I use Matlab of version R2013 but failed to run the code out. It warns about keep, strvcat in the following code:

Code: Select all
load model2_results.mat %model 1a
irf2=oo_.irfs;
keep irf1 irf2

load modelxy_results.mat
irf3=oo_.irfs;
keep irf1 irf2 irfxy              % number all the irf graphs that you need

% Define variables and colors to be loaded as strings

var=strvcat('y_e', 'c_e', 'h_e', 'k_e', 'd_e', 'i_e', 'tb_e', 'ca_e', 'a_e');
color=strcat('b','g','r','c','m');

Are the codes just out-of-date? If so, are theres any alternatives? Many thanks in advance.

Best,
GOODLUCK

Philipp wrote:Dear Dynare users,

When you have a model with several different specifications that you wish to compare, Dynare doesn't handle to merge the IRF's produced. This has to be done in matlab particularly with an m.file. My impression was, that it is quite tricky to compute such a code, therefor I post the one I used for my last work. If you have suggestions for improvement, please point them out to me. I suppose that this will be of help to all the beginning Dynare users.

2 comments:

1. make sure the IRFs of your models that you wish to compare have the same dimensions.
2. make sure your IRF matrices do all have the same variables ( you compare the effect on y of model 1 with the effect of y on model 2)

My best wishes,

Philipp
GOODLUCK
 
Posts: 16
Joined: Mon Dec 30, 2013 7:40 pm


Return to Dynare help

Who is online

Users browsing this forum: No registered users and 6 guests