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
Marco Ratto
dynare
Commits
3ad654b9
Verified
Commit
3ad654b9
authored
Sep 27, 2018
by
MichelJuillard
Committed by
Stéphane Adjemian(Charybdis)
Sep 27, 2018
Browse files
Allowing for different number of periods in conditional_forecast_path.
Updated preprocessor submodule.
parent
39110b30
Changes
3
Hide whitespace changes
Inline
Side-by-side
doc/dynare.texi
View file @
3ad654b9
...
...
@@ -8208,6 +8208,14 @@ variables between the first and last specified period. If an intermediate period
is not specified, a value of 0 is assumed. That is, if you specify only
values for periods 1 and 3, the values for period 2 will be 0. Currently, it is not
possible to have uncontrolled intermediate periods.
It is however possible to
have different number of controlled periods for different variables. In that
case, the order of declaration of endogenenous controlled variables and of
controlled_varexo matters: if the second endogenous variable is controlled for
less periods than the first one, the second controlled_varexo isn't set for
the last periods.
In case of the presence of @code{observation_trends}, the specified controlled path for
these variables needs to include the trend component. When using the @ref{loglinear} option,
it is necessary to specify the logarithm of the controlled variables.
...
...
matlab/mcforecast3.m
View file @
3ad654b9
...
...
@@ -27,6 +27,10 @@ function [forcs, e]= mcforecast3(cL,H,mcValue,shocks,forcs,T,R,mv,mu)
% This is then solved to get:
% shocks_controlled_t=(y_t(controlled_vars_index)-(T*y_{t-1}(controlled_vars_index)+R(controlled_vars_index,uncontrolled_shocks_index)*shocks_uncontrolled_t)/R(controlled_vars_index,controlled_shocks_index)
%
% Variable number of controlled vars are allowed in different
% periods. Missing control information are indicated by NaN in
% y_t(controlled_vars_index).
%
% After obtaining the shocks, and for uncontrolled periods, the state-space representation
% y_t=T*y_{t-1}+R*shocks(:,t)
% is used for forecasting
...
...
@@ -51,8 +55,10 @@ function [forcs, e]= mcforecast3(cL,H,mcValue,shocks,forcs,T,R,mv,mu)
if
cL
e
=
zeros
(
size
(
mcValue
,
1
),
cL
);
for
t
=
1
:
cL
e
(:,
t
)
=
inv
(
mv
*
R
*
mu
)
*
(
mcValue
(:,
t
)
-
mv
*
T
*
forcs
(:,
t
)
-
mv
*
R
*
shocks
(:,
t
));
forcs
(:,
t
+
1
)
=
T
*
forcs
(:,
t
)
+
R
*
(
mu
*
e
(:,
t
)
+
shocks
(:,
t
));
% missing conditional values are indicated by NaN
k
=
find
(
isfinite
(
mcValue
(:,
t
)));
e
(
k
,
t
)
=
inv
(
mv
(
k
,:)
*
R
*
mu
(:,
k
))
*
(
mcValue
(
k
,
t
)
-
mv
(
k
,:)
*
T
*
forcs
(:,
t
)
-
mv
(
k
,:)
*
R
*
shocks
(:,
t
));
forcs
(:,
t
+
1
)
=
T
*
forcs
(:,
t
)
+
R
*
(
mu
(:,
k
)
*
e
(
k
,
t
)
+
shocks
(:,
t
));
end
end
for
t
=
cL
+
1
:
H
...
...
preprocessor
@
680fb72d
Compare
fbeae961
...
680fb72d
Subproject commit
fbeae9619ab9603410a11a11af92a7dfeea0af81
Subproject commit
680fb72d0dcb15ea4831fc9dd71acb04661d9519
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