approximation¶
tauchen¶
Discretizes Gaussian linear AR(1) processes via Tauchen’s method
-
quantecon.markov.approximation.rouwenhorst(n, rho, sigma, mu=0.0)[source]¶ Takes as inputs n, mu, sigma, rho. It will then construct a markov chain that estimates an AR(1) process of: \(y_t = \mu + \rho y_{t-1} + \varepsilon_t\) where \(\varepsilon_t\) is i.i.d. normal of mean 0, std dev of sigma
The Rouwenhorst approximation uses the following recursive defintion for approximating a distribution:
\[\begin{split}\theta_2 = \begin{bmatrix} p & 1 - p \\ 1 - q & q \\ \end{bmatrix}\end{split}\]\[\begin{split}\theta_{n+1} = p \begin{bmatrix} \theta_n & 0 \\ 0 & 0 \\ \end{bmatrix} + (1 - p) \begin{bmatrix} 0 & \theta_n \\ 0 & 0 \\ \end{bmatrix} + q \begin{bmatrix} 0 & 0 \\ \theta_n & 0 \\ \end{bmatrix} + (1 - q) \begin{bmatrix} 0 & 0 \\ 0 & \theta_n \\ \end{bmatrix}\end{split}\]where \({p = q = \frac{(1 + \rho)}{2}}\)
Parameters: - nint
The number of points to approximate the distribution
- rhofloat
Persistence parameter in AR(1) process, if you are approximating an AR(1) process then this is the autocorrelation across periods.
- sigmafloat
The value of the standard deviation of the \(\varepsilon\) process
- mufloat, optional(default=0.0)
The value \(\mu\) in the process. Note that the mean of this AR(1) process, \(y\), is simply \(\mu/(1 - \rho)\)
Returns: - mcMarkovChain
An instance of the MarkovChain class that stores the transition matrix and state values returned by the discretization method
Notes
UserWarning: The API of rouwenhorst was changed from rouwenhorst(n, ybar, sigma, rho) to rouwenhorst(n, rho, sigma, mu=0.) in version 0.6.0.
-
quantecon.markov.approximation.tauchen(n, rho, sigma, mu=0.0, n_std=3)[source]¶ Computes a Markov chain associated with a discretized version of the linear Gaussian AR(1) process
\[y_t = \mu + \rho y_{t-1} + \epsilon_t\]using Tauchen’s method. Here \({\epsilon_t}\) is an i.i.d. Gaussian process with zero mean.
Parameters: - nscalar(int)
The number of states to use in the approximation
- rhoscalar(float)
The autocorrelation coefficient, Persistence parameter in AR(1) process
- sigmascalar(float)
The standard deviation of the random process
- muscalar(float), optional(default=0.0)
The value \(\mu\) in the process. Note that the mean of this AR(1) process, \(y\), is simply \(\mu/(1 - \rho)\)
- n_stdscalar(int), optional(default=3)
The number of standard deviations to approximate out to
Returns: - mcMarkovChain
An instance of the MarkovChain class that stores the transition matrix and state values returned by the discretization method
Notes
UserWarning: The API of tauchen was changed from tauchen(rho, sigma_u, b=0., m=3, n=7) to tauchen(n, rho, sigma, mu=0., n_std=3) in version 0.6.0.