# Mixing determininistic and stochastic shocks

**URL:** <https://forum.dynare.org/t/mixing-determininistic-and-stochastic-shocks/1631>\
**Category:** Dynare help (legacy posts)\
**Created:** [30 August 2010 18:21 UTC](https://forum.dynare.org/t/mixing-determininistic-and-stochastic-shocks/1631 "2010-08-30T18:21:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![AnitaYang](https://forum.dynare.org/letter_avatar_proxy/v4/letter/a/e36b37/32.png) [@AnitaYang](https://forum.dynare.org/u/AnitaYang)\
**Post date:** [30 August 2010 18:21 UTC](https://forum.dynare.org/t/mixing-determininistic-and-stochastic-shocks/1631/1 "2010-08-30T18:21:20Z")

</div>

Hi,

I try to mix determininistic and stochastic shocks when my equations depend on some exogenous variable (say, world interest rate.)

I declare

`varexo_det lcstar lpistar lrstar;
varexo nua nug;`

and have the block of shock as follows

`shocks;   
var nua; stderr 0.01;
var nug; stderr 0.01;
var lcstar;
periods 1:9;
values -0.15;
var lpistar;
periods 1:9;
values 0.01;
var lrstar;
periods 1:9;
values 0.02;
end;`

## It seems to me that there are five exogenous variables defined in the .mod file. However, I got the following error message:

## ??? Attempted to access x(3); index out of bounds because numel(x)=2.

It seems that Dynare only recoganize two exogenous variables which are contained in “x” vector. Does anyone know what is wrong in my codes? Thank you.

---

<div class="post-metadata">

**Author:** ![sebastien](https://forum.dynare.org/user_avatar/forum.dynare.org/sebastien/32/19973_2.png) [@sebastien](https://forum.dynare.org/u/sebastien)\
**Post date:** [13 September 2010 09:11 UTC](https://forum.dynare.org/t/mixing-determininistic-and-stochastic-shocks/1631/2 "2010-09-13T09:11:19Z")

</div>

Hi,

For Dynare there are indeed two exogenous: deterministic exogenous are treated separately.

Please post your MOD file, so that we can determine if your problem is a bug in Dynare or an error from your side.

Best,
