diff --git a/matlab/perfect-foresight-models/linear_perfect_foresight_problem.m b/matlab/perfect-foresight-models/linear_perfect_foresight_problem.m index 6f4146cb1..1e73e6b0d 100644 --- a/matlab/perfect-foresight-models/linear_perfect_foresight_problem.m +++ b/matlab/perfect-foresight-models/linear_perfect_foresight_problem.m @@ -1,6 +1,6 @@ function [residuals,JJacobian] = linear_perfect_foresight_problem(y, dynamicjacobian, Y0, YT, ... exo_simul, params, steady_state, maximum_lag, T, ny, i_cols, ... - i_cols_J1, i_cols_1, i_cols_T, i_cols_j, i_cols_0, i_cols_J0, nnzJ, jendo, jexog) + i_cols_J1, i_cols_1, i_cols_T, i_cols_j, i_cols_0, i_cols_J0, jendo, jexog) % Computes the residuals and the Jacobian matrix for a linear perfect foresight problem over T periods. % @@ -76,4 +76,4 @@ end if nargout == 2 iJacobian = cat(1,iJacobian{:}); JJacobian = sparse(iJacobian(:,1), iJacobian(:,2), iJacobian(:,3), T*ny, T*ny); -end \ No newline at end of file +end diff --git a/matlab/perfect-foresight-models/perfect_foresight_mcp_problem.m b/matlab/perfect-foresight-models/perfect_foresight_mcp_problem.m index 89d9a7b82..561e0162d 100644 --- a/matlab/perfect-foresight-models/perfect_foresight_mcp_problem.m +++ b/matlab/perfect-foresight-models/perfect_foresight_mcp_problem.m @@ -2,12 +2,12 @@ function [residuals,JJacobian] = perfect_foresight_mcp_problem(y, dynamic_functi exo_simul, params, steady_state, ... maximum_lag, T, ny, i_cols, ... i_cols_J1, i_cols_1, i_cols_T, ... - i_cols_j, i_cols_0,i_cols_J0, nnzJ,eq_index) + i_cols_j, i_cols_0,i_cols_J0, eq_index) % function [residuals,JJacobian] = perfect_foresight_mcp_problem(y, dynamic_function, Y0, YT, ... % exo_simul, params, steady_state, ... % maximum_lag, T, ny, i_cols, ... % i_cols_J1, i_cols_1, i_cols_T, ... -% i_cols_j,nnzJ,eq_index) +% i_cols_j,eq_index) % Computes the residuals and the Jacobian matrix for a perfect foresight problem over T periods % in a mixed complementarity problem context % @@ -33,7 +33,6 @@ function [residuals,JJacobian] = perfect_foresight_mcp_problem(y, dynamic_functi % variables (relevant in last period) % i_cols_j [double] indices of variables in M.lead_lag_incidence % in dynamic Jacobian (relevant in intermediate periods) -% nnzJ [scalar] number of non-zero elements in Jacobian % eq_index [double] N*1 array, index vector describing residual mapping resulting % from complementarity setup % OUTPUTS @@ -45,7 +44,7 @@ function [residuals,JJacobian] = perfect_foresight_mcp_problem(y, dynamic_functi % SPECIAL REQUIREMENTS % None. -% Copyright (C) 1996-2017 Dynare Team +% Copyright (C) 1996-2019 Dynare Team % % This file is part of Dynare. % @@ -106,4 +105,4 @@ end if nargout == 2 iJacobian = cat(1,iJacobian{:}); JJacobian = sparse(iJacobian(:,1),iJacobian(:,2),iJacobian(:,3),T*ny,T*ny); -end \ No newline at end of file +end diff --git a/matlab/perfect-foresight-models/perfect_foresight_problem.m b/matlab/perfect-foresight-models/perfect_foresight_problem.m index e71c25248..07220cdce 100644 --- a/matlab/perfect-foresight-models/perfect_foresight_problem.m +++ b/matlab/perfect-foresight-models/perfect_foresight_problem.m @@ -2,7 +2,7 @@ function [residuals,JJacobian] = perfect_foresight_problem(y, dynamic_function, exo_simul, params, steady_state, ... maximum_lag, T, ny, i_cols, ... i_cols_J1, i_cols_1, i_cols_T, ... - i_cols_j, i_cols_0, i_cols_J0, nnzJ) + i_cols_j, i_cols_0, i_cols_J0) % Computes the residuals and the Jacobian matrix for a perfect foresight problem over T periods. % @@ -31,7 +31,6 @@ function [residuals,JJacobian] = perfect_foresight_problem(y, dynamic_function, % - i_cols_0 [double] indices of contemporaneous variables in M.lead_lag_incidence in dynamic % Jacobian (relevant in problems with periods=1) % - i_cols_J0 [double] indices of contemporaneous variables appearing in M.lead_lag_incidence (relevant in problems with periods=1) -% - nnzJ [scalar] number of non-zero elements in Jacobian % % OUTPUTS % - residuals [double] (N*T)*1 array, residuals of the stacked problem @@ -100,4 +99,4 @@ end if nargout == 2 iJacobian = cat(1,iJacobian{:}); JJacobian = sparse(iJacobian(:,1), iJacobian(:,2), iJacobian(:,3), T*ny, T*ny); -end \ No newline at end of file +end diff --git a/matlab/perfect-foresight-models/perfect_foresight_solver.m b/matlab/perfect-foresight-models/perfect_foresight_solver.m index c7fab2a6f..9816d6596 100644 --- a/matlab/perfect-foresight-models/perfect_foresight_solver.m +++ b/matlab/perfect-foresight-models/perfect_foresight_solver.m @@ -12,7 +12,7 @@ function perfect_foresight_solver() % SPECIAL REQUIREMENTS % none -% Copyright (C) 1996-2018 Dynare Team +% Copyright (C) 1996-2019 Dynare Team % % This file is part of Dynare. % @@ -195,8 +195,7 @@ if ~isreal(oo_.endo_simul(:)) % can only happen without bytecode residuals = perfect_foresight_problem(yy(:),str2func([M_.fname '.dynamic']), y0, yT, ... oo_.exo_simul,M_.params,oo_.steady_state, ... M_.maximum_lag, periods, M_.endo_nbr, i_cols, ... - i_cols_J1, i_cols_1, i_cols_T, i_cols_j, i_cols_0, i_cols_J0, ... - M_.NNZDerivatives(1)); + i_cols_J1, i_cols_1, i_cols_T, i_cols_j, i_cols_0, i_cols_J0); if max(abs(residuals))< options_.dynatol.f oo_.deterministic_simulation.status = 1; oo_.endo_simul=real(oo_.endo_simul); @@ -223,4 +222,4 @@ else end ts = dseries(transpose(oo_.endo_simul), initial_period, M_.endo_names); -assignin('base', 'Simulated_time_series', ts); \ No newline at end of file +assignin('base', 'Simulated_time_series', ts); diff --git a/matlab/perfect-foresight-models/perfect_foresight_solver_core.m b/matlab/perfect-foresight-models/perfect_foresight_solver_core.m index f0a73f580..24464e8f1 100644 --- a/matlab/perfect-foresight-models/perfect_foresight_solver_core.m +++ b/matlab/perfect-foresight-models/perfect_foresight_solver_core.m @@ -144,8 +144,7 @@ if nargout>1 residuals = perfect_foresight_problem(yy(:),str2func([M_.fname '.dynamic']), y0, yT, ... oo_.exo_simul,M_.params,oo_.steady_state, ... M_.maximum_lag, periods,M_.endo_nbr,i_cols, ... - i_cols_J1, i_cols_1, i_cols_T, i_cols_j, i_cols_0, i_cols_J0, ... - M_.NNZDerivatives(1)); + i_cols_J1, i_cols_1, i_cols_T, i_cols_j, i_cols_0, i_cols_J0); end maxerror = max(max(abs(residuals))); end diff --git a/matlab/perfect-foresight-models/solve_stacked_linear_problem.m b/matlab/perfect-foresight-models/solve_stacked_linear_problem.m index cd52ac444..6e161a6f2 100644 --- a/matlab/perfect-foresight-models/solve_stacked_linear_problem.m +++ b/matlab/perfect-foresight-models/solve_stacked_linear_problem.m @@ -1,6 +1,6 @@ function [endogenousvariables, info] = solve_stacked_linear_problem(endogenousvariables, exogenousvariables, steadystate_y, steadystate_x, M, options) -% Copyright (C) 2015-2017 Dynare Team +% Copyright (C) 2015-2019 Dynare Team % % This file is part of Dynare. % @@ -46,7 +46,7 @@ x = bsxfun(@minus, exogenousvariables, steadystate_x'); x, M.params, steadystate_y, ... M.maximum_lag, options.periods, M.endo_nbr, i_cols, ... i_cols_J1, i_cols_1, i_cols_T, i_cols_j, i_cols_0, i_cols_J0, ... - M.NNZDerivatives(1), jendo, jexog); + jendo, jexog); if all(imag(y)<.1*options.dynatol.x) if ~isreal(y) @@ -62,4 +62,4 @@ if check info.status = false; else info.status = true; -end \ No newline at end of file +end diff --git a/matlab/perfect-foresight-models/solve_stacked_problem.m b/matlab/perfect-foresight-models/solve_stacked_problem.m index d673a1973..6290d4176 100644 --- a/matlab/perfect-foresight-models/solve_stacked_problem.m +++ b/matlab/perfect-foresight-models/solve_stacked_problem.m @@ -51,14 +51,13 @@ if (options.solve_algo == 10 || options.solve_algo == 11)% mixed complementarity exogenousvariables, M.params, steadystate, ... M.maximum_lag, options.periods, M.endo_nbr, i_cols, ... i_cols_J1, i_cols_1, i_cols_T, i_cols_j, i_cols_0, i_cols_J0, ... - M.NNZDerivatives(1),eq_index); + eq_index); else [y, check] = dynare_solve(@perfect_foresight_problem,z(:),options, ... dynamicmodel, y0, yT, ... exogenousvariables, M.params, steadystate, ... M.maximum_lag, options.periods, M.endo_nbr, i_cols, ... - i_cols_J1, i_cols_1, i_cols_T, i_cols_j, i_cols_0, i_cols_J0, ... - M.NNZDerivatives(1)); + i_cols_J1, i_cols_1, i_cols_T, i_cols_j, i_cols_0, i_cols_J0); end if all(imag(y)<.1*options.dynatol.x) @@ -75,4 +74,4 @@ if check info.status = false; else info.status = true; -end \ No newline at end of file +end