This project is read-only.

Monte Carlo given shocks simulated outside IRIS

Topics: Models
Jun 25, 2014 at 11:49 PM
Hi folks, I am experimenting with Monte Carlo simulations with IRIS model objects. Disregarding the theoretical flaws of doing so, I have fit different marginal distributions (other than normal) to the residuals filtered from an estimated model object. I am modelling the dependencies of these residuals with a copula. I now have a 3-dimensional object with 'n' residuals, 't' time increments' and 'p' paths. I was wondering which would we the most appropriate way to tell IRIS to use this object to generate simulations for the state-space model variables.


Jun 27, 2014 at 5:15 PM
I figured I can use 'plan' and 'endogenize' to do so (I am endogenizing all transition shocks in the model) , but it takes a relatively small model considerable time to run a simulation with over 100 paths (with 60 time increments). Is this the most efficient way I can do this in IRIS? I would appreciate your input.


Jun 27, 2014 at 5:53 PM

I'm a little bit puzzled. Originally, I thought you used copulas to approximate the empirical distributions of shocks obtained from a Kalman filter, and wanted to resample the shocks from those empirical distributions to simulate the model... But having seen you other post, I'm not sure I understood your experiment correctly. Do you actually resample the endogenous variables and you want to back out the underlying shocks? Can you please describe in detail what exactly you're doing... Sorry about that....

Jun 27, 2014 at 8:02 PM
Jaromir, thank you for your reply. I apologize for the confusion. Your first interpretation is correct. What I have done after my first comment is:
  1. resampled from empirical distributions and dependency structures (fitted shocks extracted from the Kalman filter),
  2. created a plan,
  3. endogenized the transition shocks and assigned the resampled shocks to the database used by jforecast,
  4. repeated this in loops to get the distributions for the other transition variables.
I was wondering if you would have approached this in a similar fashion or if there is a better way of performing this experiment. Thank you so much for your time.

Jun 30, 2014 at 3:08 PM
Is the fact that I am endogenizing the shocks the source of the confusion? This was the only way I could come up with to get simulation paths out of the model given empirical distributions. I have attached the general theme in my code so far, in case that helps explain my question better.
P = plan(Model,Range);
P = endogenize(P,Shocks,Range);

for jj = 1:10                                           where 10 is the number of simulation paths
    for ii = 1:3                                        where 3 is the total # of shocks in the system (no measurement shocks)
        Data.mean.(Shocks{ii}))(Range)   =   R(:,ii);   where R contains the draws from empirical distributions
    Simulation  =  jforecast(Model,  Data,  Range,  'plan=',  P,  'anticipate=',  false,  'meanOnly=',true);  
Thanks again.

Jul 2, 2014 at 4:21 PM
Ok, I think I figured this one out. I went back to the tutorials and realized that 'simulate' was the way to go in this case. There is no need to create a plan or use 'jforecast'. Once the shocks are drawn from the empirical distributions we need to simply use them as an input in 'simulate', which is able to take several data sets. I'm sorry for the initial confusion. Should have checked those tutorials before :)

Have a nice day.