Bansal and Yaron (Stochastic Volatility)

I am trying to simulate Bansal and Yaron (2004) with stochastic volatility. The code is attached as a mod file:
BansalYaron.mod (1.2 KB)

3 questions:

  1. When I run the code I get the following error message:
    STOCH_SIMUL error: The horizon of simulation is shorter than the number of observations to be dropped.
    STOCH_SIMUL error: Either increase options_.periods or decrease options_.drop."

This is fixed if I increase number of periods but still I would like some explanation for why 100 periods is a problem here.

  1. Secondly, I am getting crazy answers for market returns (rm) (almost 60% annualized return!). So could I get some advice as to if something looks weird in this code? Also the parameters are calibrated to meet annual moments of consumption and asset market data, so is it appropriate to interpret each period in this code as monthly or annual?

  2. Finally. The code crashes when I try to add risk free rate to model which I define as the inverse of the expected SDF:

rf = 1/DELTA^THETA * exp((-THETA/PSI)*dc(+1) + (THETA-1)*log(rc));

I get the following error message:

"Error using print_info (line 32)
The steady state has NaNs or Inf.

Error in steady (line 102)
print_info(info,options_.noprint, options_);

Error in AssetPricingApproximation.driver (line 219)

Error in dynare (line 293)
evalin(‘base’,[fname ‘.driver’]) ; "

Not sure why this is. Any help would be greatly appreciated.


  1. The default options_.drop is 100, i.e. Dynare drops 100 observations at the beginning of the simulation as a burn-in. So only using 100 observations in total would leaving nothing after the burn-in.
  2. When using theoretical moments, I get
rm             1.0126     0.0443     0.0020

So it may have to do with explosive simulations.
3. Try BansalYaron.mod (1.4 KB) . Also note that the steady state value for vd does not seem to add up. That may indicate a problem.

Thanks for your reply. A few additional questions:

  1. Looking at your mod file, I don’t see what is the difference between your code and mine. In my version the code doesn’t run- it says the steady state has NaN values!
  2. What do you mean that the SS value of VD does not add up?
  3. How do interpret the period intervals when I run this calibration? Should I interpret 1.0126? Is this the unconditional mean of the gross return at a monthly frequency simulated by Dynare?

Regarding (3), In Bansal and Yaron (2004), they use calibrations to match moments of monthly data. So I assume this is the correct interpretation. But if this is the case the annualized return would be incredibly higher (more than 10%!).

  1. Finally, this may be a silly question but when I run this code, dynare is giving me theoretical moments from a SINGLE simulation around the deterministic steady state right? It isn’t giving me moments from the average of many simulations?

Sorry for all the questions, I am new to dynare.

  1. I explicitly initialize all variables in initval.
  2. You can verify with resid that your initial values solve all equations except for one, namely the one for VD.
  3. Yes, the theoretical moments are the analytically computed unconditional moments.
  4. A theoretical, i.e. population object is different from a sample object, i.e. one run.

I cannot speak to the size of the results as I haven’t looked at the original paper. But if your calibration is monthly, then the annualized return should be more than 10 percent.