DOC: LQ and LQMarkov docstrings state E[w_t' w_t] = I instead of E[w_t w_t'] = I
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Newbie friendliness
- 92/100
- Issue type
- Documentation
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- python
- Domain
- documentation
Research direction
The wrong statement sits in the class docstrings of LQ (quantecon/_lqcontrol.py, around lines 46-49) and LQMarkov (around lines 364-367). docs/source/tools/lqcontrol.rst pulls both through autoclass, so the rendered docs show the same text. Correct the prime placement in both docstrings so they read E[w_t w_t'] = I. Done when both docstrings match and quantecon/tests/test_lqcontrol.py still passes.
Written by the indexing model from the issue text.
Description
Summary
The LQ and LQMarkov class docstrings say the shocks satisfy E[w_t' w_t] = I, "the j x j identity". docs/source/tools/lqcontrol.rst pulls both docstrings into the API docs via autoclass. Because w_t is j x 1, w_t' w_t is a scalar, so for j > 1 it cannot equal the j x j identity. The intended statement is the outer product E[w_t w_t'] = I, and that is what the code assumes: d is computed from trace(P C C') (LQ, LQMarkov), and compute_sequence draws each w_t as j independent standard normals (LQ, LQMarkov).
What the code does
LQ, lines 46-49 and LQMarkov, lines 364-367 have the same text:
Here :math:`x` is n x 1, :math:`u` is k x 1, :math:`w` is j x 1 and the
matrices are conformable for these dimensions. The sequence :math:`{w_t}`
is assumed to be white noise, with zero mean and
:math:`\mathbb{E} [ w_t' w_t ] = I`, the j x j identity.
Suggested fix
Move the prime in both docstrings:
- :math:`\mathbb{E} [ w_t' w_t ] = I`, the j x j identity.
+ :math:`\mathbb{E} [ w_t w_t' ] = I`, the j x j identity.
This changes only the docstrings, so no numerical output changes. With the change applied to main, quantecon/tests/test_lqcontrol.py passes unchanged. _lqcontrol.py has no docstring examples, so test_docstring_examples.py does not run these docstrings.
Context
Found while verifying #984, the fix for #982.
🤖 Generated with Claude Code
- Dominant language
- Python
- Stars
- 2.4k
- Forks
- 2.3k
- Avg merge
- 7d 58m
- Merged PRs (30d)
- 10
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from QuantEcon/QuantEcon.py
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
QuantEcon/QuantEcon.py#986 ·
Maintainers usually reply within 1 day
-
DOC: Document the commit-message prefix conventionPossibly taken @nicolasdmolina claimed this 36 days ago. Opendocumentation good first issue low-priority
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
QuantEcon/QuantEcon.py#902 · 2 comments ·
Maintainers usually reply within 1 day
-
documentation security
Difficulty 2/5 1-2 days Newbie friendliness 68/100
QuantEcon/QuantEcon.py#891 ·
Maintainers usually reply within 1 day
-
bug documentation
Difficulty 2/5 1-3 hours Newbie friendliness 45/100
QuantEcon/QuantEcon.py#987 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 3/5 1-3 hours Newbie friendliness 65/100
QuantEcon/QuantEcon.py#985 ·
Maintainers usually reply within 1 day
All issues in QuantEcon/QuantEcon.py
Similar issues
-
Questions crashes on a real SQuAD2 no-answer predictionPossibly taken @HuaTNA claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
GST is read as Gulf Standard Time (UTC+4) instead of Guam Standard Time (UTC+10)Possibly taken @yang00333 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
DOI-USGS/dataretrieval-python#454 ·
Maintainers usually reply within 4 days
-
area:core-platform effort:S priority:P3 status:in-review type:test
Difficulty 2/5 Under an hour Newbie friendliness 80/100
randomparity/kdive#3246 · 1 comment ·
Maintainers usually reply within 1 day
-
Requantification library converts m/z to mass with the hydrogen-atom mass instead of the proton massOpenbug
Difficulty 1/5 Under an hour Newbie friendliness 85/100
nf-core/metaboigniter#130 ·
Maintainers usually reply within 1 day
-
netbox status: needs owner type: documentation
Difficulty 1/5 Under an hour Newbie friendliness 75/100
netbox-community/netbox#23412 · 1 reaction ·
Maintainers usually reply within 1 day