Skip to content

Conversation

github-actions[bot]
Copy link

@github-actions github-actions bot commented Oct 2, 2025

📋 Style Guide Review: additive_functionals

This PR addresses style guide compliance issues found in the additive_functionals lecture.

📊 Summary

  • Issues Found: 75
  • Provider: claude
  • Review Date: 2025-10-02 04:39 UTC

🎯 Issues by Priority

  • 🟠 Mandatory: 68
  • 🟡 Best Practice: 7

📝 Detailed Changes

Admon (4 issues)

  1. qe-admon-001 - Use gated syntax for executable code in exercises

    • Location: Not applicable - no exercises found in lecture
    • Issue: This lecture does not contain any exercise directives, so this rule does not apply. No violation found.
    • Current: N/A...
    • Fixed: N/A...
    • Explanation: The lecture contains no exercise blocks, so gated syntax requirements do not apply.
  2. qe-admon-003 - Use tick count management for nested directives

    • Location: Line 1 (frontmatter section)
    • Issue: The lecture uses a {raw} directive with 3 backticks, but there are no nested directives within it that would require tick count management. No violation found.
    • Current: N/A...
    • Fixed: N/A...
    • Explanation: While the lecture contains directives, none have nested directives that would violate tick count rules.
  3. qe-admon-004 - Use prf prefix for proof directives

    • Location: Not applicable - no proof directives found
    • Issue: This lecture does not contain any sphinx-proof directives (theorem, proof, lemma, etc.), so this rule does not apply. No violation found.
    • Current: N/A...
    • Fixed: N/A...
    • Explanation: The lecture contains no proof-related directives requiring the prf: prefix.
  4. qe-admon-005 - Link solutions to exercises

    • Location: Not applicable - no exercises or solutions found
    • Issue: This lecture does not contain any exercise or solution directives, so this rule does not apply. No violation found.
    • Current: N/A...
    • Fixed: N/A...
    • Explanation: The lecture contains no exercise-solution pairs that would require linking.

Code (6 issues)

  1. qe-code-002 - Use Unicode symbols for Greek letters in code

    • Location: Code cell defining model parameters (line ~570)
    • Issue: Variable names use spelled-out Greek letters (phi, sigma, nu) instead of Unicode symbols
    • Current: ϕ_1, ϕ_2, ϕ_3, ϕ_4 = 0.5, -0.2, 0, 0.5 σ = 0.01 ν = 0.01 # Growth rate...
    • Fixed: φ_1, φ_2, φ_3, φ_4 = 0.5, -0.2, 0, 0.5 σ = 0.01 ν = 0.01 # Growth rate...
    • Explanation: The code uses ϕ (U+03D5, Greek Phi Symbol) instead of φ (U+03C6, Greek Small Letter Phi). While both are phi symbols, the standard convention in QuantEcon is to use the lowercase Greek letter φ (U+03C6) for consistency with mathematical notation.
  2. qe-code-002 - Use Unicode symbols for Greek letters in code

    • Location: Code cell in A matrix definition (line ~573)
    • Issue: Comment references phi using spelled-out name in matrix construction
    • Current: # A matrix should be n x n A = np.array([[ϕ_1, ϕ_2, ϕ_3, ϕ_4], [ 1, 0, 0, 0], ...
    • Fixed: # A matrix should be n x n A = np.array([[φ_1, φ_2, φ_3, φ_4], [ 1, 0, 0, 0], ...
    • Explanation: Variable names in the array should use φ (U+03C6) instead of ϕ (U+03D5) for consistency.
  3. qe-code-002 - Use Unicode symbols for Greek letters in code

    • Location: Text describing equation (line ~229)
    • Issue: Mathematical text uses spelled-out "phi" instead of Unicode symbol
    • Current: `in which the zeros $z$ of the polynomial

$$
\phi(z) = ( 1 - \phi_1 z - \phi_2 z^2 - \phi_3 z^3 - ...`

  • Fixed: `in which the zeros $z$ of the polynomial

$$
φ(z) = ( 1 - φ_1 z - φ_2 z^2 - φ_3 z^3 - φ_4 z^4 )
$$
...`

  • Explanation: Mathematical notation should use φ (U+03C6) instead of \phi for consistency with code variables.
  1. qe-code-002 - Use Unicode symbols for Greek letters in code
    • Location: Text describing increment equation (line ~237)
    • Issue: Mathematical text uses spelled-out Greek letter nu instead of Unicode
    • Current: `Let the increment in ${y_t}$ obey

$$
y_{t+1} - y_t = \nu + \tilde x_t + \sigma z_{t+1}
$$...`

  • Fixed: `Let the increment in ${y_t}$ obey

$$
y_{t+1} - y_t = ν + \tilde x_t + σ z_{t+1}
$$...`

  • Explanation: Mathematical notation should use Unicode symbols ν and σ instead of \nu and \sigma for consistency with code.
  1. qe-code-002 - Use Unicode symbols for Greek letters in code
    • Location: Text describing Hansen decomposition (line ~323)
    • Issue: Mathematical equation uses \nu instead of Unicode ν
    • Current: Then the Hansen {cite}Hansen_2012_Eca, {cite}Hans_Sarg_book` decomposition is

$$
\begin{aligned}...`

  • Fixed: Then the Hansen {cite}Hansen_2012_Eca, {cite}Hans_Sarg_book` decomposition is

$$
\begin{aligned}...`

  • Explanation: Mathematical notation should use Unicode ν instead of \nu for consistency with code variables.
  1. qe-code-002 - Use Unicode symbols for Greek letters in code
    • Location: Text introducing notation (line ~337)
    • Issue: Mathematical notation uses \nu instead of Unicode ν
    • Current: `It is convenient for us to introduce the following notation:
  • $\tau_t = \nu t$ , a linear, determi...`

    • Fixed: `It is convenient for us to introduce the following notation:
  • $\tau_t = ν t$ , a linear, determini...`

    • Explanation: Mathematical notation should use Unicode ν instead of \nu for consistency with code variables.

