1.5. Higher-order perturbation

You can solve for higher-order perturbation if you are in one of the following cases:

  1. You are using symbolic derivatives and those derivatives have been precomputed at parse time via the max_deriv_order option to the model factory.

  2. You are using automatic derivatives.

  3. You are using numerical derivatives.

  4. You are using matlab derivatives.

And you are able to solve the generalized system of Sylvester equations.

1.5.1. Choosing the derivatives

To change the type of derivatives, use the option solve_derivatives_type. RISE implements four types:

  • symbolic

  • numerical

  • automatic

  • matlab

1.5.2. Solving the system of generalized Sylvester equations

The complicated linear problem is solved using a solver with the syntax:

[X, flag, relres, iter, resvec] = linsolver(A, b, ...
    TolFun, Maxiter, ...
    M1, M2, x0, vargs{:});

Inputs:

  • A – either a square matrix or a function handle returning the result of the operation \(A \times x\) without explicitly forming and storing \(A\).

  • b – the right-hand side of \(A x = b\).

  • TolFun – tolerance.

  • Maxiter – maximum number of iterations.

  • M1 = [] – not set.

  • M2 = [] – not set.

  • x0 – initial guess.

  • vargs – any additional arguments.

Outputs:

  • X – the final solution.

  • flag – 0 if the problem solves; 1 if the maximum number of iterations is reached; another number otherwise.

  • relres – the relative residual norm(b - A*x) / norm(b).

  • iter – the iteration number at which the final solution was computed.

  • resvec – vector of residual norms at each half iteration, including the first norm(b - A*x0).

Change the default with the option solve_linsyst_user_algo. Some of the algorithms usable in MATLAB:

  • 'tfqmr' (default)

  • 'bicg'

  • 'bicgstab'

  • 'bicgstabl'

  • 'cgs'

  • 'gmres'

1.5.3. Higher orders when the steady state switches

Under perturbation M the higher-order engines carry the displacement between regime anchors in the \(\sigma\)-column of the state transition, so that the expansion around the isolated steady states is a consistent Taylor expansion at every order. Under the self-consistent linearization (solve_perturbation_type={'m','scl'}, see Solving) the anchors are the rest points of the switching economy and the displacement is already in the evaluation points; the higher orders are then computed with the Taylor shift, in which regime \(j\)’s polynomial is re-expanded at regime \(i\)’s rest point and its shifted jets replace \(T_j\) in the lead of the pair \((i,j)\). Order 2 runs through hops (option solve_perturbation_engine='hops'), any order through the recursive engine ('recursive', selected automatically above order 2). The two routes agree at order 2. Rest points, slopes and all higher-order coefficients are solved jointly, so the low-order coefficients depend on the order of approximation.