Closed MaximilianJHuber closed 5 years ago
On second thought, I could use ForwardDiff
to calculate the differential operator and proceed with the eigenvalue problem, as non-fully-implicit methods do.
I think you should use EconPDEs
to solve for the problem first. Once you have the drift/volatility of the asset, you can use use linear operators to solve for the stationary distribution.
I have a new package InfinitesimalGenerators.jl to do just that, however it only works with one dimensional markov processes for now.
Cool, thanks for your work!
I know most econ papers solve both the HJB and the stationary distribution by this non-fully-implicit method, where the derivatives of the drift and volatility with respect to state variables are ignored, which EconPDEs
does not. Do you think there is any use for a similar method for calculating the stationary distribution, i.e. auto-differential through EconPDEs
hjb!
function to (almost) get the generator which is aware of those derivatives?
@MaximilianJHuber Depending on how you are doing it, you can jointly solve the HJB and KFE together adding in the normalization of the distribution to the system of equations you are solving.
@MaximilianJHuber As you say, EconPDes solves non linear PDE of the form
0 = f(V) + f(∂V) + f(∂V)∂∂V
, whereas Moll et al. solve quasi-linear PDEs of the form 0 = f(V) + m * ∂V + s * ∂∂V
In any case, the stationary distribution is always given by a linear PDE 0 = μ∂g + 0.5* σ^2/2∂∂g
. So tools in EconPDEs are not particularly helpful to solve this kind of PDE. It is much better to use the linear methods from Moll et al.
Now, in non-stationary models (i.e. models with a time dimension t) it can be useful to solve alternatively the HJB and the KFE equation (I think that's what @jlperla is referring to). But for now this package focuses on stationary models.
@jlperla thanks for your input! I will try to alter the helper!
function and make the g
s sum to one.
@matthieugomez I think I understand you point: That approximate generator from the quais-linear methods is the exactly correct generator from the KBE, and hence its transpose is the exactly correct generator from the KFE. Which means my idea of auto-differentiating hjb!
is not good.
Since your implementation calculates finite differences in a fully-implicit fashion, I cannot just solve an eigenvalue problem on the generator matrix to find the stationary distribution over the state space. My thinking was that I should solve for the stationary distribution simultaneously with the HJB, since the policy function and its derivatives may appear in the KFE.
However, I am not successful in constructing a simple extension to
AchdouHanLasryLionsMollModel
. I am unclear about whether this can be done with EconPDEs at all, because my hand-written FD schemes for KFEs always needed some sort of normalization in every iteration.Basically, I added the distribution
g
to the solution object and added its law of motion, although I am not sure about the boundary condition on thea
axis, but I tried different versions. The solution iteration does not converge and the result is odd in any case.