Dunare AIM Solver Subsystem

Contents

AIM Solver Subsystem

The AIM subsystem in the AIM subdirectory of the main Dynare matlab directory contains MATLAB functions necessary for using Gary Anderson's AIM 1st order solver as an alternative to Dynare's default mjdgges solver (see http://www.federalreserve.gov/Pubs/oss/oss4/aimindex.html ).

It cosists of:

The path to the AIM directory, if exists, is added by dynare_config.m using addpath

USE:

Dynare DR1.m tries to invoke AIM solver instead default mjdgges if options_.useAIM == 1 is set and, if not check only, and if 1st order solution is needed, i.e.:

  if (options_.useAIM == 1) && (task == 0) && (options_.order == 1)

For a start, options_.useAIM = 0 is set by default in global_initialization.m so that system uses mjdgges by default.

If AIM is to be used, options_.useAIM = 1 needs to be set either in the model modelname.mod file, before invoking, estimate and/or stoch_simul, or by issuing appropriate command for estimate and/or stoch_simul.

RELEASE NOTES:

In the current implementation, as of July 2008, only first order solution is supported and handling of exceptions is rather fundamental and, in particular, when Blanchard and Kahn conditions are not met, only a large penalty value 1.0e+8 is being set.

Hence, system may not coverge or the resluts may not be accurate if there were many messages like

especially when issued close to the point of convergence.

However, if other exceptions occur and aimcode (see codes below) is higher than 5, the system resets options_.useAIM = 0 and tries to use mjdgges instead.

APPENDIX 1: AIM System SPecification and Dynare Mapping

AIM System for thau lags and theta leads, and:

where xt+i is system vectors at time t for all lag/lead t+i and zt is vector of exogenous shocks.

The AIM input is array of matrices H:

and its solution given as:

where Xt is matrix of vectors of all current system variables and forward looking leads xi for i=t,...,t+theta:

and AIM output in the form of endogenous transition matrix bb:

and, for simple case of one lag system, the matrix Phi derived as:

For more lags, the phi equation becomes more complicated (see documentation on G.Anderson's site above).

Dynare AIM Mapping - input

For Dynare jacobian = [fy'-tau... fy'i ... fy'+theta fu'] - where -tau and +theta are subscripts, we have that its subset without exogenous term fu' and expanded with zero columns represents H, i.e.:

and for exogenous shocks terms:

Output Dynare solution output:

where Xt is again matrix of vectors all current system variables and forward looking leads xi for i=t,..., t+theta, is mapped so that:

APPENDIX 2: dynAIMsolver1 Function Specification

function [dr,aimcode]=dynAIMsolver1(jacobia_,M_,dr)

INPUTS

OUTPUTS

aimcode status is resolved by calling AIMerr as

SPECIAL REQUIREMENTS

Dynare use:

     1) the lognormal block in DR1 is being invoked for some models and changing
     values of ghx and ghy. We need to return the AIM output
     values before that block and run the block with the current returned values
     of gy (i.e. dr.ghx) and gu (dr.ghu) if it is needed even when the AIM is used
     (it does not depend on mjdgges output).
     2) for forward looking models, passing into dynAIMsolver aa ={Q'|1}*jacobia_
     can produce ~ one order closer results to the Dynare solutiion
     then when if plain jacobia_ is passed,
     i.e. diff < e-14 for aa and diff < *e-13 for jacobia_ if Q' is used.

GP July 2008

part of Dynare, copyright Dynare Team (1996-2008) Gnu Public License.