Skip to content
Snippets Groups Projects
Verified Commit fbe91646 authored by Johannes Pfeifer's avatar Johannes Pfeifer Committed by Sébastien Villemot
Browse files

PKF: document incompatibilities and throw proper errors if triggered

(manually cherry picked from commit 8ac72590)
parent 576bb480
Branches
Tags
No related merge requests found
......@@ -4870,6 +4870,11 @@ All of these elements are discussed in the following.
to NaN and the standard deviation of the associated shock set to 0 for the
corresponding periods using the ``heteroskedastic_shocks``-block.
 
Note that models with unit roots will require the user to specify the ``diffuse_filter``-option as
otherwise Blanchard-Kahn errors will be triggered. For the piecewise Kalman filter, the
initialization steps in the diffuse filter will always rely on the model solved for the baseline
regime, without checking whether this is the actual regime in the first period(s).
*Example*
 
::
......@@ -4978,7 +4983,8 @@ All of these elements are discussed in the following.
.. option:: likelihood_piecewise_kalman_filter
 
Employ the piecewise Kalman filter of *Giovannini, Pfeiffer, and Ratto (2021)* when estimating
the model. Default: enabled.
the model. Note that this filter is incompatible with univariate Kalman filters, i.e. ``kalman_algo=2,4``.
Default: enabled.
 
.. option:: likelihood_max_kalman_iterations
 
......@@ -6991,7 +6997,9 @@ block decomposition of the model (see :opt:`block`).
Koopman (2012)* and *Koopman and Durbin (2003)* for the
multivariate and *Koopman and Durbin (2000)* for the univariate
filter) to estimate models with non-stationary observed
variables.
variables. This option will also reset the ``qz_criterium`` to
count unit root variables towards the stable variables. Trying to estimate
a model with unit roots will otherwise result in a Blanchard-Kahn error.
 
When ``diffuse_filter`` is used the ``lik_init`` option of
``estimation`` has no effect.
......
......@@ -20,7 +20,7 @@ function DynareResults = initial_estimation_checks(objective_function,xparam1,Dy
% SPECIAL REQUIREMENTS
% none
% Copyright (C) 2003-2018 Dynare Team
% Copyright © 2003-2022 Dynare Team
%
% This file is part of Dynare.
%
......@@ -80,6 +80,12 @@ if DynareOptions.occbin.likelihood.status || DynareOptions.occbin.smoother.statu
if DynareOptions.prefilter
error('initial_estimation_checks:: Occbin is incompatible with the prefilter option due to the sample mean generally not corresponding to the steady state with an occasionally binding constraint.')
end
if ~DynareOptions.occbin.likelihood.inversion_filter && (DynareOptions.kalman_algo==2 || DynareOptions.kalman_algo==4)
error('initial_estimation_checks:: Occbin is incompatible with the selected univariate Kalman filter.')
end
if DynareOptions.fast_kalman_filter
error('initial_estimation_checks:: Occbin is incompatible with the fast Kalman filter.')
end
end
if (DynareOptions.occbin.likelihood.status && DynareOptions.occbin.likelihood.inversion_filter) || (DynareOptions.occbin.smoother.status && DynareOptions.occbin.smoother.inversion_filter)
......@@ -323,4 +329,4 @@ end
function evaluate_expression(expression,M_,oo_)
% function evaluate_expression(expression,M_,oo_)
%evaluates expressions relying on M_ and oo_ having their original names
eval(expression);
\ No newline at end of file
eval(expression);
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment