Skip to content
Snippets Groups Projects
Commit aa894f86 authored by MichelJuillard's avatar MichelJuillard
Browse files

Merge pull request #1075 from JohannesPfeifer/stochastic_singularity

Condition check for stochastic singularity on maximum of non-missing …
parents c2565e80 33aa22a8
Branches
Tags
No related merge requests found
...@@ -36,11 +36,15 @@ function DynareResults = initial_estimation_checks(objective_function,xparam1,Dy ...@@ -36,11 +36,15 @@ function DynareResults = initial_estimation_checks(objective_function,xparam1,Dy
% You should have received a copy of the GNU General Public License % You should have received a copy of the GNU General Public License
% along with Dynare. If not, see <http://www.gnu.org/licenses/>. % along with Dynare. If not, see <http://www.gnu.org/licenses/>.
if DynareDataset.vobs>Model.exo_nbr+EstimatedParameters.nvn %get maximum number of simultaneously observed variables for stochastic
%singularity check
maximum_number_non_missing_observations=max(sum(~isnan(DynareDataset.data),2));
if maximum_number_non_missing_observations>Model.exo_nbr+EstimatedParameters.nvn
error(['initial_estimation_checks:: Estimation can''t take place because there are less declared shocks than observed variables!']) error(['initial_estimation_checks:: Estimation can''t take place because there are less declared shocks than observed variables!'])
end end
if DynareDataset.vobs>length(find(diag(Model.Sigma_e)))+EstimatedParameters.nvn if maximum_number_non_missing_observations>length(find(diag(Model.Sigma_e)))+EstimatedParameters.nvn
error(['initial_estimation_checks:: Estimation can''t take place because too many shocks have been calibrated with a zero variance!']) error(['initial_estimation_checks:: Estimation can''t take place because too many shocks have been calibrated with a zero variance!'])
end end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment