doc: fix doc following recent changes

time-shift
Houtan Bastani 2017-03-21 11:24:11 +01:00
parent a4eb8d6b91
commit 2a33cd1bb0
1 changed files with 137 additions and 75 deletions

View File

@ -7088,23 +7088,25 @@ calibrated model.
@xref{nobs}. @xref{nobs}.
@item use_shock_groups [= @var{SHOCK_GROUPS_NAME}] @item use_shock_groups [= @var{SHOCK_GROUPS_NAME}]
@anchor{use_shock_groups}. Uses groups of shocks instead of individual shocks in @anchor{use_shock_groups} Uses groups of shocks instead of individual shocks in
the decomposition. Groups of shocks are defined in @xref{shock_groups} block. the decomposition. Groups of shocks are defined in the @ref{shock_groups} block.
@item colormap = @var{COLORMAP_NAME} @item colormap = @var{COLORMAP_NAME}
@anchor{colormap}. Controls the colormap used for the shocks decomposition @anchor{colormap} Controls the colormap used for the shocks decomposition
graphs. See @code{colormap} in Matlab/Octave manual. graphs. See @code{colormap} in Matlab/Octave manual.
@item nograph @item nograph
@xref{nograph}. Suppresses the display and creation only within the @code{shock_decomposition}-command @xref{nograph} Suppresses the display and creation only within the
but does not affect other commands. See also @xref{plot_shock_decomposition} for plotting graphs. @code{shock_decomposition}-command but does not affect other commands.
@xref{plot_shock_decomposition} for plotting graphs.
@item init_state = @var{INTEGER} @item init_state = @var{INTEGER}
@anchor{init_state}. It can take values of 0 (=default) and 1. @anchor{init_state} It can take values of @math{0} or @math{1}. If equal to
If @code{init_state= 0}, the shock decomposition is computed conditional on the smoothed state variables @math{0}, the shock decomposition is computed conditional on the smoothed state
in period 0, i.e. the smoothed shocks starting in period 1 are used. variables in period @math{0}, @i{i.e.} the smoothed shocks starting in period
If @code{init_state= 1}, the shock decomposition is computed conditional on the smoothed state variables @math{1} are used. If equal to @math{1}, the shock decomposition is computed
in period 1. conditional on the smoothed state variables in period @math{1}. Default:
@math{0}
@end table @end table
@outputhead @outputhead
@ -7172,13 +7174,21 @@ shocks_decomposition(use_shock_groups=group1);
@descriptionhead @descriptionhead
This command computes the realtime historical shock decomposition for a given sample based on This command computes the realtime historical shock decomposition for a given
the Kalman smoother. For each period @code{T=presample:nobs}, it computes sample based on the Kalman smoother. For each period
- realtime historical shock decomposition Y(t|T) for t=1:T, i.e. without observing data in [T+1:nobs]; @math{T=[@code{presample}@dots{}@code{nobs}]}, it computes the:
- conditional shock decomposition Y(T|T) CONDITIONAL on Y(T|T-1), i.e. Y(t|T) for t=T-1:T; @itemize @bullet
- forecast shock decomposition Y(T|T-1). @item
realtime historical shock decomposition @math{Y(t|T)} for @math{t=[1@dots{}T]},
@i{i.e.} without observing data in @math{[T+1@dots{}@code{nobs}]};
@item
conditional shock decomposition @math{Y(T|T)} conditional on @math{Y(T|T-1)},
@i{i.e.} @math{Y(t|T)} for @math{t=[T-1@dots{}T]};
@item
forecast shock decomposition @math{Y(T|T-1)}.
@end itemize
Like @xref{shock_decomposition} it decomposes the historical deviations of the endogenous Like @ref{shock_decomposition} it decomposes the historical deviations of the endogenous
variables from their respective steady state values into the contribution coming variables from their respective steady state values into the contribution coming
from the various shocks. The @code{variable_names} provided govern for which from the various shocks. The @code{variable_names} provided govern for which
variables the decomposition is plotted. variables the decomposition is plotted.
@ -7192,7 +7202,7 @@ model).
@table @code @table @code
@item parameter_set = @var{PARAMETER_SET} @item parameter_set = @var{PARAMETER_SET}
Specify the parameter set to use for running the smoother. The Specify the parameter set to use for running the smoother.
@var{PARAMETER_SET} can take one of the following seven values: @var{PARAMETER_SET} can take one of the following seven values:
@code{calibration}, @code{prior_mode}, @code{prior_mean}, @code{calibration}, @code{prior_mode}, @code{prior_mean},
@code{posterior_mode}, @code{posterior_mean}, @code{posterior_mode}, @code{posterior_mean},
@ -7210,12 +7220,13 @@ calibrated model.
@xref{nobs}. @xref{nobs}.
@item use_shock_groups [= @var{SHOCK_GROUPS_NAME}] @item use_shock_groups [= @var{SHOCK_GROUPS_NAME}]
@anchor{use_shock_groups_realtime}. Uses groups of shocks instead of individual shocks in @anchor{use_shock_groups_realtime} Uses groups of shocks instead of individual
the decomposition. Groups of shocks are defined in @xref{shock_groups} block. shocks in the decomposition. Groups of shocks are defined in the
@ref{shock_groups} block.
@item colormap = @var{COLORMAP_NAME} @item colormap = @var{COLORMAP_NAME}
@anchor{colormap_realtime}. Controls the colormap used for the shocks decomposition @anchor{colormap_realtime} Controls the colormap used for the shocks
graphs. See @code{colormap} in Matlab/Octave manual. decomposition graphs. See @code{colormap} in Matlab/Octave manual.
@item nograph @item nograph
@xref{nograph}. Only shock decompositions are computed and stored in @code{oo_.realtime_shock_decomposition}, @xref{nograph}. Only shock decompositions are computed and stored in @code{oo_.realtime_shock_decomposition},
@ -7223,36 +7234,48 @@ graphs. See @code{colormap} in Matlab/Octave manual.
(@xref{plot_shock_decomposition}). (@xref{plot_shock_decomposition}).
@item presample @item presample
@anchor{presample_shock_decomposition}. First data point from which recursive realtime shock decompositions are computed, i.e. for T=(presample:nobs). @anchor{presample_shock_decomposition} First data point from which recursive
realtime shock decompositions are computed, @i{i.e.} for
@math{T=[@code{presample}@dots{}@code{nobs}]}.
@item forecast @item forecast
@anchor{forecast_shock_decomposition}. Compute shock decompositions up to T+k periods, i.e. get shock contributions to k-step ahead forecasts. @anchor{forecast_shock_decomposition} Compute shock decompositions up to
@math{T+k} periods, @i{i.e.} get shock contributions to k-step ahead forecasts.
@item save_realtime = [@var{integer1} ... @var{integern}] @item save_realtime = [@var{integer1} ... @var{integern}]
@anchor{save_realtime}. Choose for which vintages to save the full realtime shock decomposition. Default = 0. @anchor{save_realtime} Choose for which vintages to save the full realtime
shock decomposition. Default: @math{0}.
@end table @end table
@outputhead @outputhead
@vindex oo_.realtime_shock_decomposition @vindex oo_.realtime_shock_decomposition
The results of realtime historical decompositions are stored in the field @code{oo_.realtime_shock_decomposition}, which is a structure. The results of realtime historical decompositions are stored in the field
Field @code{pool} stores the pooled decomposition @xref{plot_shock_decomposition}. @code{oo_.realtime_shock_decomposition}, which is a structure. Field
Fields @code{time_*} store the vintages of realtime historical shock decompositions. @code{pool} stores the pooled decomposition (@xref{plot_shock_decomposition}).
Fields @code{time_*} store the vintages of realtime historical shock
decompositions.
@vindex oo_.conditional_shock_decomposition @vindex oo_.conditional_shock_decomposition
The results of realtime conditional decompositions are stored in the field @code{oo_.conditional_shock_decomposition}, which is a structure. The results of realtime conditional decompositions are stored in the field
Field @code{pool} stores the pooled decomposition Y(t|T) for t=T-1:T @xref{plot_shock_decomposition}. @code{oo_.conditional_shock_decomposition}, which is a structure. Field
Conditional shock decomposition sets the initial condition in T-1, so only computes the effect of shocks in period T, @code{pool} stores the pooled decomposition @math{Y(t|T)} for
i.e. it is just a 1-period shock decomposition from T-1 to T. In practice it decomposes the update step of the Kalman filter. @math{t=T-1@dots{}T} @xref{plot_shock_decomposition}. Conditional shock
Fields @code{time_*} store the vintages of k-step conditional forecast shock decompositions Y(t|T+k), for t=T:T+k. decomposition sets the initial condition in @math{T-1}, so only computes the
See also @xref{vintage}. effect of shocks in period @math{T}, @i{i.e.} it is just a @math{1}-period
shock decomposition from @math{T-1} to @math{T}. In practice it decomposes the
update step of the Kalman filter. Fields @code{time_*} store the vintages of
@math{k}-step conditional forecast shock decompositions @math{Y(t|T+k)}, for
@math{t=[T@dots{}T+k}. @xref{vintage}.
@vindex oo_.realtime_forecast_shock_decomposition @vindex oo_.realtime_forecast_shock_decomposition
The results of realtime forecast decompositions are stored in the field @code{oo_.realtime_forecast_shock_decomposition}, which is a structure. The results of realtime forecast decompositions are stored in the field
Field @code{pool} stores the pooled decomposition @xref{plot_shock_decomposition}. @code{oo_.realtime_forecast_shock_decomposition}, which is a structure. Field
Forecast shock decomposition computes the 1-step ahead effect of shocks on the 1-step ahead prediction, i.e. Y(T|T-1). @code{pool} stores the pooled decomposition @xref{plot_shock_decomposition}.
Fields @code{time_*} store the vintages of k-step out-of-sample forecast shock decompositions, i.e. Y(t|T), for t=T:T+k. Forecast shock decomposition computes the @math{1}-step ahead effect of shocks
See also @xref{vintage}. on the @math{1}-step ahead prediction, @i{i.e.} @math{Y(T|T-1)}. Fields
@code{time_*} store the vintages of @math{k}-step out-of-sample forecast shock
decompositions, @i{i.e.} @math{Y(t|T)}, for @math{t=[T@dots{}T+k]}. @xref{vintage}.
@end deffn @end deffn
@ -7274,11 +7297,12 @@ Note that this command must come after @code{shock_decomposition} or @code{realt
@table @code @table @code
@item use_shock_groups [= @var{SHOCK_GROUPS_NAME}] @item use_shock_groups [= @var{SHOCK_GROUPS_NAME}]
@anchor{use_shock_groups_plot}. Uses groups of shocks instead of individual shocks in @anchor{use_shock_groups_plot} Uses groups of shocks instead of individual
the decomposition. Groups of shocks are defined in @xref{shock_groups} block. shocks in the decomposition. Groups of shocks are defined in the
@ref{shock_groups} block.
@item colormap = @var{COLORMAP_NAME} @item colormap = @var{COLORMAP_NAME}
@anchor{colormap_plot}. Controls the colormap used for the shocks decomposition @anchor{colormap_plot} Controls the colormap used for the shocks decomposition
graphs. See @code{colormap} in Matlab/Octave manual. graphs. See @code{colormap} in Matlab/Octave manual.
@item nodisplay @item nodisplay
@ -7288,56 +7312,94 @@ graphs. See @code{colormap} in Matlab/Octave manual.
@xref{graph_format}. @xref{graph_format}.
@item detailed @item detailed
@anchor{detailed}. Plots shock contributions using subplots, one per shock (or group of shocks). @anchor{detailed} Plots shock contributions using subplots, one per shock (or group of shocks).
@item interactive @item interactive
@anchor{interactive}. Under MATLAB, add uimenu's for detailed group plots. @anchor{interactive} Under MATLAB, add uimenu's for detailed group plots.
@item screen @item screen
@anchor{screen}. For large models [i.e. for models with more than 16 shocks], plots only the shocks @anchor{screen} For large models (@i{i.e.} for models with more than @math{16}
that have the largest historical contribution for chosen selected @code{variable_names}. shocks), plots only the shocks that have the largest historical contribution
Historical contribution is ranked by the mean absolute value of all historical contributions. for chosen selected @code{variable_names}. Historical contribution is ranked
by the mean absolute value of all historical contributions.
@item steadystate = @var{INTEGER} @item steadystate = @var{INTEGER}
@anchor{steadystate}. 0=default. @anchor{steadystate} If equal to @math{1}, the the @math{y}-axis value of the
If =1, the the y-axis value of the zero line in the shock decomposition plot is translated to the steady state level. zero line in the shock decomposition plot is translated to the steady state
level. Default: @math{0}
@item type = @var{TYPE_NAME} @item type = @var{TYPE_NAME}
@anchor{type}. For quarterly data, the @var{TYPE_NAME} can take one of the following values: @anchor{type} For quarterly data, @var{TYPE_NAME} can take one of the
@code{qoq} for quarter-on-quarter plots, following values: @code{qoq} for quarter-on-quarter plots, @code{yoy} for
@code{yoy} for year-on-year plots of growth rates, year-on-year plots of growth rates, @code{aoa} for annualized variables,
@code{aoa} for annualized variables, i.e. the value in the last quarter for each year is plotted. @i{i.e.} the value in the last quarter for each year is plotted. Default
Default value: @code{empty}, i.e. standard period-on-period plots [qoq for quarterly data]. value: @code{empty}, @i{i.e.} standard period-on-period plots (@code{qoq} for
quarterly data).
@item fig_name = @var{FIG_NAME} @item fig_name = @var{FIG_NAME}
@anchor{fig_name}. Specifies a user-defined keyword to be appended to the default figure name set by @code{plot_shock_decomposition}. @anchor{fig_name} Specifies a user-defined keyword to be appended to the
This can avoid to overwrite plots in case of sequential calls to @code{plot_shock_decomposition}. default figure name set by @code{plot_shock_decomposition}. This can avoid to
overwrite plots in case of sequential calls to @code{plot_shock_decomposition}.
@item write_xls @item write_xls
@anchor{write_xls}. Saves shock decompositions to excel. @anchor{write_xls} Saves shock decompositions to excel.
@item realtime = @var{INTEGER} @item realtime = @var{INTEGER}
@anchor{realtime}. Which kind of shock decomposition to plot. @var{INTEGER} can take following values: @anchor{realtime} Which kind of shock decomposition to plot. @var{INTEGER} can take following values:
@code{0}: historical shock decomposition: Y(t|T) for t=1:T, T=nobs full sample [DEFAULT] @itemize @bullet
@code{1}: realtime historical shock decomposition: for T=1:nobs, realtime shock decomposition Y(t|T) for t=1:T @item
@code{2}: conditional shock decomposition: for T=1:nobs, realtime shock decomposition of Y(T|T) CONDITIONAL on Y(T|T-1), i.e. Y(t|T) for t=T-1:T @code{0}: historical shock decomposition: @math{Y(t|T)} for
@code{3}: forecast shock decomposition: for T=1:nobs, realtime shock decomposition of Y(T|T-1) @math{t=[1@dots{}T]}, @math{T=} @code{nobs} full sample
@item
@code{1}: realtime historical shock decomposition: for
@math{T=[1@dots{}@code{nobs}]}, realtime shock decomposition @math{Y(t|T)} for
@math{t=[1@dots{}T]}
@item
@code{2}: conditional shock decomposition: for @code{T=1:nobs}, realtime shock
decomposition of @math{Y(T|T)} conditional on @math{Y(T|T-1)}, @i{i.e.}
@math{Y(t|T)} for @math{t=[T-1@dots{}T]}
@item
@code{3}: forecast shock decomposition: for @math{T=[1@dots{}@code{nobs}]},
realtime shock decomposition of @math{Y(T|T-1)}
@end itemize
Default: @math{0}
@item vintage = @var{INTEGER} @item vintage = @var{INTEGER}
@anchor{vintage}. Applies if @code{realtime}>0. @var{INTEGER} can take following values: @anchor{vintage} Applies if @code{realtime}@math{>0}. Can take following values:
@itemize @bullet
@code{0}: plots 1step pooled shock decompositions [DEFAULT] @item
@code{realtime=1}: pooled realtime shock decomposition. For T=1:nobs, plots last time point Y(T|T) of each vintage shock decomposition Y(1:T|T) @code{0}: plots @math{1}-step pooled shock decompositions
@code{realtime=2}: pooled conditional shock decomposition. For T=1:nobs, realtime 1-step shock decomposition of Y(T|T) CONDITIONAL on Y(T|T-1) @item
[i.e. decomposition of 1-step filter updates of each vintage T] @code{1}: pooled realtime shock decomposition. For @math{T=[1@dots{}@code{nobs}]}, plots last
@code{realtime=3}: pooled forecast shock decomposition. For T=1:nobs, realtime 1-step ahead shock decomposition of Y(T|T-1) time point @math{Y(T|T)} of each vintage shock decomposition @math{Y(1:T|T)}
[i.e. decomposition of shock contributions to 1-step ahead forecasts of each vintage T] @item
@code{2}: pooled conditional shock decomposition. For
@code{>0}: plots shock decompositions for vintage T=@code{vintage} under the following scenarios @math{T=[1@dots{}@code{nobs}]}, realtime @math{1}-step shock decomposition of
@code{realtime=1}: the full vintage shock decomposition Y(t|T) for t=1:T @math{Y(T|T)} conditional on @math{Y(T|T-1)} (@i{i.e.} decomposition of
@code{realtime=2}: plots conditional forecast shock decomposition from T, i.e. plots Y(T+j|T+j) @math{1}-step filter updates of each vintage @math{T}}
and the shock contributions needed to get to the data Y(T+j) CONDITIONAL on T=@code{vintage}, with j=(0:@code{forecast}). @item
@code{realtime=3}: plots unconditional forecast shock decomposition from T, i.e. Y(T+j|T), where T=@code{vintage} and j=(0:@code{forecast}). @code{3}: pooled forecast shock decomposition. For
@math{T=[1@dots{}@code{nobs}]}, realtime @math{1}-step ahead shock
decomposition of @math{Y(T|T-1)} (@i{i.e.} decomposition of shock
contributions to @math{1}-step ahead forecasts of each vintage @math{T})
@end itemize
When the value passed is greater than @math{0}, it plots the shock
decompositions for vintage @math{T=@code{vintage}} under the following scenarios:
@itemize @bullet
@item
@code{realtime=1}: the full vintage shock decomposition @math{Y(t|T)} for
@math{t=[1@dots{}T]}
@item
@code{realtime=2}: the conditional forecast shock decomposition from @math{T},
@i{i.e.} plots @math{Y(T+j|T+j)} and the shock contributions needed to get to
the data @math{Y(T+j)} conditional on @math{T=}@code{vintage}, with
@math{j=[0@dots{}@code{forecast}]}.
@item
@code{realtime=3}: plots unconditional forecast shock decomposition from
@math{T}, @i{i.e.} @math{Y(T+j|T)}, where @math{T=@code{vintage}} and
@math{j=[0@dots{}@code{forecast}]}.
@end itemize
Default: @math{0}
@end table @end table
@end deffn @end deffn