From 42f24a9bd6509f66989677137334445e92d8ea20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Adjemian=20=28Argos=29?= <stepan@adjemian.eu> Date: Fri, 14 Mar 2025 12:01:18 +0100 Subject: [PATCH] Add header docs. --- matlab/ep/ep_problem_0.m | 16 ++++++++++++++++ matlab/ep/ep_problem_1.m | 18 +++++++++++++++++- 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/matlab/ep/ep_problem_0.m b/matlab/ep/ep_problem_0.m index 5ec81b475f..08f052a751 100644 --- a/matlab/ep/ep_problem_0.m +++ b/matlab/ep/ep_problem_0.m @@ -1,5 +1,21 @@ function [res, A, info] = ep_problem_0(y, x, pfm) +% Evaluate the residuals and stacked jacobian of a stochastic perfect +% foresight, considering sequences of future innovations in a perfect n-ary tree. +% +% INPUTS: +% - y [double] m×1 vector (endogenous variables in all periods and future worlds). +% - x [double] q×1 vector of exogenous variables. +% - pfm [struct] Definition of the perfect foresight model to be solved. +% +% OUTPUTS: +% - res [double] m×1 vector, residuals of the stacked equations. +% - A [double] m×m sparse matrix, jacobian of the stacked equations. +% - info [logical] scalar +% +% REMARKS: +% [1] The structure pfm holds the given initial condition for the states (pfm.y0) and the terminal condition + info = false; params = pfm.params; diff --git a/matlab/ep/ep_problem_1.m b/matlab/ep/ep_problem_1.m index 9579e7dbf1..4c19baff6c 100644 --- a/matlab/ep/ep_problem_1.m +++ b/matlab/ep/ep_problem_1.m @@ -1,4 +1,20 @@ -function [res,A,info] = ep_problem_1(y, x, pfm) +function [res, A, info] = ep_problem_1(y, x, pfm) + +% Evaluate the residuals and stacked jacobian of a stochastic perfect +% foresight, considering sequences of future innovations in a sparse tree. +% +% INPUTS: +% - y [double] m×1 vector (endogenous variables in all periods and future worlds). +% - x [double] q×1 vector of exogenous variables. +% - pfm [struct] Definition of the perfect foresight model to be solved. +% +% OUTPUTS: +% - res [double] m×1 vector, residuals of the stacked equations. +% - A [double] m×m sparse matrix, jacobian of the stacked equations. +% - info [logical] scalar +% +% REMARKS: +% [1] The structure pfm holds the given initial condition for the states (pfm.y0) and the terminal condition info = false; A = []; -- GitLab