Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Dóra Kocsis
dynare
Commits
f94d4e91
Commit
f94d4e91
authored
Oct 13, 2011
by
MichelJuillard
Browse files
allowing for vector of deterministic shocks
parent
0a3545f2
Changes
3
Show whitespace changes
Inline
Side-by-side
doc/dynare.texi
View file @
f94d4e91
...
...
@@ -2070,9 +2070,10 @@ It is possible to specify shocks which last several periods and which can
vary over time. The @code{periods} keyword accepts a list of
several dates or date ranges, which must be matched by as many shock values
in the @code{values} keyword. Note that a range in the
@code{periods} keyword must be matched by only one value in the
@code{values} keyword: this syntax means that the exogenous variable
will have a constant value over the range.
@code{periods} keyword can be matched by only one value in the
@code{values} keyword. If @code{values} represents a scalar, the same
value applies to the whole range. If @code{values} represents a vector,
it must have as many elements as there are periods in the range.
Note that shock values are not restricted to numerical constants:
arbitrary expressions are also allowed, but you have to enclose them
...
...
@@ -2097,6 +2098,18 @@ values (1+p) (exp(z));
end;
@end example
A second example with a vector of values:
@example
xx = [1.2; 1.3; 1];
shocks;
var e;
periods 1:3;
values (xx);
end;
@end example
@customhead{In stochastic context}
For stochastic simulations, the @code{shocks} block specifies the non
...
...
matlab/set_shocks.m
View file @
f94d4e91
...
...
@@ -48,11 +48,19 @@ end
switch
flag
case
0
if
size
(
values
,
1
)
==
1
oo_
.
exo_simul
(
k
,
ivar
)
=
repmat
(
values
,
length
(
k
),
1
);
else
oo_
.
exo_simul
(
k
,
ivar
)
=
values
;
end
case
1
oo_
.
exo_simul
(
k
,
ivar
)
=
oo_
.
exo_simul
(
k
,
ivar
)
.*
values
;
case
2
if
size
(
values
,
1
)
==
1
oo_
.
exo_det_simul
(
k
,
ivar
)
=
repmat
(
values
,
length
(
k
),
1
);
else
oo_
.
exo_det_simul
(
k
,
ivar
)
=
values
;
end
case
3
oo_
.
exo_det_simul
(
k
,
ivar
)
=
oo_
.
exo_det_simul
(
k
,
ivar
)
.*
values
;
end
...
...
tests/ramst_vec.mod
0 → 100644
View file @
f94d4e91
var c k;
varexo x;
parameters alph gam delt bet aa;
alph=0.5;
gam=0.5;
delt=0.02;
bet=0.05;
aa=0.5;
model;
c + k - aa*x*k(-1)^alph - (1-delt)*k(-1);
c^(-gam) - (1+bet)^(-1)*(aa*alph*x(+1)*k^(alph-1) + 1 - delt)*c(+1)^(-gam);
end;
initval;
x = 1;
k = ((delt+bet)/(1.0*aa*alph))^(1/(alph-1));
c = aa*k^alph-delt*k;
end;
steady;
check;
a=[1.2; 1.1];
shocks;
var x;
periods 1:2;
values (a);
end;
simul(periods=200);
rplot c;
rplot k;
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment