Initial condition for stationary distribution of LSS with a constant term

Open
#201 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
julia
Domain
backend

Research direction

Start by reproducing the documented LSS example with and without mu_0, then inspect the LSS constructor, stationary_distributions, and remove_constants(lss) behavior mentioned in the issue. Done should mean that a constant-term model either receives a suitable default initial condition or clearly warns that an explicit one is required, with the behavior covered by a regression test.

Written by the indexing model from the issue text.

Description

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 works

using QuantEcon
A1 = 0.6;
a = 1.0
A = [A1 a; 0 1]
C1 = 4
C = [C1;0]
G = [1 0]
x_0 = [0; 1.0] #Important that the initial condition is in the correct place!
lss = LSS(A, C, G; mu_0 = x_0)
#If you look at the notes and the documents, it says you need an initial condition
μ_x, μ_y, Σ_x, Σ_y = stationary_distributions(lss)

But changing it to lss = LSS(A, C, G) does not

The 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?

Dominant language
Julia
Stars
554
Forks
309
Avg merge
2d 17h
Merged PRs (30d)
1

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from QuantEcon/QuantEcon.jl

All issues in QuantEcon/QuantEcon.jl

Similar issues

More Julia issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.