Open jlperla opened 6 years ago
Just an update on this: this caused a great deal of confusion in the assignments for people when the state space had a constant term. Also, using the initial prior mean for the initial condition of the stationary distribution algorithm is a little hard to understand for some. I think that adjusting the default initial condition for the steady state algorithm to put in any of the constant terms would help a great deal with that confusion.
I didn't fully understand the second comment but certainly it should be possible to call stationary_distributions
after lss = LSS(A, C, G)
.
In fact I would have thought we should be computing these stationary moments with linear algebra routines rather than iteratively. The expressions are available here:
https://lectures.quantecon.org/jl/linear_models.html
For the variance-covariance matrices we should be using solve_discrete_lyapunov
from this package.
Great, I think that calling stationary_distributions
on LSS(A, C, G)
directly would be great (and I think it is easy enough to do since you are already identifying constant. My second comment was that it was tricky for them to understand that optional parameter called mu_0
was the initial condition for the solution to the stationary_distributions
.
For a user, the nice thing about the iterative method instead of solving the lyapunov directly is that it works for a state space with the constant term in it. That way they don't need to do the transformation to a state space representation that removes the constant term.
A couple of students were having trouble with the LSS model and calling
stationary_distributions
because they hadn't created it with an initial condition. So the following worksBut changing it to
lss = LSS(A, C, G)
does notThe issue is that the code doesn't warn them that this wouldn't work and doesn't correct the default initial condition (which I assume is just 0s)?
So, is there any way to either warn them that this is not kosher with a constant term, or (even better!) adjust the default initial condition to include the constants? You are already detecting the constant terms with the
remove_constants(lss)
function?