added an error if periods in conditional_variance_decomposition option

are not strictly positive.
time-shift
Michel Juillard 2011-11-20 15:13:05 +01:00
parent 7840dbbb77
commit 40cc11385a
2 changed files with 8 additions and 3 deletions

View File

@ -3027,16 +3027,16 @@ See below.
@item conditional_variance_decomposition = [@var{INTEGER1} @var{INTEGER2} @dots{}]
Computes a conditional variance decomposition for the specified
period(s). Conditional variances are given by
period(s). The periods must be strictly positive. Conditional variances are given by
@math{var(y_{t+k}|t)}. For period 1, the conditional variance
decomposition provides the decomposition of the effects of shocks upon
impact. The results are stored in
@var{oo_.conditional_variance_decomposition}
@code{oo_.conditional_variance_decomposition}
(@pxref{oo_.conditional_variance_decomposition}).
@item pruning
Discard higher order terms when iteratively computing simulations of
the solution, as in @cite{Schaumburg and Sims (2008)}.
the solution, as in @cite{Kim, Kim, Schaumburg and Sims (2008)}.
@item partial_information
@anchor{partial_information}

View File

@ -33,6 +33,11 @@ function ConditionalVarianceDecomposition = conditional_variance_decomposition(S
% You should have received a copy of the GNU General Public License
% along with Dynare. If not, see <http://www.gnu.org/licenses/>.
if any(Steps <= 0)
error(['Conditional variance decomposition: All periods must be strictly ' ...
'positive'])
end
number_of_state_innovations = ...
StateSpaceModel.number_of_state_innovations;
transition_matrix = StateSpaceModel.transition_matrix;