QuantEcon / SimpleDifferentialOperators.jl

Library for simple upwind finite differences
MIT License
12 stars 2 forks source link

Math for continuous X discrete state #167

Closed jlperla closed 5 years ago

jlperla commented 5 years ago

Add in a new major section to the derivation document where we will derive a continuous X discrete states.

and the intensity matrix of the markov chain is

Q = [-q_1 q_1
         q_2 -q_2]

With this, the payoffs were just the pi(x) then the stationary bellman equation discounted at rate r would be the system

r v_1(x) = pi_1(x) + mu_1 v_1'(t,x) + sigma^2/2 v_1''(t,x) + q_1 (v_2(x) - v_1(x))
r v_2(x) = pi_1(x) + mu_2 v_2'(t,x) + sigma^2/2 v_2''(t,x) + q_2 (v_1(x) - v_2(x))

Point out that if we stack the v in the discrete grid x_0 to x_M as

v_bar = [v_1(x_0)
           ...
           v_2(x_{M+1})  in R^(2(M+1))
pi = [pi_1(x_1)
            ...
            pi_1(x_M)
            pi_2(x_1)
            ....
            pi_2(x_M)] in R^(2M)

Then we can discretize this as an extension operator

L v_bar = pi

with 4 total equations in the boundary conditions.

v_1'(x_min) = 0
v_1'(x_max) = 0
v_2'(x_min) = 0
v_2'(x_max) = 0

(Resolved by ba99afb)

What does this look like? Take the n'th row and it looks something like this (I think)

[q_1 * banded_I     ...     q_(n-1) *banded_I      L_n-q_n * banded_I     q_(n+1) * banded_I     ....   q_N * banded_I]

And this row is of size M by (M+2)*N Where the banded_I is some sort of banded matrix with a band of ones at the diagonal or slightly off of it. (Resolved by 8d540dc)