Merge branch 'octave_ispd' into 'master'
ispd.m: filter out Octave incompatibility https://savannah.gnu.org/bugs/?63082 See merge request Dynare/dynare!2082bgp-dev
commit
a8054c16ba
|
@ -24,7 +24,7 @@ function [test, penalty] = ispd(A)
|
||||||
%! @end deftypefn
|
%! @end deftypefn
|
||||||
%@eod:
|
%@eod:
|
||||||
|
|
||||||
% Copyright © 2007-2017 Dynare Team
|
% Copyright © 2007-2022 Dynare Team
|
||||||
%
|
%
|
||||||
% This file is part of Dynare.
|
% This file is part of Dynare.
|
||||||
%
|
%
|
||||||
|
@ -45,12 +45,15 @@ if ~isquare(A)
|
||||||
error(['ispd:: Input argument ' inputname(1) ' has to be a square matrix!'])
|
error(['ispd:: Input argument ' inputname(1) ' has to be a square matrix!'])
|
||||||
end
|
end
|
||||||
|
|
||||||
[cholA, info] = chol(A);
|
[~, info] = chol(A);
|
||||||
test = ~info;
|
test = ~info;
|
||||||
|
|
||||||
if nargout>1
|
if nargout>1
|
||||||
penalty = 0;
|
penalty = 0;
|
||||||
if info
|
if info
|
||||||
|
if isoctave && any(any(~isfinite(A))) % workaround for https://savannah.gnu.org/bugs/index.php?63082
|
||||||
|
penalty = 1;
|
||||||
|
else
|
||||||
a = diag(eig(A));
|
a = diag(eig(A));
|
||||||
k = find(a<0);
|
k = find(a<0);
|
||||||
if k > 0
|
if k > 0
|
||||||
|
@ -58,3 +61,4 @@ if nargout>1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
|
@ -210,10 +210,10 @@ method_of_moments(
|
||||||
, se_tolx=1e-6 % step size for numerical computation of standard errors
|
, se_tolx=1e-6 % step size for numerical computation of standard errors
|
||||||
|
|
||||||
% Options for SMM
|
% Options for SMM
|
||||||
% , burnin=500 % number of periods dropped at beginning of simulation
|
, burnin=50 % number of periods dropped at beginning of simulation
|
||||||
, bounded_shock_support % trim shocks in simulation to +- 2 stdev
|
, bounded_shock_support % trim shocks in simulation to +- 2 stdev
|
||||||
% , seed = 24051986 % seed used in simulations
|
% , seed = 24051986 % seed used in simulations
|
||||||
% , simulation_multiple = 5 % multiple of the data length used for simulation
|
, simulation_multiple = 5 % multiple of the data length used for simulation
|
||||||
|
|
||||||
% Options for GMM
|
% Options for GMM
|
||||||
@#if MoM_Method == "GMM"
|
@#if MoM_Method == "GMM"
|
||||||
|
@ -244,7 +244,7 @@ method_of_moments(
|
||||||
, mode_compute = 0
|
, mode_compute = 0
|
||||||
@#else
|
@#else
|
||||||
, mode_compute = 13 % specifies the optimizer for minimization of moments distance
|
, mode_compute = 13 % specifies the optimizer for minimization of moments distance
|
||||||
, additional_optimizer_steps = [1] % vector of additional mode-finders run after mode_compute
|
, additional_optimizer_steps = [4] % vector of additional mode-finders run after mode_compute
|
||||||
, mode_check % plot the target function for values around the computed minimum for each estimated parameter in turn
|
, mode_check % plot the target function for values around the computed minimum for each estimated parameter in turn
|
||||||
@#endif
|
@#endif
|
||||||
% optim: a list of NAME and VALUE pairs to set options for the optimization routines. Available options depend on mode_compute, some exemplary common options:
|
% optim: a list of NAME and VALUE pairs to set options for the optimization routines. Available options depend on mode_compute, some exemplary common options:
|
||||||
|
|
Loading…
Reference in New Issue