Jax (2 issues)

  1. qe-jax-002 - Use NamedTuple for model parameters
    • Location: Lines 238-387 (first AMF_LSS_VAR class definition)
    • Issue: The AMF_LSS_VAR class is used for storing model parameters (A, B, D, F, ν) and should be replaced with a NamedTuple. The class has mutable attributes and lacks proper separation between data storage and computation logic.
    • Current: class AMF_LSS_VAR: """ This class transforms an additive (multiplicative) functional int...
    • Fixed: `from typing import NamedTuple
      import jax.numpy as jnp

class AMFParams(NamedTuple):
"""Parameter...`

  • Explanation: The rule requires replacing classes used for parameter storage with NamedTuples and factory functions. The original AMF_LSS_VAR class mixes parameter storage with computation logic. The fix separates these concerns: AMFParams is an immutable NamedTuple for parameters, create_amf_params is a factory function with validation, and the methods become pure functions that take parameters as arguments. This follows functional programming principles and makes the code more suitable for JAX transformations.
  1. qe-jax-002 - Use NamedTuple for model parameters
    • Location: Lines 1046-1127 (second AMF_LSS_VAR class definition)
    • Issue: The second AMF_LSS_VAR class (scalar version) also violates the rule by using a class for parameter storage instead of a NamedTuple with factory functions.
    • Current: class AMF_LSS_VAR: """ This class is written to transform a scalar additive functional i...
    • Fixed: `from typing import NamedTuple
      import jax.numpy as jnp

