Home > matlab > lnsrch1_wrapper_two_boundaries.m

lnsrch1_wrapper_two_boundaries

PURPOSE ^

wrapper for solve_one_boundary m-file when it is used with a dynamic

SYNOPSIS ^

function ra = lnsrch1_wrapper_two_boundaries(ya, fname, y, y_index, x,params, steady_state, periods, y_kmin, y_size)

DESCRIPTION ^

 wrapper for solve_one_boundary m-file when it is used with a dynamic
 model

 INPUTS
   ya                  [vector]        The endogenous of the current block
   y_index             [vector of int] The index of the endogenous variables of
                                       the block
   fname               [string]        name of the file containing the block
                                       to simulate
   y                   [matrix]        All the endogenous variables of the model
   x                   [matrix]        All the exogenous variables of the model
   params              [vector]        All the parameters of the model
   periods             [int]           The number of periods
   y_kmin              [int]           The maximum number of lag on en endogenous variables
   y_size              [int]           The number of endogenous variables
                                       in the current block
 OUTPUTS
   ra                  [vector]        The residuals of the current block      
  
 ALGORITHM
   none.
    
 SPECIAL REQUIREMENTS
   none.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function ra = lnsrch1_wrapper_two_boundaries(ya, fname, y, y_index, x, ...
0002                                              params, steady_state, periods, y_kmin, y_size)
0003 % wrapper for solve_one_boundary m-file when it is used with a dynamic
0004 % model
0005 %
0006 % INPUTS
0007 %   ya                  [vector]        The endogenous of the current block
0008 %   y_index             [vector of int] The index of the endogenous variables of
0009 %                                       the block
0010 %   fname               [string]        name of the file containing the block
0011 %                                       to simulate
0012 %   y                   [matrix]        All the endogenous variables of the model
0013 %   x                   [matrix]        All the exogenous variables of the model
0014 %   params              [vector]        All the parameters of the model
0015 %   periods             [int]           The number of periods
0016 %   y_kmin              [int]           The maximum number of lag on en endogenous variables
0017 %   y_size              [int]           The number of endogenous variables
0018 %                                       in the current block
0019 % OUTPUTS
0020 %   ra                  [vector]        The residuals of the current block
0021 %
0022 % ALGORITHM
0023 %   none.
0024 %
0025 % SPECIAL REQUIREMENTS
0026 %   none.
0027 %
0028 
0029 % Copyright (C) 2009 Dynare Team
0030 %
0031 % This file is part of Dynare.
0032 %
0033 % Dynare is free software: you can redistribute it and/or modify
0034 % it under the terms of the GNU General Public License as published by
0035 % the Free Software Foundation, either version 3 of the License, or
0036 % (at your option) any later version.
0037 %
0038 % Dynare is distributed in the hope that it will be useful,
0039 % but WITHOUT ANY WARRANTY; without even the implied warranty of
0040 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0041 % GNU General Public License for more details.
0042 %
0043 % You should have received a copy of the GNU General Public License
0044 % along with Dynare.  If not, see <http://www.gnu.org/licen
0045 
0046 %reshape the input arguments of the dynamic function
0047 y(y_kmin+1:y_kmin+periods, y_index) = reshape(ya',length(y_index),periods)';
0048 [r, y, g1, g2, g3, b]=feval(fname, y, x, params, steady_state, periods, 0, y_kmin, y_size);
0049 ra = reshape(r(:, y_kmin+1:periods+y_kmin),periods*y_size, 1);

Generated on Mon 21-May-2012 02:42:43 by m2html © 2005