Repository navigation
Commit 285b3fe
BUG: Fix Samuelson quadratic formula (#1066)
* Fix sign error in by-hand characteristic roots
The polynomial is z^2 - ρ1 z - ρ2 = 0, so the roots are
(ρ1 ± sqrt(ρ1^2 + 4 ρ2)) / 2. The by-hand formula in
y_nonstochastic used -ρ1 in every branch.
* Align class docstring with the lecture's recurrence
The Samuelson class and analyze_roots use ρ1 = α+β, ρ2 = -β from
I_t = β(Y_{t-1} - Y_{t-2}). The docstring still had the 1939
consumption-accelerator form α(1+β), -αβ.
* Make Samuelson docstring raw and include the shock term
The non-raw docstring turned \a and \b in \alpha and \beta into
control characters. Also add the sigma epsilon_t term, since the class
supports a stochastic model.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
---------
Co-authored-by: Chase Coleman <[email protected]>
Co-authored-by: John Stachurski <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>1 parent 4f8bcd6 commit 285b3fe
1 file changed
Lines changed: 7 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
684 | 684 | | |
685 | 685 | | |
686 | 686 | | |
687 | | - | |
| 687 | + | |
688 | 688 | | |
689 | 689 | | |
690 | 690 | | |
691 | | - | |
692 | | - | |
| 691 | + | |
| 692 | + | |
693 | 693 | | |
694 | 694 | | |
695 | 695 | | |
696 | | - | |
697 | | - | |
| 696 | + | |
| 697 | + | |
698 | 698 | | |
699 | 699 | | |
700 | 700 | | |
| |||
965 | 965 | | |
966 | 966 | | |
967 | 967 | | |
968 | | - | |
| 968 | + | |
969 | 969 | | |
970 | 970 | | |
971 | 971 | | |
| |||
976 | 976 | | |
977 | 977 | | |
978 | 978 | | |
979 | | - | |
| 979 | + | |
980 | 980 | | |
981 | 981 | | |
982 | 982 | | |
| |||
0 commit comments