Table Of Contents

Perturbation algorithm

dolo.numeric.perturbations_to_states.state_perturb(f_fun, g_fun, sigma, sigma2_correction=None)[source]

Computes a Taylor approximation of decision rules, given the supplied derivatives.

The original system is assumed to be in the the form:

\[E_t f(s_t,x_t,s_{t+1},x_{t+1})\]\[s_t = g(s_{t-1},x_{t-1}, \lambda \epsilon_t)\]

where \(\lambda\) is a scalar scaling down the risk. the solution is a function \(\varphi\) such that:

\[x_t = \varphi ( s_t, \sigma )\]

The user supplies, a list of derivatives of f and g.

Parameters:
  • f_fun – list of derivatives of f [order0, order1, order2, ...]
  • g_fun – list of derivatives of g [order0, order1, order2, ...]
  • sigma – covariance matrix of \(\epsilon_t\)
  • sigma2_correction – (optional) first and second derivatives of g w.r.t. sigma if \(g\) explicitely depends \(sigma\)

Assuming \(s_t\) , \(x_t\) and \(\epsilon_t\) are vectors of size \(n_s\), \(n_x\) and \(n_x\) respectively. In general the derivative of order \(i\) of \(f\) is a multimensional array of size \(n_x \times (N, ..., N)\) with \(N=2(n_s+n_x)\) repeated \(i\) times (possibly 0). Similarly the derivative of order \(i\) of \(g\) is a multidimensional array of size \(n_s \times (M, ..., M)\) with \(M=n_s+n_x+n_2\) repeated \(i\) times (possibly 0).