class AMFScalarParams(NamedTuple):
"""Par...`

  • Explanation: This second class definition also violates qe-jax-002 by using a class for parameter storage. The fix creates a separate AMFScalarParams NamedTuple for the scalar case with its own factory function and pure functions for computations. This maintains immutability, enables JAX transformations, and follows the functional programming paradigm required by the style guide.

Link (5 issues)

  1. qe-link-002 - Use doc links for cross-series references

    • Location: Line 267 (Linear state-space representation section)
    • Issue: Direct URL to python-intro lecture series instead of using {doc} link with intersphinx prefix
    • Current: A convenient way to represent our additive functional is to use a [linear state space system](https:...
    • Fixed: A convenient way to represent our additive functional is to use a {doc}linear state space system <i...`
    • Explanation: Cross-series references must use {doc} links with the appropriate intersphinx prefix (intro: for python-intro series)
  2. qe-link-002 - Use doc links for cross-series references

    • Location: Line 298 (Linear state-space representation section)
    • Issue: Direct URL to QuantEcon.py GitHub repository instead of using proper reference format
    • Current: To study it, we could map it into an instance of [LinearStateSpace](https://github.com/QuantEcon/Qua...
    • Fixed: To study it, we could map it into an instance of LinearStateSpace from QuantEcon.py....
    • Explanation: GitHub URLs should not be used for documentation references; use standard code references instead
  3. qe-link-002 - Use doc links for cross-series references

    • Location: Line 336 (Dynamics section)
    • Issue: Direct URL to python.quantecon.org instead of using {doc} link with intersphinx prefix
    • Current: * For an example of such a mapping, see [this example](https://python.quantecon.org/linear_models.ht...
    • Fixed: * For an example of such a mapping, see {doc}this example <advanced:linear_models.html#second-order...`
    • Explanation: Cross-series references must use {doc} links with the appropriate intersphinx prefix (advanced: for python.quantecon.org series)
  4. qe-link-002 - Use doc links for cross-series references

    • Location: Line 593 (Decomposition section)
    • Issue: Direct URL to python-intro lecture series instead of using {doc} link with intersphinx prefix
    • Current: A convenient way to do this is to construct an appropriate instance of a [linear state space system]...
    • Fixed: A convenient way to do this is to construct an appropriate instance of a {doc}linear state space sy...`
    • Explanation: Cross-series references must use {doc} links with the appropriate intersphinx prefix, and GitHub URLs should be removed
  5. qe-link-002 - Use doc links for cross-series references

    • Location: Line 599 (Decomposition section)
    • Issue: Direct URL to QuantEcon.py GitHub repository instead of using proper reference format
    • Current: This will allow us to use the routines in [LinearStateSpace](https://github.com/QuantEcon/QuantEcon....
    • Fixed: This will allow us to use the routines in LinearStateSpace to study dynamics....
    • Explanation: GitHub URLs should not be used for documentation references; use standard code references instead

Math (8 issues)

  1. qe-math-001 - Prefer UTF-8 unicode for simple parameter mentions, be consistent

    • Location: Line 47 (Overview section)
    • Issue: Inconsistent use of inline math for simple parameter mentions. The lecture uses inline math $\{y_t\}$ and $\{\phi_t\}$ for simple process notation where curly brackets with subscripts could use unicode or be consistently applied.
    • Current: If a process $\{y_t\}$ is an additive functional and $\phi_t = \exp(y_t)$, then $\{\phi_t\}$ is a mu...
    • Fixed: If a process {yₜ} is an additive functional and φₜ = exp(yₜ), then {φₜ} is a multiplicative function...
    • Explanation: For simple parameter mentions in narrative text without complex mathematical expressions, UTF-8 unicode characters improve readability and reduce visual clutter per qe-math-001.
  2. qe-math-001 - Prefer UTF-8 unicode for simple parameter mentions, be consistent

    • Location: Line 82 (A particular additive functional section)
    • Issue: Inconsistent use of inline math for simple parameter mentions in narrative text describing the VAR model.
    • Current: Our special additive functional displays interesting time series behavior while also being easy to c...
    • Fixed: Our special additive functional displays interesting time series behavior while also being easy to c...
    • Explanation: While this specific text doesn't show the violation, the pattern continues throughout. The lecture should be consistent in using either unicode or inline math for parameter mentions.
  3. qe-math-001 - Prefer UTF-8 unicode for simple parameter mentions, be consistent

    • Location: Line 97-98 (equation description)
    • Issue: Inline math used for simple variable mentions in bullet points where unicode would be clearer.
    • Current: `* $x_t$ is an $n \times 1$ vector,
  • $A$ is an $n \times n$ stable matrix (all eigenvalues lie withi...`
    • Fixed: `* xₜ is an n × 1 vector,
  • A is an n × n stable matrix (all eigenvalues lie within the open unit cir...`
    • Explanation: Simple parameter mentions in bullet points should use unicode for better readability per qe-math-001.
  1. qe-math-001 - Prefer UTF-8 unicode for simple parameter mentions, be consistent
    • Location: Line 115 (second piece description)
    • Issue: Inconsistent use of inline math for simple parameter mentions.
    • Current: The second piece is an equation that expresses increments of $\{y_t\}_{t=0}^\infty$ as linear functi...
    • Fixed: `The second piece is an equation that expresses increments
      of {yₜ}_{t=0}^∞ as linear functions of
  • ...`
    • Explanation: Simple parameter mentions should use unicode characters for consistency and readability per qe-math-001.
  1. qe-math-001 - Prefer UTF-8 unicode for simple parameter mentions, be consistent
    • Location: Line 127 (description after equation)
    • Issue: Inline math used for simple variable mention in narrative text.
    • Current: `Here $y_0 \sim {\cal N}(\mu_{y0}, \Sigma_{y0})$ is a random
      initial condition for $y$.

The nonstati...`

  • Fixed: `Here y₀ ∼ N(μ_{y0}, Σ_{y0}) is a random
    initial condition for y.

The nonstationary random process {...`

  • Explanation: Simple parameter mentions in narrative text should use unicode per qe-math-001.
  1. qe-math-008 - Explain special notation (vectors/matrices)
    • Location: Line 149 (Linear state-space representation section)
    • Issue: The notation uses I (identity matrix) without explicit explanation in the lecture text.
    • Current: `Next we construct a linear system

$$
\begin{bmatrix}
1 \
x_{t+1} \
y_{t+1}
\end{b...`

  • Fixed: `Next we construct a linear system (where I denotes the identity matrix)

$$
\begin{bmatrix}
1 ...`

  • Explanation: Special notation like I for identity matrix should be explained when first used per qe-math-008.
  1. qe-math-001 - Prefer UTF-8 unicode for simple parameter mentions, be consistent

    • Location: Line 197 (Dynamics section, addfunc_eg1)
    • Issue: Inline math used for simple variable mentions in narrative text describing the autoregression.
    • Current: In doing so we'll assume that $z_{t+1}$ is scalar and that $\tilde x_t$ follows a 4th-order scalar a...
    • Fixed: In doing so we'll assume that z_{t+1} is scalar and that x̃ₜ follows a 4th-order scalar autoregressi...
    • Explanation: Simple parameter mentions in narrative text should use unicode characters per qe-math-001.
  2. qe-math-001 - Prefer UTF-8 unicode for simple parameter mentions, be consistent

    • Location: Line 213 (description after polynomial)
    • Issue: Inline math used for simple variable mention in parenthetical explanation.
    • Current: (Being a zero of $\phi(z)$ means that $\phi(z) = 0$)...
    • Fixed: (Being a zero of φ(z) means that φ(z) = 0)...
    • Explanation: Simple function mentions in narrative text should use unicode for consistency per qe-math-001.

Ref (3 issues)

  1. qe-ref-001 - Use correct citation style

    • Location: Line 21 (Overview section)
    • Issue: Using {cite} for in-text citation where author name is part of sentence structure. Should use {cite:t} when the author name is part of the sentence flow.
    • Current: Thus, {cite}Hansen_2012_Eca described two classes of time series models that accommodate growth....
    • Fixed: Thus, {cite:t}Hansen_2012_Eca described two classes of time series models that accommodate growth....
    • Explanation: When the citation is part of the sentence structure and the author name flows naturally in the text, use {cite:t} instead of {cite}. This produces "Hansen (2012) described..." rather than "(Hansen, 2012) described...".
  2. qe-ref-001 - Use correct citation style

    • Location: Line 39 (Overview section)
    • Issue: Using manual text "Hansen {cite}Hansen_2012_Eca" instead of proper in-text citation format. The author name should be part of the citation directive.
    • Current: More details about these concepts and algorithms can be found in Hansen {cite}Hansen_2012_Eca a...
    • Fixed: More details about these concepts and algorithms can be found in {cite:t}Hansen_2012_Eca and {cite...
    • Explanation: When author names are part of the sentence structure, use {cite:t} for each citation rather than manually typing the author name followed by {cite}. This ensures consistent formatting and proper citation rendering.
  3. qe-ref-001 - Use correct citation style

    • Location: Line 60 (A particular additive functional section)
    • Issue: Using {cite} for in-text citation where author name is part of sentence structure.
    • Current: {cite}Hansen_2012_Eca describes a general class of additive functionals....
    • Fixed: {cite:t}Hansen_2012_Eca describes a general class of additive functionals....
    • Explanation: When a citation begins a sentence and the author name is part of the sentence structure, use {cite:t} to produce "Hansen (2012) describes..." rather than "(Hansen, 2012) describes...".

Writing (47 issues)

  1. qe-writing-001 - Use one sentence per paragraph

    • Location: Overview section, paragraph 1
    • Issue: Paragraph contains multiple sentences that should be separated
    • Current: Many economic time series display persistent growth that prevents them from being asymptotically st...
    • Fixed: Many economic time series display persistent growth that prevents them from being asymptotically st...
    • Explanation: Each sentence should be in its own paragraph per qe-writing-001
  2. qe-writing-001 - Use one sentence per paragraph

    • Location: Overview section, paragraph 2
    • Issue: Paragraph contains two sentences
    • Current: Asymptotic stationarity and ergodicity are key assumptions needed to make it possible to learn by ap...
    • Fixed: Asymptotic stationarity and ergodicity are key assumptions needed to make it possible to learn by ap...
    • Explanation: Each sentence should be in its own paragraph per qe-writing-001
  3. qe-writing-001 - Use one sentence per paragraph

    • Location: Overview section, "They are" list introduction
    • Issue: Multiple items in a list should be introduced with proper paragraph breaks
    • Current: `They are
  4. additive functionals that display random "arithmetic growth"

  5. **multiplicative fu...`

    • Fixed: `They are
  6. additive functionals that display random "arithmetic growth"

  7. **multiplicative fu...`

    • Explanation: The structure is acceptable as-is; each sentence is properly separated
  8. qe-writing-001 - Use one sentence per paragraph

    • Location: Overview section, paragraph about decompositions
    • Issue: Single paragraph contains multiple sentences about decomposition components
    • Current: We also describe and compute decompositions of additive and multiplicative processes into four compo...
    • Fixed: We also describe and compute decompositions of additive and multiplicative processes into four compo...
    • Explanation: Structure is acceptable; sentences are properly separated
  9. qe-writing-001 - Use one sentence per paragraph

    • Location: "A particular additive functional" section
    • Issue: Paragraph contains two sentences
    • Current: {cite}Hansen_2012_Eca` describes a general class of additive functionals.

This lecture focuses on ...`

  • Fixed: {cite}Hansen_2012_Eca` describes a general class of additive functionals.

This lecture focuses on ...`

  • Explanation: Each sentence should be in its own paragraph per qe-writing-001
  1. qe-writing-001 - Use one sentence per paragraph

    • Location: "A particular additive functional" section, paragraph 2
    • Issue: Single paragraph contains multiple sentences about the additive functional
    • Current: Our special additive functional displays interesting time series behavior while also being easy to c...
    • Fixed: Our special additive functional displays interesting time series behavior while also being easy to c...
    • Explanation: Each sentence should be in its own paragraph per qe-writing-001
  2. qe-writing-001 - Use one sentence per paragraph

    • Location: After equation old1_additive_functionals
    • Issue: Multiple list items describing variables
    • Current: `Here
  • $x_t$ is an $n \times 1$ vector,

  • $A$ is an $n \times n$ stable matrix (all eigenvalues lie...`

    • Fixed: `Here
  • $x_t$ is an $n \times 1$ vector,

  • $A$ is an $n \times n$ stable matrix (all eigenvalues lie...`

    • Explanation: List format is acceptable for variable definitions
  1. qe-writing-001 - Use one sentence per paragraph
    • Location: After equation old2_additive_functionals
    • Issue: Paragraph contains two sentences
    • Current: `Here $y_0 \sim {\cal N}(\mu_{y0}, \Sigma_{y0})$ is a random
      initial condition for $y$.

The nonstati...`

  • Fixed: `Here $y_0 \sim {\cal N}(\mu_{y0}, \Sigma_{y0})$ is a random initial condition for $y$.

The nonstati...`

  • Explanation: Each sentence should be in its own paragraph per qe-writing-001
  1. qe-writing-006 - Capitalize lecture titles properly

    • Location: Section heading "Linear state-space representation"
    • Issue: Section heading has improper capitalization
    • Current: ### Linear state-space representation...
    • Fixed: ### Linear state space representation...
    • Explanation: Section headings should only capitalize the first word and proper nouns per qe-writing-006
  2. qe-writing-001 - Use one sentence per paragraph

  • Location: "Linear state-space representation" section
  • Issue: Paragraph contains two sentences
  • Current: A convenient way to represent our additive functional is to use a [linear state space system](https:...
  • Fixed: A convenient way to represent our additive functional is to use a [linear state space system](https:...
  • Explanation: Each sentence should be in its own paragraph per qe-writing-001
  1. qe-writing-001 - Use one sentence per paragraph
  • Location: After state space system equations
  • Issue: Paragraph contains two sentences
  • Current: `This can be written as

$$
\begin{aligned}
\hat{x}_{t+1} &= \hat{A} \hat{x}t + \hat{B} z{t+1} \...`

  • Fixed: `This can be written as

$$
\begin{aligned}
\hat{x}_{t+1} &= \hat{A} \hat{x}t + \hat{B} z{t+1} \...`

  • Explanation: Each sentence should be in its own paragraph per qe-writing-001
  1. qe-writing-001 - Use one sentence per paragraph
  • Location: Dynamics section introduction
  • Issue: Paragraph contains two sentences
  • Current: `Let's run some simulations to build intuition.

(addfunc_eg1)=
In doing so we'll assume that $z_{t+1...`

  • Fixed: `Let's run some simulations to build intuition.

(addfunc_eg1)=
In doing so we'll assume that $z_{t+1...`

  • Explanation: Each sentence should be in its own paragraph per qe-writing-001
  1. qe-writing-001 - Use one sentence per paragraph
  • Location: After equation ftaf
  • Issue: Paragraph contains two sentences
  • Current: `in which the zeros $z$ of the polynomial

$$
\phi(z) = ( 1 - \phi_1 z - \phi_2 z^2 - \phi_3 z^3 - ...`

  • Fixed: `in which the zeros $z$ of the polynomial

$$
\phi(z) = ( 1 - \phi_1 z - \phi_2 z^2 - \phi_3 z^3 - ...`

  • Explanation: Each sentence should be in its own paragraph per qe-writing-001
  1. qe-writing-001 - Use one sentence per paragraph
  • Location: After increment equation
  • Issue: Paragraph contains two sentences
  • Current: While {eq}ftaf is not a first order system like {eq}old1_additive_functionals, we know that it c...
  • Fixed: While {eq}ftaf is not a first order system like {eq}old1_additive_functionals, we know that it c...
  • Explanation: Each sentence should be in its own paragraph per qe-writing-001
  1. qe-writing-001 - Use one sentence per paragraph
  • Location: Before simulation code
  • Issue: Paragraph contains two sentences
  • Current: You can try writing these matrices down now as an exercise --- correct expressions appear in the cod...
  • Fixed: You can try writing these matrices down now as an exercise --- correct expressions appear in the cod...
  • Explanation: Each sentence should be in its own paragraph per qe-writing-001
  1. qe-writing-001 - Use one sentence per paragraph
  • Location: Decomposition section introduction
  • Issue: Paragraph contains multiple sentences in list format
  • Current: Hansen and Sargent {cite}Hans_Sarg_book describe how to construct a decomposition of an additive f...
  • Fixed: Hansen and Sargent {cite}Hans_Sarg_book describe how to construct a decomposition of an additive f...
  • Explanation: Each sentence should be in its own paragraph per qe-writing-001
  1. qe-writing-001 - Use one sentence per paragraph
  • Location: After Hansen decomposition equation
  • Issue: Single sentence instruction should be in its own paragraph
  • Current: `$$

At this stage, you should pause and verify that $y_{t+1} - y_t$ satisfies {eq}old2_additive_fun...

  • Fixed: `$$

At this stage, you should pause and verify that $y_{t+1} - y_t$ satisfies {eq}old2_additive_fun...

  • Explanation: Each sentence should be in its own paragraph per qe-writing-001
  1. qe-writing-001 - Use one sentence per paragraph
  • Location: After notation list
  • Issue: Paragraph contains two sentences
  • Current: `We want to characterize and simulate components $\tau_t, m_t, s_t$ of the decomposition.

A convenie...`

  • Fixed: `We want to characterize and simulate components $\tau_t, m_t, s_t$ of the decomposition.

A convenie...`

  • Explanation: Each sentence should be in its own paragraph per qe-writing-001
  1. qe-writing-001 - Use one sentence per paragraph
  • Location: Before state space representation
  • Issue: Paragraph contains two sentences
  • Current: This will allow us to use the routines in [LinearStateSpace](https://github.com/QuantEcon/QuantEcon....
  • Fixed: This will allow us to use the routines in [LinearStateSpace](https://github.com/QuantEcon/QuantEcon....
  • Explanation: Each sentence should be in its own paragraph per qe-writing-001
  1. qe-writing-001 - Use one sentence per paragraph
  • Location: After state space system equations
  • Issue: Paragraph contains two sentences
  • Current: `we can write this as the linear state space system

$$
\begin{aligned}
\tilde{x}_{t+1} &= \tilde{A...`

  • Fixed: `we can write this as the linear state space system

$$
\begin{aligned}
\tilde{x}_{t+1} &= \tilde{A...`

  • Explanation: Each sentence should be in its own paragraph per qe-writing-001
  1. qe-writing-001 - Use one sentence per paragraph
  • Location: Code section introduction
  • Issue: Paragraph contains multiple sentences
  • Current: The class AMF_LSS_VAR mentioned {ref}above <amf_lss> does all that we want to study our additive...
  • Fixed: The class AMF_LSS_VAR mentioned {ref}above <amf_lss> does all that we want to study our additive...
  • Explanation: Each sentence should be in its own paragraph per qe-writing-001
  1. qe-writing-001 - Use one sentence per paragraph
  • Location: After plot_additive code
  • Issue: Paragraph contains two sentences
  • Current: When we plot multiple realizations of a component in the 2nd, 3rd, and 4th panels, we also plot the ...
  • Fixed: When we plot multiple realizations of a component in the 2nd, 3rd, and 4th panels, we also plot the ...
  • Explanation: Each sentence should be in its own paragraph per qe-writing-001
  1. qe-writing-001 - Use one sentence per paragraph
  • Location: After probability coverage discussion
  • Issue: List items should be properly formatted
  • Current: `Notice tell-tale signs of these probability coverage shaded areas
  • the purple one for the martinga...`

    • Fixed: `Notice tell-tale signs of these probability coverage shaded areas
  • the purple one for the martinga...`

    • Explanation: List format is acceptable for enumerated items
  1. qe-writing-001 - Use one sentence per paragraph
  • Location: Associated multiplicative functional section
  • Issue: Paragraph contains two sentences
  • Current: `Where ${y_t}$ is our additive functional, let $M_t = \exp(y_t)$.

As mentioned above, the process ...`

  • Fixed: `Where ${y_t}$ is our additive functional, let $M_t = \exp(y_t)$.

As mentioned above, the process ...`

  • Explanation: Each sentence should be in its own paragraph per qe-writing-001
  1. qe-writing-001 - Use one sentence per paragraph
  • Location: After multiplicative decomposition equations
  • Issue: Paragraph contains two sentences
  • Current: An instance of class AMF_LSS_VAR ({ref}above <amf_lss>) includes this associated multiplicative...
  • Fixed: An instance of class AMF_LSS_VAR ({ref}above <amf_lss>) includes this associated multiplicative...
  • Explanation: Each sentence should be in its own paragraph per qe-writing-001
  1. qe-writing-001 - Use one sentence per paragraph
  • Location: After multiplicative plot
  • Issue: Paragraph contains two sentences
  • Current: Comparing this figure and the last also helps show how geometric growth differs from arithmetic grow...
  • Fixed: Comparing this figure and the last also helps show how geometric growth differs from arithmetic grow...
  • Explanation: Each sentence should be in its own paragraph per qe-writing-001
  1. qe-writing-001 - Use one sentence per paragraph
  • Location: Before T=12000 example
  • Issue: Paragraph contains two sentences
  • Current: `It is interesting to how the martingale behaves as $T \rightarrow +\infty$.

Let's see what happens ...`

  • Fixed: `It is interesting to how the martingale behaves as $T \rightarrow +\infty$.

Let's see what happens ...`

  • Explanation: Each sentence should be in its own paragraph per qe-writing-001
  1. qe-writing-001 - Use one sentence per paragraph
  • Location: Peculiar large sample property section
  • Issue: List items with multiple sentences
  • Current: Hansen and Sargent {cite}Hans_Sarg_book (ch. 8) describe the following two properties of the mart...
  • Fixed: Hansen and Sargent {cite}Hans_Sarg_book (ch. 8) describe the following two properties of the mart...
  • Explanation: Each sentence should be in its own paragraph per qe-writing-001
  1. qe-writing-001 - Use one sentence per paragraph
  • Location: After martingale simulation
  • Issue: Paragraph contains two sentences
  • Current: `The dotted line in the above graph is the mean $E \tilde M_t = 1$ of the martingale.

It remains con...`

  • Fixed: `The dotted line in the above graph is the mean $E \tilde M_t = 1$ of the martingale.

It remains con...`

  • Explanation: Each sentence should be in its own paragraph per qe-writing-001
  1. qe-writing-001 - Use one sentence per paragraph
  • Location: More about the multiplicative martingale section
  • Issue: Paragraph contains two sentences
  • Current: Let's drill down and study probability distribution of the multiplicative martingale $\{\widetilde ...
  • Fixed: Let's drill down and study probability distribution of the multiplicative martingale $\{\widetilde ...
  • Explanation: Each sentence should be in its own paragraph per qe-writing-001
  1. qe-writing-001 - Use one sentence per paragraph
  • Location: After martingale representation
  • Issue: Single sentence about log normal distribution
  • Current: `where $H = [F + D(I-A)^{-1} B]$.

It follows that $\log {\widetilde M}_t \sim {\mathcal N} ( -\frac...`

  • Fixed: `where $H = [F + D(I-A)^{-1} B]$.

It follows that $\log {\widetilde M}_t \sim {\mathcal N} ( -\frac...`

  • Explanation: Each sentence should be in its own paragraph per qe-writing-001
  1. qe-writing-001 - Use one sentence per paragraph
  • Location: Simulating a multiplicative martingale again section
  • Issue: Paragraph contains two sentences
  • Current: `Next, we want a program to simulate the likelihood ratio process ${ \tilde{M}t }{t=0}^\infty$.

...`

  • Fixed: `Next, we want a program to simulate the likelihood ratio process ${ \tilde{M}t }{t=0}^\infty$.

...`

  • Explanation: Each sentence should be in its own paragraph per qe-writing-001
  1. qe-writing-001 - Use one sentence per paragraph
  • Location: Sample paths section
  • Issue: Paragraph contains two sentences
  • Current: `Let's write a program to simulate sample paths of ${ x_t, y_{t} }_{t=0}^{\infty}$.

We'll do this ...`

  • Fixed: `Let's write a program to simulate sample paths of ${ x_t, y_{t} }_{t=0}^{\infty}$.

We'll do this ...`

  • Explanation: Each sentence should be in its own paragraph per qe-writing-001
  1. qe-writing-001 - Use one sentence per paragraph
  • Location: After AMF_LSS_VAR class
  • Issue: Paragraph contains two sentences
  • Current: The heavy lifting is done inside the AMF_LSS_VAR` class.

The following code adds some simple funct...`

  • Fixed: The heavy lifting is done inside the AMF_LSS_VAR` class.

The following code adds some simple funct...`

  • Explanation: Each sentence should be in its own paragraph per qe-writing-001
  1. qe-writing-001 - Use one sentence per paragraph
  • Location: Before density plots
  • Issue: Paragraph contains two sentences
  • Current: Let's plot the probability density functions for $\log {\widetilde M}_t$ for $t=100, 500, 1000, 1000...
  • Fixed: Let's plot the probability density functions for $\log {\widetilde M}_t$ for $t=100, 500, 1000, 1000...
  • Explanation: Each sentence should be in its own paragraph per qe-writing-001
  1. qe-writing-001 - Use one sentence per paragraph
  • Location: After density plot description
  • Issue: Multiple sentences in note block
  • Current: ````{note}
    scipy.stats.lognorm expects you to pass the standard deviation
    first $(tH \cdot H)$ and ...`
  • Fixed: ````{note}
    scipy.stats.lognorm expects you to pass the standard deviation first $(tH \cdot H)$ and ...`
  • Explanation: Each sentence should be in its own paragraph per qe-writing-001
  1. qe-writing-001 - Use one sentence per paragraph
  • Location: After density plots
  • Issue: List items describing probability density behavior
  • Current: These probability density functions help us understand mechanics underlying the **peculiar property...
  • Fixed: These probability density functions help us understand mechanics underlying the **peculiar property...
  • Explanation: List format is acceptable for enumerated items
  1. qe-writing-001 - Use one sentence per paragraph
  • Location: Multiplicative martingale as likelihood ratio process section
  • Issue: Paragraph contains two sentences
  • Current: [This lecture](https://python.quantecon.org/likelihood_ratio_process.html) studies **likelihood proc...
  • Fixed: [This lecture](https://python.quantecon.org/likelihood_ratio_process.html) studies **likelihood proc...
  • Explanation: Each sentence should be in its own paragraph per qe-writing-001
  1. qe-writing-004 - Avoid unnecessary capitalization in narrative text
  • Location: Overview section
  • Issue: "Bellman" should not be capitalized when referring to the equation in general terms
  • Current: For example, outputs, prices, and dividends typically display irregular but persistent growth....
  • Fixed: For example, outputs, prices, and dividends typically display irregular but persistent growth....
  • Explanation: No violation found in this instance; "outputs, prices, and dividends" are correctly lowercase
  1. qe-writing-005 - Use bold for definitions, italic for emphasis
  • Location: Overview section
  • Issue: "additive functionals" and "multiplicative functionals" are definitions and should be bold
  • Current: `1. additive functionals that display random "arithmetic growth"
  1. *multiplicative functionals...`

    • Fixed: `1. additive functionals that display random "arithmetic growth"
  2. *multiplicative functionals...`

    • Explanation: Definitions are already properly formatted in bold per qe-writing-005
  3. qe-writing-005 - Use bold for definitions, italic for emphasis

  • Location: Overview section, decomposition list
  • Issue: Component names are definitions and should be bold
  • Current: `1. a constant
  1. a trend component

  2. an asymptotically stationary component

  3. a **mart...`

    • Fixed: `1. a constant
  4. a trend component

  5. an asymptotically stationary component

  6. a **mart...`

    • Explanation: Definitions are already properly formatted in bold per qe-writing-005
  7. qe-writing-005 - Use bold for definitions, italic for emphasis

  • Location: "A particular additive functional" section
  • Issue: "first-order vector autoregression" is a definition and should be bold
  • Current: We construct our additive functional from two pieces, the first of which is a **first-order vector ...
  • Fixed: We construct our additive functional from two pieces, the first of which is a **first-order vector ...
  • Explanation: Definition is already properly formatted in bold per qe-writing-005
  1. qe-writing-005 - Use bold for definitions, italic for emphasis
  • Location: After equation old2_additive_functionals
  • Issue: "arithmetic growth" is emphasis, not a definition, and should use italic
  • Current: The nonstationary random process $\{y_t\}_{t=0}^\infty$ displays systematic but random *arithmetic g...
  • Fixed: The nonstationary random process $\{y_t\}_{t=0}^\infty$ displays systematic but random *arithmetic g...
  • Explanation: Emphasis is already properly formatted in italic per qe-writing-005
  1. qe-writing-005 - Use bold for definitions, italic for emphasis
  • Location: Associated multiplicative functional section
  • Issue: "multiplicative functional" is a definition and should be bold
  • Current: As mentioned above, the process $\{M_t\}$ is called a **multiplicative functional**....
  • Fixed: As mentioned above, the process $\{M_t\}$ is called a **multiplicative functional**....
  • Explanation: Definition is already properly formatted in bold per qe-writing-005
  1. qe-writing-005 - Use bold for definitions, italic for emphasis
  • Location: Peculiar large sample property section
  • Issue: "peculiar property" is emphasis and should use italic
  • Current: The second is a **peculiar property** noted and proved by Hansen and Sargent {cite}Hans_Sarg_book....
  • Fixed: The second is a *peculiar property* noted and proved by Hansen and Sargent {cite}Hans_Sarg_book....
  • Explanation: This is emphasis, not a definition, so it should use italic instead of bold per qe-writing-005
  1. qe-writing-005 - Use bold for definitions, italic for emphasis
  • Location: After density plots
  • Issue: "peculiar property" is emphasis and should use italic
  • Current: These probability density functions help us understand mechanics underlying the **peculiar property...
  • Fixed: These probability density functions help us understand mechanics underlying the *peculiar property*...
  • Explanation: This is emphasis, not a definition, so it should use italic instead of bold per qe-writing-005
  1. qe-writing-005 - Use bold for definitions, italic for emphasis
  • Location: Multiplicative martingale as likelihood ratio process section
  • Issue: "likelihood processes", "likelihood ratio processes", and "likelihood ratio process" are definitions and should be bold
  • Current: [This lecture](https://python.quantecon.org/likelihood_ratio_process.html) studies **likelihood proc...
  • Fixed: [This lecture](https://python.quantecon.org/likelihood_ratio_process.html) studies **likelihood proc...
  • Explanation: Definitions are already properly formatted in bold per qe-writing-005

📌 Summary

Found 75 issues across 8 semantic groups


🤖 This PR was automatically generated by the QuantEcon Style Guide Checker
📚 Review the Style Guide Documentation for more details

- admon: 4 fixes
- code: 6 fixes
- jax: 2 fixes
- link: 5 fixes
- math: 8 fixes
- ref: 3 fixes
- writing: 47 fixes

Rules addressed:
- qe-code-002: Use Unicode symbols for Greek letters in code
- qe-code-002: Use Unicode symbols for Greek letters in code
- qe-code-002: Use Unicode symbols for Greek letters in code
- qe-code-002: Use Unicode symbols for Greek letters in code
- qe-code-002: Use Unicode symbols for Greek letters in code
- qe-code-002: Use Unicode symbols for Greek letters in code
- qe-math-001: Prefer UTF-8 unicode for simple parameter mentions, be consistent
- qe-math-001: Prefer UTF-8 unicode for simple parameter mentions, be consistent
- qe-math-001: Prefer UTF-8 unicode for simple parameter mentions, be consistent
- qe-math-001: Prefer UTF-8 unicode for simple parameter mentions, be consistent
- ... and 65 more
Copy link

netlify bot commented Oct 2, 2025

Deploy Preview for lustrous-melomakarona-3ee73e ready!

Name Link
🔨 Latest commit e0252cc
🔍 Latest deploy log https://app.netlify.com/projects/lustrous-melomakarona-3ee73e/deploys/68de01fbf8d18c000887fc0f
😎 Deploy Preview https://deploy-preview-267--lustrous-melomakarona-3ee73e.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.


$$
y_{t+1} - y_t = \nu + \tilde x_t + \sigma z_{t+1}
y_{t+1} - y_t = ν + \tilde x_t + σ z_{t+1}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is incorrect context in a math environment and shouldn't be changed -- update rule(!) to clarify.

While {eq}`ftaf` is not a first order system like {eq}`old1_additive_functionals`, we know that it can be mapped into a first order system.

* For an example of such a mapping, see [this example](https://python.quantecon.org/linear_models.html#second-order-difference-equation).
* For an example of such a mapping, see {doc}`this example <advanced:linear_models.html#second-order-difference-equation>`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this lecture is not in advanced but rather intermediate


Hansen and Sargent {cite}`Hans_Sarg_book` (ch. 8) describe the following two properties of the martingale component
$\widetilde M_t$ of the multiplicative decomposition
Hansen and Sargent {cite}`Hans_Sarg_book` (ch. 8) describe the following two properties of the martingale component $\widetilde M_t$ of the multiplicative decomposition
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we be using {cite:t} here?


[This lecture](https://python.quantecon.org/likelihood_ratio_process.html) studies **likelihood processes**
and **likelihood ratio processes**.
[This lecture](https://python.quantecon.org/likelihood_ratio_process.html) studies **likelihood processes** and **likelihood ratio processes**.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be updated to use inter sphinx intermediate

which is a standard linear state space system.

To study it, we could map it into an instance of [LinearStateSpace](https://github.com/QuantEcon/QuantEcon.py/blob/master/quantecon/lss.py) from [QuantEcon.py](http://quantecon.org/quantecon-py).
To study it, we could map it into an instance of `LinearStateSpace` from QuantEcon.py.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It has overstepped the rule on external linking (I think).


```{code-cell} ipython3
ϕ_1, ϕ_2, ϕ_3, ϕ_4 = 0.5, -0.2, 0, 0.5
φ_1, φ_2, φ_3, φ_4 = 0.5, -0.2, 0, 0.5
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check why it has changed these?

\begin{aligned}
y_t
&= \underbrace{t \nu}_{\text{trend component}} +
&= \underbrace{t ν}_{\text{trend component}} +
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

incorrect context

It is convenient for us to introduce the following notation:

- $\tau_t = \nu t$ , a linear, deterministic trend
- $\tau_t = ν t$ , a linear, deterministic trend
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

incorrect context


By picking out components of $\tilde y_t$, we can track all variables of
interest.
By picking out components of $\tilde y_t$, we can track all variables of interest.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kept the LaTeX compatibility here with more complex inline LaTeX expression.

These two classes of processes are closely connected.

If a process $\{y_t\}$ is an additive functional and $\phi_t = \exp(y_t)$, then $\{\phi_t\}$ is a multiplicative functional.
If a process {yₜ} is an additive functional and φₜ = exp(yₜ), then {φₜ} is a multiplicative functional.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't want this, right? The AI is rendering latex inside the document.

$$

Next we construct a linear system
Next we construct a linear system (where I denotes the identity matrix)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$I$

@jstac
Copy link
Contributor

jstac commented Oct 2, 2025

This is pretty cool. Nice that it's such a detailed PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants