Make undocumented zero_moments_tolerance option local to disp_moments

See discussion in https://git.dynare.org/Dynare/preprocessor/-/merge_requests/85
kalman-mex
Willi Mutschler 2023-10-18 23:27:45 +02:00
parent 5145bd0708
commit da4bc40e66
No known key found for this signature in database
GPG Key ID: 91E724BF17A73F6D
2 changed files with 3 additions and 3 deletions

View File

@ -156,7 +156,6 @@ end
% IRFs & other stoch_simul output
options_.irf = 40;
options_.impulse_responses.plot_threshold=1e-10;
options_.zero_moments_tolerance=1e-10;
options_.relative_irf = false;
options_.ar = 5;
options_.hp_filter = 0;

View File

@ -28,6 +28,7 @@ function oo_=disp_moments(y,var_list,M_,options_,oo_)
% You should have received a copy of the GNU General Public License
% along with Dynare. If not, see <https://www.gnu.org/licenses/>.
zero_moments_tolerance=1e-10;
warning_old_state = warning;
warning off
@ -68,7 +69,7 @@ if ~all(M_.H==0)
y_ME_only_filtered=get_filtered_time_series(y_ME_only,mean(y_ME_only),options_);
s2_ME = mean(y_ME.*y_ME);
s_ME = sqrt(s2_ME);
zero_variance_ME_var_index=index_subset(abs(s_ME')<options_.zero_moments_tolerance);
zero_variance_ME_var_index=index_subset(abs(s_ME')<zero_moments_tolerance);
end
end
@ -85,7 +86,7 @@ oo_.var = y'*y/size(y,1);
oo_.skewness = (mean(y.^3)./s2.^1.5)';
oo_.kurtosis = (mean(y.^4)./(s2.*s2)-3)';
zero_variance_var_index=find(abs(s)<options_.zero_moments_tolerance);
zero_variance_var_index=find(abs(s)<zero_moments_tolerance);
oo_.skewness(zero_variance_var_index)=NaN;
oo_.kurtosis(zero_variance_var_index)=NaN;
s(zero_variance_var_index)=0;