Markov Chain
Introduction
The markov chain model provides methods to set up discretised random processes for the random variable in dynamic programming problems. We use the tauchen method to create a markov chain from a continuous diffusion process.
API
BellmanSolver.Markov.make_deterministic_chain
— Methodmake_deterministic_chain(N, min, max)
Make a deterministic markov chain chain with N grid points between min and max.
This will be used to discretise the price state space in the deterministic case. While, strictly speaking, it might be both more readable and more performant to modify the value function instead, it is easier to code this method, and the performance of my algorithm is not currently a bottleneck.
This would be an identity matrix, but we need to account for the fact that η = 0.95, so prices will decay back to 1.
Arguments
N::Int
: Number of grid pointsmin::Real
: Minimum value of the gridmax::Real
: Maximum value of the grid
Returns
y_grid::Vector{Float64}
: Grid points for the state spacetrans_mat::Matrix{Float64}
: Transition matrix for the markov chain
BellmanSolver.Markov.tauchen
— Methodtauchen(N, m, μ, σ, λ)
Tauchen's method for discretizing a state space for a AR(1) process.
Arguments
N::Int
: Number of grid pointsm::Real
: Multiple of standard deviation for the gridμ::Real
: Drift of the AR(1) processσ::Real
: Standard deviation of the error term of the AR(1) processλ::Real
: Persistence parameter of the AR(1) process
Returns
y_grid::Vector{Float64}
: Grid points for the state spacetrans_dict::Dict{Float64, Vector{Float64}}
: Transition matrix for the AR(1)
process
BellmanSolver.Markov.tauchen_unit_root
— Methodtauchen_unit_root(N, m, σ)
Tauchen's method for discretizing a state space for a unit root AR(1) process.
Using a separate method as I am unsure how to handle the mean.
Arguments
N::Int
: Number of grid pointsm::Real
: Multiple of standard deviation for the gridσ::Real
: Standard deviation of the error term of the AR(1) process
Returns
y_grid::Vector{Float64}
: Grid points for the state space