Authors: Thomas Sargent, John Stachurski

This module provides functions to compute quadratic sums of the form described in the docstrings.

$V = \sum_{j=0}^{\infty} A^j B A^{j'}$

V is computed by solving the corresponding discrete lyapunov equation using the doubling algorithm. See the documentation of util.solve_discrete_lyapunov for more information.

Parameters: A : array_like(float, ndim=2) An n x n matrix as described above. We assume in order for convergence that the eigenvalues of A have moduli bounded by unity B : array_like(float, ndim=2) An n x n matrix as described above. We assume in order for convergence that the eigenvalues of A have moduli bounded by unity max_it : scalar(int), optional(default=50) The maximum number of iterations gamma1: array_like(float, ndim=2) Represents the value V
$q(x_0) = E \sum_{t=0}^{\infty} \beta^t x_t' H x_t$