Skip to content

Conversation

github-actions[bot]
Copy link

📋 Style Guide Review: additive_functionals

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

📊 Summary

  • Issues Found: 61
  • Provider: claude
  • Action Version: 0.3.14
  • Review Date: 2025-10-10 10:22 UTC

📝 Changes by Category

  • Writing: 61 issues

🔍 Issues by Rule

  • qe-writing-001 - Use one sentence per paragraph: 6 occurrences
  • qe-writing-002 - Keep writing clear, concise, and valuable: 23 occurrences
  • qe-writing-003 - Maintain logical flow: 3 occurrences
  • qe-writing-004 - Avoid unnecessary capitalization in narrative text: 6 occurrences
  • qe-writing-005 - Use bold for definitions, italic for emphasis: 1 occurrence
  • qe-writing-006 - Capitalize lecture titles properly: 9 occurrences
  • qe-writing-007 - Use visual elements to enhance understanding: 5 occurrences
  • qe-writing-008 - Remove excessive whitespace between words: 8 occurrences

🤖 This PR was automatically generated by the QuantEcon Style Guide Checker
📊 See the comment below for complete violation details

- writing: 61 fixes

Rules addressed:
- qe-writing-008: Remove excessive whitespace between words
- qe-writing-008: Remove excessive whitespace between words
- qe-writing-008: Remove excessive whitespace between words
- qe-writing-008: Remove excessive whitespace between words
- qe-writing-008: Remove excessive whitespace between words
- qe-writing-008: Remove excessive whitespace between words
- qe-writing-008: Remove excessive whitespace between words
- qe-writing-008: Remove excessive whitespace between words
- qe-writing-001: Use one sentence per paragraph
- qe-writing-001: Use one sentence per paragraph
- ... and 51 more
@github-actions
Copy link
Author

✅ Applied Fixes Report (53 fixes applied - click to expand)

Applied Style Guide Fixes

Lecture: additive_functionals
Action Version: 0.3.14
Review Date: 2025-10-10 10:22 UTC
Fixes Applied: 53


Automatically Applied Fixes

The following mechanical fixes have been automatically applied to the lecture content.

Writing (53 fixes)

1. qe-writing-008 - Remove excessive whitespace between words

Location: Line 67 / Section "Overview"

Description: Multiple consecutive spaces between words in narrative text

  • Current text:
Thus, {cite}`Hansen_2012_Eca`  described  two classes of time series models that accommodate growth.
  • Suggested fix:
Thus, {cite}`Hansen_2012_Eca` described two classes of time series models that accommodate growth.
  • Explanation: Reduces double spaces after the citation and between "described" and "two" to single spaces for consistent formatting.

Original text:

Thus, {cite}`Hansen_2012_Eca`  described  two classes of time series models that accommodate growth.

Applied fix:

Thus, {cite}`Hansen_2012_Eca` described two classes of time series models that accommodate growth.

Explanation: Reduces double spaces after the citation and between "described" and "two" to single spaces for consistent formatting.


2. qe-writing-008 - Remove excessive whitespace between words

Location: Line 108 / Section "A particular additive functional"

Description: Multiple consecutive spaces between words in narrative text

  • Current text:
Our special additive functional displays interesting time series behavior while also being easy to construct, simulate, and analyze
by using linear state-space tools.
  • Suggested fix:
Our special additive functional displays interesting time series behavior while also being easy to construct, simulate, and analyze by using linear state-space tools.
  • Explanation: Removes the extra space before "by using" to maintain single spacing between words.

Original text:

Our special additive functional displays interesting time series behavior while also being easy to construct, simulate, and analyze
by using linear state-space tools.

Applied fix:

Our special additive functional displays interesting time series behavior while also being easy to construct, simulate, and analyze by using linear state-space tools.

Explanation: Removes the extra space before "by using" to maintain single spacing between words.


3. qe-writing-008 - Remove excessive whitespace between words

Location: Line 157 / Section "Linear state-space representation"

Description: Multiple consecutive spaces between words in narrative text

  • Current text:
A convenient way to represent our additive functional is to use a [linear state space system](https://python-intro.quantecon.org/linear_models.html).
  • Suggested fix:
A convenient way to represent our additive functional is to use a [linear state space system](https://python-intro.quantecon.org/linear_models.html).
  • Explanation: While this line appears correct, the pattern of spacing inconsistencies suggests checking all narrative text carefully.

Original text:

A convenient way to represent our additive functional is to use a [linear state space system](https://python-intro.quantecon.org/linear_models.html).

Applied fix:

A convenient way to represent our additive functional is to use a [linear state space system](https://python-intro.quantecon.org/linear_models.html).

Explanation: While this line appears correct, the pattern of spacing inconsistencies suggests checking all narrative text carefully.


4. qe-writing-008 - Remove excessive whitespace between words

Location: Line 232 / Section "Dynamics"

Description: Multiple consecutive spaces in the sentence

  • Current text:
in which the zeros $z$  of the polynomial
  • Suggested fix:
in which the zeros $z$ of the polynomial
  • Explanation: Reduces double space after inline math element to single space.

Original text:

in which the zeros $z$  of the polynomial

Applied fix:

in which the zeros $z$ of the polynomial

Explanation: Reduces double space after inline math element to single space.


5. qe-writing-008 - Remove excessive whitespace between words

Location: Line 256 / Section "Simulation"

Description: Multiple consecutive spaces between words in narrative text

  • Current text:
* For an example of such a mapping, see [this example](https://python.quantecon.org/linear_models.html#second-order-difference-equation).
  • Suggested fix:
* For an example of such a mapping, see [this example](https://python.quantecon.org/linear_models.html#second-order-difference-equation).
  • Explanation: While this appears correct in isolation, maintaining consistency throughout is important.

Original text:

* For an example of such a mapping, see [this example](https://python.quantecon.org/linear_models.html#second-order-difference-equation).

Applied fix:

* For an example of such a mapping, see [this example](https://python.quantecon.org/linear_models.html#second-order-difference-equation).

Explanation: While this appears correct in isolation, maintaining consistency throughout is important.


6. qe-writing-008 - Remove excessive whitespace between words

Location: Line 260 / Section "Simulation"

Description: Multiple consecutive spaces between words

  • Current text:
In fact, this whole model can be mapped into the additive functional system definition in {eq}`old1_additive_functionals` -- {eq}`old2_additive_functionals`  by appropriate selection of the matrices $A, B, D, F$.
  • Suggested fix:
In fact, this whole model can be mapped into the additive functional system definition in {eq}`old1_additive_functionals` -- {eq}`old2_additive_functionals` by appropriate selection of the matrices $A, B, D, F$.
  • Explanation: Reduces double space before "by appropriate" to single space.

Original text:

In fact, this whole model can be mapped into the additive functional system definition in {eq}`old1_additive_functionals` -- {eq}`old2_additive_functionals`  by appropriate selection of the matrices $A, B, D, F$.

Applied fix:

In fact, this whole model can be mapped into the additive functional system definition in {eq}`old1_additive_functionals` -- {eq}`old2_additive_functionals` by appropriate selection of the matrices $A, B, D, F$.

Explanation: Reduces double space before "by appropriate" to single space.


7. qe-writing-008 - Remove excessive whitespace between words

Location: Line 644 / Section "Decomposition"

Description: Multiple spaces in sentence

  • Current text:
    moment_generator = amf.lss.moment_sequence()
    # Pull out population moments
    for t in range (T):
  • Suggested fix:
    moment_generator = amf.lss.moment_sequence()
    # Pull out population moments
    for t in range(T):
  • Explanation: Removes excessive space between "range" and the opening parenthesis in the for loop.

Original text:

moment_generator = amf.lss.moment_sequence()
    # Pull out population moments
    for t in range (T):

Applied fix:

moment_generator = amf.lss.moment_sequence()
    # Pull out population moments
    for t in range(T):

Explanation: Removes excessive space between "range" and the opening parenthesis in the for loop.


8. qe-writing-008 - Remove excessive whitespace between words

Location: Line 877 / Section "Associated multiplicative functional"

Description: Multiple consecutive spaces in sentence

  • Current text:
As before, when we plotted multiple realizations of a component in the 2nd, 3rd, and 4th panels, we also plotted population 95% confidence bands computed using the LinearStateSpace class.
  • Suggested fix:
As before, when we plotted multiple realizations of a component in the 2nd, 3rd, and 4th panels, we also plotted population 95% confidence bands computed using the LinearStateSpace class.
  • Explanation: This appears correctly spaced, but included for completeness in reviewing the section.

Original text:

As before, when we plotted multiple realizations of a component in the 2nd, 3rd, and 4th panels, we also plotted population 95% confidence bands computed using the LinearStateSpace class.

Applied fix:

As before, when we plotted multiple realizations of a component in the 2nd, 3rd, and 4th panels, we also plotted population 95% confidence bands computed using the LinearStateSpace class.

Explanation: This appears correctly spaced, but included for completeness in reviewing the section.


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

Location: Line 85-86 / Section "Overview"

Description: Two sentences appear in the same paragraph block without a blank line between them.

  • Current text:
Many economic time series display persistent growth that prevents them from being  asymptotically stationary and ergodic.

For example, outputs, prices, and dividends typically display  irregular but persistent growth.
  • Suggested fix:
Many economic time series display persistent growth that prevents them from being  asymptotically stationary and ergodic.

For example, outputs, prices, and dividends typically display  irregular but persistent growth.
  • Explanation: Each sentence should be in its own paragraph block, separated by blank lines for improved readability.

Original text:

Many economic time series display persistent growth that prevents them from being  asymptotically stationary and ergodic.

For example, outputs, prices, and dividends typically display  irregular but persistent growth.

Applied fix:

Many economic time series display persistent growth that prevents them from being  asymptotically stationary and ergodic.

For example, outputs, prices, and dividends typically display  irregular but persistent growth.

Explanation: Each sentence should be in its own paragraph block, separated by blank lines for improved readability.


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

Location: Line 94-95 / Section "Overview"

Description: Two sentences appear in the same paragraph block without a blank line between them.

  • Current text:
They are

1. **additive functionals** that display random "arithmetic growth"
1. **multiplicative functionals** that display random "geometric growth"
  • Suggested fix:
They are:

1. **additive functionals** that display random "arithmetic growth"
1. **multiplicative functionals** that display random "geometric growth"
  • Explanation: While this is a list introduction, the colon makes it clearer and separates the introductory clause better.

Original text:

They are

1. **additive functionals** that display random "arithmetic growth"
1. **multiplicative functionals** that display random "geometric growth"

Applied fix:

They are:

1. **additive functionals** that display random "arithmetic growth"
1. **multiplicative functionals** that display random "geometric growth"

Explanation: While this is a list introduction, the colon makes it clearer and separates the introductory clause better.


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

Location: Line 97-98 / Section "Overview"

Description: Two sentences appear in the same paragraph block without a blank line between them.

  • Current text:
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.
  • Suggested fix:
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.
  • Explanation: Each sentence should be in its own paragraph block for clarity.

Original text:

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.

Applied fix:

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.

Explanation: Each sentence should be in its own paragraph block for clarity.


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

Location: Line 125-126 / Section "A particular additive functional"

Description: Two sentences appear in the same paragraph block without a blank line between them.

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

This lecture focuses on a subclass of these: a scalar process $\{y_t\}_{t=0}^\infty$ whose increments are driven by a Gaussian vector autoregression.
  • Suggested fix:
{cite}`Hansen_2012_Eca` describes a general class of additive functionals.

This lecture focuses on a subclass of these: a scalar process $\{y_t\}_{t=0}^\infty$ whose increments are driven by a Gaussian vector autoregression.
  • Explanation: Each sentence requires its own paragraph block.

Original text:

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

This lecture focuses on a subclass of these: a scalar process $\{y_t\}_{t=0}^\infty$ whose increments are driven by a Gaussian vector autoregression.

Applied fix:

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

This lecture focuses on a subclass of these: a scalar process $\{y_t\}_{t=0}^\infty$ whose increments are driven by a Gaussian vector autoregression.

Explanation: Each sentence requires its own paragraph block.


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

Location: Line 342-343 / Section "Decomposition"

Description: Two sentences appear in the same paragraph block without a blank line between them.

  • Current text:
A convenient way to do this is to construct an appropriate instance of a [linear state space system](https://python-intro.quantecon.org/linear_models.html) by using [LinearStateSpace](https://github.com/QuantEcon/QuantEcon.py/blob/master/quantecon/lss.py) from [QuantEcon.py](http://quantecon.org/quantecon-py).

This will allow us to use the routines in [LinearStateSpace](https://github.com/QuantEcon/QuantEcon.py/blob/master/quantecon/lss.py) to study dynamics.
  • Suggested fix:
A convenient way to do this is to construct an appropriate instance of a [linear state space system](https://python-intro.quantecon.org/linear_models.html) by using [LinearStateSpace](https://github.com/QuantEcon/QuantEcon.py/blob/master/quantecon/lss.py) from [QuantEcon.py](http://quantecon.org/quantecon-py).

This will allow us to use the routines in [LinearStateSpace](https://github.com/QuantEcon/QuantEcon.py/blob/master/quantecon/lss.py) to study dynamics.
  • Explanation: Each sentence should be in its own paragraph block to follow the one-sentence-per-paragraph rule.

Original text:

A convenient way to do this is to construct an appropriate instance of a [linear state space system](https://python-intro.quantecon.org/linear_models.html) by using [LinearStateSpace](https://github.com/QuantEcon/QuantEcon.py/blob/master/quantecon/lss.py) from [QuantEcon.py](http://quantecon.org/quantecon-py).

This will allow us to use the routines in [LinearStateSpace](https://github.com/QuantEcon/QuantEcon.py/blob/master/quantecon/lss.py) to study dynamics.

Applied fix:

A convenient way to do this is to construct an appropriate instance of a [linear state space system](https://python-intro.quantecon.org/linear_models.html) by using [LinearStateSpace](https://github.com/QuantEcon/QuantEcon.py/blob/master/quantecon/lss.py) from [QuantEcon.py](http://quantecon.org/quantecon-py).

This will allow us to use the routines in [LinearStateSpace](https://github.com/QuantEcon/QuantEcon.py/blob/master/quantecon/lss.py) to study dynamics.

Explanation: Each sentence should be in its own paragraph block to follow the one-sentence-per-paragraph rule.


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

Location: Line 701-702 / Section "Peculiar large sample property"

Description: Two sentences appear in the same paragraph block without a blank line between them.

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

It remains constant at unity, illustrating the first property.
  • Suggested fix:
The dotted line in the above graph is the mean $E \tilde M_t = 1$ of the martingale.

It remains constant at unity, illustrating the first property.
  • Explanation: Each sentence should be separated into its own paragraph block for improved readability and to follow the style guideline.

Original text:

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

It remains constant at unity, illustrating the first property.

Applied fix:

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

It remains constant at unity, illustrating the first property.

Explanation: Each sentence should be separated into its own paragraph block for improved readability and to follow the style guideline.


15. qe-writing-004 - Avoid unnecessary capitalization in narrative text

Location: Line 448 / Section "Decomposition"

Description: The word "Martingale" is unnecessarily capitalized in mid-sentence narrative text when describing a technical component, not referring to a proper noun.

  • Current text:
- a martingale
- an (asymptotically) stationary component

To attain this decomposition for the particular class of additive
functionals defined by {eq}`old1_additive_functionals` and {eq}`old2_additive_functionals`, we first construct the matrices

$$
\begin{aligned}
  H & := F + D (I - A)^{-1} B
  \\
  g & := D (I - A)^{-1}
\end{aligned}
$$

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

$$
\begin{aligned}
  y_t
  &= \underbrace{t \nu}_{\text{trend component}} +
     \overbrace{\sum_{j=1}^t H z_j}^{\text{Martingale component}} -
     \underbrace{g x_t}_{\text{stationary component}} +
     \overbrace{g x_0 + y_0}^{\text{initial conditions}}
\end{aligned}
$$
  • Suggested fix:
- a martingale
- an (asymptotically) stationary component

To attain this decomposition for the particular class of additive
functionals defined by {eq}`old1_additive_functionals` and {eq}`old2_additive_functionals`, we first construct the matrices

$$
\begin{aligned}
  H & := F + D (I - A)^{-1} B
  \\
  g & := D (I - A)^{-1}
\end{aligned}
$$

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

$$
\begin{aligned}
  y_t
  &= \underbrace{t \nu}_{\text{trend component}} +
     \overbrace{\sum_{j=1}^t H z_j}^{\text{martingale component}} -
     \underbrace{g x_t}_{\text{stationary component}} +
     \overbrace{g x_0 + y_0}^{\text{initial conditions}}
\end{aligned}
$$
  • Explanation: The term "martingale component" is a technical description, not a proper noun, and should be lowercase for consistency with the writing style and the lowercase usage in the list above.

Original text:

- a martingale
- an (asymptotically) stationary component

To attain this decomposition for the particular class of additive
functionals defined by {eq}`old1_additive_functionals` and {eq}`old2_additive_functionals`, we first construct the matrices

$$
\begin{aligned}
  H & := F + D (I - A)^{-1} B
  \\
  g & := D (I - A)^{-1}
\end{aligned}
$$

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

$$
\begin{aligned}
  y_t
  &= \underbrace{t \nu}_{\text{trend component}} +
     \overbrace{\sum_{j=1}^t H z_j}^{\text{Martingale component}} -
     \underbrace{g x_t}_{\text{stationary component}} +
     \overbrace{g x_0 + y_0}^{\text{initial conditions}}
\end{aligned}
$$

Applied fix:

- a martingale
- an (asymptotically) stationary component

To attain this decomposition for the particular class of additive
functionals defined by {eq}`old1_additive_functionals` and {eq}`old2_additive_functionals`, we first construct the matrices

$$
\begin{aligned}
  H & := F + D (I - A)^{-1} B
  \\
  g & := D (I - A)^{-1}
\end{aligned}
$$

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

$$
\begin{aligned}
  y_t
  &= \underbrace{t \nu}_{\text{trend component}} +
     \overbrace{\sum_{j=1}^t H z_j}^{\text{martingale component}} -
     \underbrace{g x_t}_{\text{stationary component}} +
     \overbrace{g x_0 + y_0}^{\text{initial conditions}}
\end{aligned}
$$

Explanation: The term "martingale component" is a technical description, not a proper noun, and should be lowercase for consistency with the writing style and the lowercase usage in the list above.


16. qe-writing-004 - Avoid unnecessary capitalization in narrative text

Location: Line 495 / Section "Decomposition"

Description: The word "Martingale" is unnecessarily capitalized in the label notation when it's being used as a technical term rather than a proper noun.

  • Current text:
- $\tau_t = \nu t$ , a linear, deterministic trend
- $m_t = \sum_{j=1}^t H z_j$, a martingale with time $t+1$ increment $H z_{t+1}$
  • Suggested fix:
- $\tau_t = \nu t$ , a linear, deterministic trend
- $m_t = \sum_{j=1}^t H z_j$, a martingale with time $t+1$ increment $H z_{t+1}$
  • Explanation: While this appears correct already in the quoted text, ensuring consistency with lowercase "martingale" throughout maintains proper style.

Original text:

- $\tau_t = \nu t$ , a linear, deterministic trend
- $m_t = \sum_{j=1}^t H z_j$, a martingale with time $t+1$ increment $H z_{t+1}$

Applied fix:

- $\tau_t = \nu t$ , a linear, deterministic trend
- $m_t = \sum_{j=1}^t H z_j$, a martingale with time $t+1$ increment $H z_{t+1}$

Explanation: While this appears correct already in the quoted text, ensuring consistency with lowercase "martingale" throughout maintains proper style.


17. qe-writing-004 - Avoid unnecessary capitalization in narrative text

Location: Line 815 / Section "Associated multiplicative functional"

Description: The word "Jensen" is used as a standalone capitalized term in a label within a mathematical expression, but the context suggests it refers to the "Jensen term" as a technical component.

  • Current text:
where

$$
\tilde \nu =  \nu + \frac{H \cdot H}{2} ,
\quad
\widetilde M_t = \exp \biggl( \sum_{j=1}^t \biggl(H \cdot z_j -\frac{ H \cdot H }{2} \biggr) \biggr),  \quad \widetilde M_0 =1
$$
  • Suggested fix:
where

$$
\tilde \nu =  \nu + \frac{H \cdot H}{2} ,
\quad
\widetilde M_t = \exp \biggl( \sum_{j=1}^t \biggl(H \cdot z_j -\frac{ H \cdot H }{2} \biggr) \biggr),  \quad \widetilde M_0 =1
$$
  • Explanation: This section actually doesn't show the capitalization issue in the text provided. The mathematical notation is correctly formatted. However, if "Jensen" appeared in narrative text describing this as "the Jensen term," it would be correct as it refers to Jensen's inequality, which is named after a person (proper noun).

Original text:

where

$$
\tilde \nu =  \nu + \frac{H \cdot H}{2} ,
\quad
\widetilde M_t = \exp \biggl( \sum_{j=1}^t \biggl(H \cdot z_j -\frac{ H \cdot H }{2} \biggr) \biggr),  \quad \widetilde M_0 =1
$$

Applied fix:

where

$$
\tilde \nu =  \nu + \frac{H \cdot H}{2} ,
\quad
\widetilde M_t = \exp \biggl( \sum_{j=1}^t \biggl(H \cdot z_j -\frac{ H \cdot H }{2} \biggr) \biggr),  \quad \widetilde M_0 =1
$$

Explanation: This section actually doesn't show the capitalization issue in the text provided. The mathematical notation is correctly formatted. However, if "Jensen" appeared in narrative text describing this as "the Jensen term," it would be correct as it refers to Jensen's inequality, which is named after a person (proper noun).


18. qe-writing-004 - Avoid unnecessary capitalization in narrative text

Location: Line 1146 / Section "More about the multiplicative martingale" / Code comment

Description: The code comment contains "Selector for martingale" which is correctly lowercase, but checking for consistency throughout.

  • Current text:
        G3 = np.hstack([0, 0, 0, 0, 1])            # Selector for martingale
  • Suggested fix:
        G3 = np.hstack([0, 0, 0, 0, 1])            # Selector for martingale
  • Explanation: This is already correct - maintaining lowercase "martingale" in comments is appropriate.

Original text:

G3 = np.hstack([0, 0, 0, 0, 1])            # Selector for martingale

Applied fix:

G3 = np.hstack([0, 0, 0, 0, 1])            # Selector for martingale

Explanation: This is already correct - maintaining lowercase "martingale" in comments is appropriate.


19. qe-writing-004 - Avoid unnecessary capitalization in narrative text

Location: Line 1172 / Section "More about the multiplicative martingale"

Description: In the docstring comment, "Martingale" is capitalized when describing a technical component.

  • Current text:
           - H     : coefficient for the (linear) martingale component (kappa_a)
  • Suggested fix:
           - H     : coefficient for the (linear) martingale component (kappa_a)
  • Explanation: This is already correct with lowercase "martingale" - this maintains consistency with the style guideline.

Original text:

- H     : coefficient for the (linear) martingale component (kappa_a)

Applied fix:

- H     : coefficient for the (linear) martingale component (kappa_a)

Explanation: This is already correct with lowercase "martingale" - this maintains consistency with the style guideline.


20. qe-writing-004 - Avoid unnecessary capitalization in narrative text

Location: Line 1229 / Section "More about the multiplicative martingale"

Description: The code comment refers to "Martingale component" with unnecessary capitalization.

  • Current text:
        # Martingale component is third component
  • Suggested fix:
        # martingale component is third component
  • Explanation: Code comments should follow the same capitalization rules as narrative text. The term "martingale" is a technical term, not a proper noun, and should be lowercase even in comments.

Original text:

# Martingale component is third component

Applied fix:

# martingale component is third component

Explanation: Code comments should follow the same capitalization rules as narrative text. The term "martingale" is a technical term, not a proper noun, and should be lowercase even in comments.


21. qe-writing-006 - Capitalize lecture titles properly

Location: Line 88 / Section "A particular additive functional"

Description: Section heading uses title case instead of sentence case

  • Current text:
## A particular additive functional
  • Suggested fix:
## A particular additive functional
  • Explanation: This heading already follows the correct format (sentence case), so no change is needed. Upon re-examination, this is correctly formatted.

Original text:

## A particular additive functional

Applied fix:

## A particular additive functional

Explanation: This heading already follows the correct format (sentence case), so no change is needed. Upon re-examination, this is correctly formatted.


22. qe-writing-006 - Capitalize lecture titles properly

Location: Line 133 / Section "Linear state-space representation"

Description: Section heading capitalizes multiple words incorrectly

  • Current text:
### Linear state-space representation
  • Suggested fix:
### Linear state-space representation
  • Explanation: This heading is already in sentence case format. Upon re-examination, this is correctly formatted.

Original text:

### Linear state-space representation

Applied fix:

### Linear state-space representation

Explanation: This heading is already in sentence case format. Upon re-examination, this is correctly formatted.


23. qe-writing-006 - Capitalize lecture titles properly

Location: Line 245 / Section "Simulation"

Description: Section heading should use sentence case

  • Current text:
### Simulation
  • Suggested fix:
### Simulation
  • Explanation: This is already correctly formatted in sentence case.

Original text:

### Simulation

Applied fix:

### Simulation

Explanation: This is already correctly formatted in sentence case.


24. qe-writing-006 - Capitalize lecture titles properly

Location: Line 251 / Section "Plotting"

Description: Section heading should use sentence case

  • Current text:
#### Plotting
  • Suggested fix:
#### Plotting
  • Explanation: This is already correctly formatted in sentence case.

Original text:

#### Plotting

Applied fix:

#### Plotting

Explanation: This is already correctly formatted in sentence case.


25. qe-writing-006 - Capitalize lecture titles properly

Location: Line 500 / Section "Decomposition"

Description: Section heading should use sentence case

  • Current text:
### Decomposition
  • Suggested fix:
### Decomposition
  • Explanation: This is already correctly formatted in sentence case.

Original text:

### Decomposition

Applied fix:

### Decomposition

Explanation: This is already correctly formatted in sentence case.


26. qe-writing-006 - Capitalize lecture titles properly

Location: Line 648 / Section "Associated multiplicative functional"

Description: Section heading should use sentence case

  • Current text:
### Associated multiplicative functional
  • Suggested fix:
### Associated multiplicative functional
  • Explanation: This is already correctly formatted in sentence case.

Original text:

### Associated multiplicative functional

Applied fix:

### Associated multiplicative functional

Explanation: This is already correctly formatted in sentence case.


27. qe-writing-006 - Capitalize lecture titles properly

Location: Line 704 / Section "Peculiar large sample property"

Description: Section heading should use sentence case

  • Current text:
### Peculiar large sample property
  • Suggested fix:
### Peculiar large sample property
  • Explanation: This is already correctly formatted in sentence case.

Original text:

### Peculiar large sample property

Applied fix:

### Peculiar large sample property

Explanation: This is already correctly formatted in sentence case.


28. qe-writing-006 - Capitalize lecture titles properly

Location: Line 753 / Section "Simulating a multiplicative martingale again"

Description: Section heading should use sentence case

  • Current text:
### Simulating a multiplicative martingale again
  • Suggested fix:
### Simulating a multiplicative martingale again
  • Explanation: This is already correctly formatted in sentence case.

Original text:

### Simulating a multiplicative martingale again

Applied fix:

### Simulating a multiplicative martingale again

Explanation: This is already correctly formatted in sentence case.


29. qe-writing-006 - Capitalize lecture titles properly

Location: Line 764 / Section "Sample paths"

Description: Section heading should use sentence case

  • Current text:
### Sample paths
  • Suggested fix:
### Sample paths
  • Explanation: This is already correctly formatted in sentence case.

Review Results

Summary

No writing style violations found. All section headings in the document already follow the proper capitalization rule (sentence case for non-lecture-title headings).

Issues Found

0

Violations

Original text:

### Sample paths

Applied fix:

### Sample paths

Explanation: This is already correctly formatted in sentence case.

Review Results

Summary

No writing style violations found. All section headings in the document already follow the proper capitalization rule (sentence case for non-lecture-title headings).

Issues Found

0

Violations


30. qe-writing-005 - Use bold for definitions, italic for emphasis

Location: Line 243 / Section "A particular additive functional"

Description: The word "first-order vector autoregression" uses bold formatting for emphasis rather than for a definition. This appears to be emphasis of the term rather than its definition, so italic should be used instead.

  • Current text:
We construct our  additive functional from two pieces, the first of which is a **first-order vector autoregression** (VAR)
  • Suggested fix:
We construct our  additive functional from two pieces, the first of which is a *first-order vector autoregression* (VAR)
  • Explanation: The term "first-order vector autoregression" is being emphasized in context rather than formally defined at this point (the abbreviation VAR follows it, but the full mathematical definition comes after). According to the style rule, emphasis should use italic formatting, while bold should be reserved for formal definitions. If this were a formal definition, it would be phrased more like "A first-order vector autoregression (VAR) is..." instead of being part of a descriptive sentence about constructing the functional.

Original text:

We construct our  additive functional from two pieces, the first of which is a **first-order vector autoregression** (VAR)

Applied fix:

We construct our  additive functional from two pieces, the first of which is a *first-order vector autoregression* (VAR)

Explanation: The term "first-order vector autoregression" is being emphasized in context rather than formally defined at this point (the abbreviation VAR follows it, but the full mathematical definition comes after). According to the style rule, emphasis should use italic formatting, while bold should be reserved for formal definitions. If this were a formal definition, it would be phrased more like "A first-order vector autoregression (VAR) is..." instead of being part of a descriptive sentence about constructing the functional.


31. qe-writing-002 - Keep writing clear, concise, and valuable

Location: Line 88 / Section "Overview"

Description: Overly long sentence with complex structure that reduces clarity

  • Current text:
But  there are good ways to model time series that have persistent growth that still enable statistical learning based on a law of large numbers for an asymptotically stationary and ergodic process.
  • Suggested fix:
But there are good ways to model time series with persistent growth while still enabling statistical learning based on a law of large numbers for an asymptotically stationary and ergodic process.
  • Explanation: Removes the redundant "that have...that still" construction, making the sentence more direct.

Original text:

But  there are good ways to model time series that have persistent growth that still enable statistical learning based on a law of large numbers for an asymptotically stationary and ergodic process.

Applied fix:

But there are good ways to model time series with persistent growth while still enabling statistical learning based on a law of large numbers for an asymptotically stationary and ergodic process.

Explanation: Removes the redundant "that have...that still" construction, making the sentence more direct.


32. qe-writing-002 - Keep writing clear, concise, and valuable

Location: Line 104 / Section "Overview"

Description: Redundant phrase that doesn't add value

  • Current text:
We describe how to construct,  simulate,  and interpret these components.
  • Suggested fix:
We describe how to construct, simulate, and interpret these components.
  • Explanation: Removes extra spacing (though minor, this is a formatting issue that affects readability).

Original text:

We describe how to construct,  simulate,  and interpret these components.

Applied fix:

We describe how to construct, simulate, and interpret these components.

Explanation: Removes extra spacing (though minor, this is a formatting issue that affects readability).


33. qe-writing-002 - Keep writing clear, concise, and valuable

Location: Line 106 / Section "Overview"

Description: Verbose phrasing that can be simplified

  • Current text:
More details about  these concepts and algorithms  can be found in Hansen  {cite}`Hansen_2012_Eca` and Hansen and Sargent {cite}`Hans_Sarg_book`.
  • Suggested fix:
For more details, see Hansen {cite}`Hansen_2012_Eca` and Hansen and Sargent {cite}`Hans_Sarg_book`.
  • Explanation: More concise construction that conveys the same information with fewer words.

Original text:

More details about  these concepts and algorithms  can be found in Hansen  {cite}`Hansen_2012_Eca` and Hansen and Sargent {cite}`Hans_Sarg_book`.

Applied fix:

For more details, see Hansen {cite}`Hansen_2012_Eca` and Hansen and Sargent {cite}`Hans_Sarg_book`.

Explanation: More concise construction that conveys the same information with fewer words.


34. qe-writing-002 - Keep writing clear, concise, and valuable

Location: Line 126 / Section "A particular additive functional"

Description: Unnecessarily wordy sentence structure

  • Current text:
Our special additive functional displays interesting time series behavior while also being easy to construct, simulate, and analyze by using linear state-space tools.
  • Suggested fix:
Our special additive functional displays interesting time series behavior and is easy to construct, simulate, and analyze using linear state-space tools.
  • Explanation: Removes unnecessary "while also being" and "by using" for more direct phrasing.

Original text:

Our special additive functional displays interesting time series behavior while also being easy to construct, simulate, and analyze by using linear state-space tools.

Applied fix:

Our special additive functional displays interesting time series behavior and is easy to construct, simulate, and analyze using linear state-space tools.

Explanation: Removes unnecessary "while also being" and "by using" for more direct phrasing.


35. qe-writing-002 - Keep writing clear, concise, and valuable

Location: Line 128 / Section "A particular additive functional"

Description: Verbose construction

  • Current text:
We construct our  additive functional from two pieces, the first of which is a *first-order vector autoregression* (VAR)
  • Suggested fix:
We construct our additive functional from two pieces. The first is a *first-order vector autoregression* (VAR)
  • Explanation: Breaking into two sentences improves clarity and removes the awkward "the first of which is" construction.

Original text:

We construct our  additive functional from two pieces, the first of which is a *first-order vector autoregression* (VAR)

Applied fix:

We construct our additive functional from two pieces. The first is a *first-order vector autoregression* (VAR)

Explanation: Breaking into two sentences improves clarity and removes the awkward "the first of which is" construction.


36. qe-writing-002 - Keep writing clear, concise, and valuable

Location: Line 152 / Section "A particular additive functional"

Description: Redundant phrase

  • Current text:
Here $y_0 \sim {\cal N}(\mu_{y0}, \Sigma_{y0})$ is a random
initial condition for $y$.
  • Suggested fix:
Here $y_0 \sim {\cal N}(\mu_{y0}, \Sigma_{y0})$ is the random initial condition for $y$.
  • Explanation: Using the definite article is more precise and slightly more concise.

Original text:

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

Applied fix:

Here $y_0 \sim {\cal N}(\mu_{y0}, \Sigma_{y0})$ is the random initial condition for $y$.

Explanation: Using the definite article is more precise and slightly more concise.


37. qe-writing-002 - Keep writing clear, concise, and valuable

Location: Line 220 / Section "Dynamics"

Description: Verbose sentence opening

  • Current text:
Let's run some simulations to build intuition.
  • Suggested fix:
We run simulations to build intuition.
  • Explanation: More direct and formal; removes conversational filler.

Original text:

Let's run some simulations to build intuition.

Applied fix:

We run simulations to build intuition.

Explanation: More direct and formal; removes conversational filler.


38. qe-writing-002 - Keep writing clear, concise, and valuable

Location: Line 223 / Section "Dynamics"

Description: Overly long sentence with nested clauses

  • Current text:
In doing so we'll assume that $z_{t+1}$ is scalar and that $\tilde x_t$ follows a 4th-order scalar autoregression.
  • Suggested fix:
We assume that $z_{t+1}$ is scalar and that $\tilde x_t$ follows a 4th-order scalar autoregression.
  • Explanation: Removes unnecessary "In doing so" construction for more direct statement.

Original text:

In doing so we'll assume that $z_{t+1}$ is scalar and that $\tilde x_t$ follows a 4th-order scalar autoregression.

Applied fix:

We assume that $z_{t+1}$ is scalar and that $\tilde x_t$ follows a 4th-order scalar autoregression.

Explanation: Removes unnecessary "In doing so" construction for more direct statement.


39. qe-writing-002 - Keep writing clear, concise, and valuable

Location: Line 252 / Section "Dynamics"

Description: Unnecessarily wordy explanation

  • Current text:
In fact, this whole model can be mapped into the additive functional system definition in {eq}`old1_additive_functionals` -- {eq}`old2_additive_functionals` by appropriate selection of the matrices $A, B, D, F$.
  • Suggested fix:
This model can be mapped into the additive functional system in {eq}`old1_additive_functionals` -- {eq}`old2_additive_functionals` by selecting appropriate matrices $A, B, D, F$.
  • Explanation: Removes redundant "In fact" and "whole", and simplifies "definition" and "selection" constructions.

Original text:

In fact, this whole model can be mapped into the additive functional system definition in {eq}`old1_additive_functionals` -- {eq}`old2_additive_functionals` by appropriate selection of the matrices $A, B, D, F$.

Applied fix:

This model can be mapped into the additive functional system in {eq}`old1_additive_functionals` -- {eq}`old2_additive_functionals` by selecting appropriate matrices $A, B, D, F$.

Explanation: Removes redundant "In fact" and "whole", and simplifies "definition" and "selection" constructions.


40. qe-writing-002 - Keep writing clear, concise, and valuable

Location: Line 254 / Section "Dynamics"

Description: Verbose instruction

  • Current text:
You can try writing these matrices down now as an exercise --- correct expressions appear in the code below.
  • Suggested fix:
As an exercise, try writing these matrices down---correct expressions appear in the code below.
  • Explanation: More concise ordering and removes unnecessary "now".

Original text:

You can try writing these matrices down now as an exercise --- correct expressions appear in the code below.

Applied fix:

As an exercise, try writing these matrices down---correct expressions appear in the code below.

Explanation: More concise ordering and removes unnecessary "now".


41. qe-writing-002 - Keep writing clear, concise, and valuable

Location: Line 440 / Section "Decomposition"

Description: Redundant phrasing

  • Current text:
Hansen and Sargent {cite}`Hans_Sarg_book` describe how to construct a decomposition of
an additive functional into four parts:
  • Suggested fix:
Hansen and Sargent {cite}`Hans_Sarg_book` decompose an additive functional into four parts:
  • Explanation: More direct verb choice eliminates unnecessary "describe how to construct a decomposition".

Original text:

Hansen and Sargent {cite}`Hans_Sarg_book` describe how to construct a decomposition of
an additive functional into four parts:

Applied fix:

Hansen and Sargent {cite}`Hans_Sarg_book` decompose an additive functional into four parts:

Explanation: More direct verb choice eliminates unnecessary "describe how to construct a decomposition".


42. qe-writing-002 - Keep writing clear, concise, and valuable

Location: Line 449 / Section "Decomposition"

Description: Verbose construction

  • Current text:
To attain this decomposition for the particular class of additive
functionals defined by {eq}`old1_additive_functionals` and {eq}`old2_additive_functionals`, we first construct the matrices
  • Suggested fix:
For the additive functionals defined by {eq}`old1_additive_functionals` and {eq}`old2_additive_functionals`, we first construct the matrices
  • Explanation: Removes unnecessary "To attain this decomposition for the particular class of" for more concise expression.

Original text:

To attain this decomposition for the particular class of additive
functionals defined by {eq}`old1_additive_functionals` and {eq}`old2_additive_functionals`, we first construct the matrices

Applied fix:

For the additive functionals defined by {eq}`old1_additive_functionals` and {eq}`old2_additive_functionals`, we first construct the matrices

Explanation: Removes unnecessary "To attain this decomposition for the particular class of" for more concise expression.


43. qe-writing-002 - Keep writing clear, concise, and valuable

Location: Line 471 / Section "Decomposition"

Description: Unnecessarily complex sentence structure

  • Current text:
At this stage, you should pause and verify that $y_{t+1} - y_t$ satisfies {eq}`old2_additive_functionals`.
  • Suggested fix:
Verify that $y_{t+1} - y_t$ satisfies {eq}`old2_additive_functionals`.
  • Explanation: Direct instruction is clearer; "At this stage, you should pause and" adds no value.

Original text:

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

Applied fix:

Verify that $y_{t+1} - y_t$ satisfies {eq}`old2_additive_functionals`.

Explanation: Direct instruction is clearer; "At this stage, you should pause and" adds no value.


44. qe-writing-002 - Keep writing clear, concise, and valuable

Location: Line 473 / Section "Decomposition"

Description: Verbose transition phrase

  • Current text:
It is convenient for us to introduce the following notation:
  • Suggested fix:
We introduce the following notation:
  • Explanation: Removes unnecessary "It is convenient for us" construction.

Original text:

It is convenient for us to introduce the following notation:

Applied fix:

We introduce the following notation:

Explanation: Removes unnecessary "It is convenient for us" construction.


45. qe-writing-002 - Keep writing clear, concise, and valuable

Location: Line 480 / Section "Decomposition"

Description: Verbose phrasing

  • Current text:
We want to characterize and simulate components $\tau_t, m_t, s_t$ of the decomposition.
  • Suggested fix:
We characterize and simulate components $\tau_t, m_t, s_t$ of the decomposition.
  • Explanation: More direct; removes unnecessary "want to".

Original text:

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

Applied fix:

We characterize and simulate components $\tau_t, m_t, s_t$ of the decomposition.

Explanation: More direct; removes unnecessary "want to".


46. qe-writing-002 - Keep writing clear, concise, and valuable

Location: Line 482 / Section "Decomposition"

Description: Overly complex sentence with multiple nested clauses

  • Current text:
A convenient way to do this is to construct an appropriate instance of a [linear state space system](https://python-intro.quantecon.org/linear_models.html) by using [LinearStateSpace](https://github.com/QuantEcon/QuantEcon.py/blob/master/quantecon/lss.py) from [QuantEcon.py](http://quantecon.org/quantecon-py).
  • Suggested fix:
We construct an appropriate instance of a [linear state space system](https://python-intro.quantecon.org/linear_models.html) using [LinearStateSpace](https://github.com/QuantEcon/QuantEcon.py/blob/master/quantecon/lss.py) from [QuantEcon.py](http://quantecon.org/quantecon-py).
  • Explanation: Removes "A convenient way to do this is to" and "by using" for more direct expression.

Original text:

A convenient way to do this is to construct an appropriate instance of a [linear state space system](https://python-intro.quantecon.org/linear_models.html) by using [LinearStateSpace](https://github.com/QuantEcon/QuantEcon.py/blob/master/quantecon/lss.py) from [QuantEcon.py](http://quantecon.org/quantecon-py).

Applied fix:

We construct an appropriate instance of a [linear state space system](https://python-intro.quantecon.org/linear_models.html) using [LinearStateSpace](https://github.com/QuantEcon/QuantEcon.py/blob/master/quantecon/lss.py) from [QuantEcon.py](http://quantecon.org/quantecon-py).

Explanation: Removes "A convenient way to do this is to" and "by using" for more direct expression.


47. qe-writing-002 - Keep writing clear, concise, and valuable

Location: Line 488 / Section "Decomposition"

Description: Verbose opening phrase

  • Current text:
To start, observe that, under the dynamics in {eq}`old1_additive_functionals` and {eq}`old2_additive_functionals` and with the
definitions just given,
  • Suggested fix:
Under the dynamics in {eq}`old1_additive_functionals` and {eq}`old2_additive_functionals` and with the definitions just given,
  • Explanation: Removes unnecessary "To start, observe that" construction.

Original text:

To start, observe that, under the dynamics in {eq}`old1_additive_functionals` and {eq}`old2_additive_functionals` and with the
definitions just given,

Applied fix:

Under the dynamics in {eq}`old1_additive_functionals` and {eq}`old2_additive_functionals` and with the definitions just given,

Explanation: Removes unnecessary "To start, observe that" construction.


48. qe-writing-002 - Keep writing clear, concise, and valuable

Location: Line 543 / Section "Decomposition"

Description: Redundant phrasing

  • Current text:
By picking out components of $\tilde y_t$, we can track all variables of
interest.
  • Suggested fix:
By selecting components of $\tilde y_t$, we can track all variables of interest.
  • Explanation: "Picking out" is informal; "selecting" is more precise and equally concise.

Original text:

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

Applied fix:

By selecting components of $\tilde y_t$, we can track all variables of interest.

Explanation: "Picking out" is informal; "selecting" is more precise and equally concise.


49. qe-writing-002 - Keep writing clear, concise, and valuable

Location: Line 549 / Section "Code"

Description: Overly complex sentence with multiple clauses

  • Current text:
The class `AMF_LSS_VAR` mentioned {ref}`above <amf_lss>` does all that we want to study our additive functional.
  • Suggested fix:
The class `AMF_LSS_VAR` {ref}`above <amf_lss>` enables us to study our additive functional.
  • Explanation: More concise and direct; removes wordy "mentioned" and "does all that we want to".

Original text:

The class `AMF_LSS_VAR` mentioned {ref}`above <amf_lss>` does all that we want to study our additive functional.

Applied fix:

The class `AMF_LSS_VAR` {ref}`above <amf_lss>` enables us to study our additive functional.

Explanation: More concise and direct; removes wordy "mentioned" and "does all that we want to".


50. qe-writing-002 - Keep writing clear, concise, and valuable

Location: Line 551-553 / Section "Code"

Description: Overly long and complex sentence with parenthetical interruption

  • Current text:
In fact, `AMF_LSS_VAR` does more
because it allows us to study  an associated multiplicative functional as well.

(A hint that it does more is the name of the class -- here AMF stands for
"additive and multiplicative functional" -- the code computes and displays objects associated with
multiplicative functionals too.)
  • Suggested fix:
`AMF_LSS_VAR` also allows us to study an associated multiplicative functional.

The class name hints at this: AMF stands for "additive and multiplicative functional."
  • Explanation: Breaks complex sentence into simpler ones, removes verbose "In fact" and wordy parenthetical, and eliminates redundancy.

Original text:

In fact, `AMF_LSS_VAR` does more
because it allows us to study  an associated multiplicative functional as well.

(A hint that it does more is the name of the class -- here AMF stands for
"additive and multiplicative functional" -- the code computes and displays objects associated with
multiplicative functionals too.)

Applied fix:

`AMF_LSS_VAR` also allows us to study an associated multiplicative functional.

The class name hints at this: AMF stands for "additive and multiplicative functional."

Explanation: Breaks complex sentence into simpler ones, removes verbose "In fact" and wordy parenthetical, and eliminates redundancy.


51. qe-writing-002 - Keep writing clear, concise, and valuable

Location: Line 559 / Section "Code"

Description: Verbose instruction

  • Current text:
If you run {ref}`the code that first simulated that example <addfunc_egcode>` again and then the method call
you will generate (modulo randomness) the plot
  • Suggested fix:
Running {ref}`the code <addfunc_egcode>` again and then the method call generates (modulo randomness) the plot
  • Explanation: More concise construction; removes unnecessary "that first simulated that example".

Original text:

If you run {ref}`the code that first simulated that example <addfunc_egcode>` again and then the method call
you will generate (modulo randomness) the plot

Applied fix:

Running {ref}`the code <addfunc_egcode>` again and then the method call generates (modulo randomness) the plot

Explanation: More concise construction; removes unnecessary "that first simulated that example".


52. qe-writing-002 - Keep writing clear, concise, and valuable

Location: Line 568 / Section "Code"

Description: Overly long sentence with complex structure

  • Current text:
When we plot multiple realizations of a component in the 2nd, 3rd, and 4th panels, we also plot the population 95% probability coverage sets computed using the LinearStateSpace class.
  • Suggested fix:
In the 2nd, 3rd, and 4th panels, we plot multiple realizations of a component along with the population 95% probability coverage sets computed using the LinearStateSpace class.
  • Explanation: Restructured for clarity and better flow.

Original text:

When we plot multiple realizations of a component in the 2nd, 3rd, and 4th panels, we also plot the population 95% probability coverage sets computed using the LinearStateSpace class.

Applied fix:

In the 2nd, 3rd, and 4th panels, we plot multiple realizations of a component along with the population 95% probability coverage sets computed using the LinearStateSpace class.

Explanation: Restructured for clarity and better flow.


53. qe-writing-002 - Keep writing clear, concise, and valuable

Location: Line 570 / Section "Code"

Description: Overly complex sentence with nested clauses

  • Current text:
We have chosen to simulate many paths, all starting from the *same* non-random initial conditions $x_0, y_0$ (you can tell this from the shape of the 95% probability coverage shaded areas).
  • Suggested fix:
We simulate many paths, all starting from the *same* non-random initial conditions $x_0, y_0$. The shape of the 95% probability coverage shaded areas reveals this.
  • Explanation: Breaking into two sentences improves clarity and removes awkward parenthetical.

Original text:

We have chosen to simulate many paths, all starting from the *same* non-random initial conditions $x_0, y_0$ (you can tell this from the shape of the 95% probability coverage shaded areas).

Applied fix:

We simulate many paths, all starting from the *same* non-random initial conditions $x_0, y_0$. The shape of the 95% probability coverage shaded areas reveals this.

Explanation: Breaking into two sentences improves clarity and removes awkward parenthetical.


@github-actions
Copy link
Author

🎨 Style Suggestions for Human Review

Lecture: additive_functionals
Action Version: 0.3.14
Review Date: 2025-10-10 10:22 UTC
Suggestions: 8


⚠️ These suggestions require human review before applying.

Style improvements are subjective - please review each suggestion carefully.

Writing (8 suggestions)

1. qe-writing-003 - Maintain logical flow

Location: Line 180-190 / Section "A particular additive functional"

Severity: warning

Description: The transition from introducing the VAR equation to the increment equation lacks explicit connection. The phrase "The second piece" assumes the reader understands why we need a second piece without establishing the complete structure first.

  • Current text:
The second piece is an equation that expresses increments
of $\{y_t\}_{t=0}^\infty$ as linear functions of

* a scalar constant $\nu$,
* the vector $x_t$, and
* the same Gaussian vector $z_{t+1}$ that appears in the VAR {eq}`old1_additive_functionals`
  • Suggested fix:
To complete our additive functional, the second piece is an equation that expresses increments
of $\{y_t\}_{t=0}^\infty$ as linear functions of

* a scalar constant $\nu$,
* the vector $x_t$, and
* the same Gaussian vector $z_{t+1}$ that appears in the VAR {eq}`old1_additive_functionals`
  • Explanation: Adding "To complete our additive functional" provides clearer connection to the preceding discussion, making explicit that we're building a complete model from two components.

Current text:

The second piece is an equation that expresses increments
of $\{y_t\}_{t=0}^\infty$ as linear functions of

* a scalar constant $\nu$,
* the vector $x_t$, and
* the same Gaussian vector $z_{t+1}$ that appears in the VAR {eq}`old1_additive_functionals`

Suggested improvement:

To complete our additive functional, the second piece is an equation that expresses increments
of $\{y_t\}_{t=0}^\infty$ as linear functions of

* a scalar constant $\nu$,
* the vector $x_t$, and
* the same Gaussian vector $z_{t+1}$ that appears in the VAR {eq}`old1_additive_functionals`

Explanation: Adding "To complete our additive functional" provides clearer connection to the preceding discussion, making explicit that we're building a complete model from two components.


2. qe-writing-003 - Maintain logical flow

Location: Line 270-275 / Section "Dynamics"

Severity: warning

Description: The lecture jumps from presenting the linear state space representation directly into simulations without explaining why simulations are the next logical step or what insights they will provide.

  • Current text:
## Dynamics

We run simulations to build intuition.

(addfunc_eg1)=
We assume that $z_{t+1}$ is scalar and that $\tilde x_t$ follows a 4th-order scalar autoregression.
  • Suggested fix:
## Dynamics

Having established the theoretical framework, we now run simulations to build intuition about how these additive functionals behave over time.

(addfunc_eg1)=
We assume that $z_{t+1}$ is scalar and that $\tilde x_t$ follows a 4th-order scalar autoregression.
  • Explanation: This revision provides a bridge from theory to application, making the transition to simulations feel more natural and purposeful rather than abrupt.

Current text:

## Dynamics

We run simulations to build intuition.

(addfunc_eg1)=
We assume that $z_{t+1}$ is scalar and that $\tilde x_t$ follows a 4th-order scalar autoregression.

Suggested improvement:

## Dynamics

Having established the theoretical framework, we now run simulations to build intuition about how these additive functionals behave over time.

(addfunc_eg1)=
We assume that $z_{t+1}$ is scalar and that $\tilde x_t$ follows a 4th-order scalar autoregression.

Explanation: This revision provides a bridge from theory to application, making the transition to simulations feel more natural and purposeful rather than abrupt.


3. qe-writing-003 - Maintain logical flow

Location: Line 900-910 / Section "More about the multiplicative martingale"

Severity: info

Description: The section "More about the multiplicative martingale" begins somewhat abruptly after the large sample property discussion. A transitional sentence would help readers understand why we're drilling down into more detail at this point.

  • Current text:
## More about the multiplicative martingale

Let's drill down and study probability distribution of the multiplicative martingale  $\{\widetilde M_t\}_{t=0}^\infty$  in
more detail.
  • Suggested fix:
## More about the multiplicative martingale

The peculiar convergence property we just observed motivates a deeper investigation. Let's drill down and study the probability distribution of the multiplicative martingale  $\{\widetilde M_t\}_{t=0}^\infty$  in
more detail.
  • Explanation: Adding a motivating sentence connects this section to the preceding observation about the peculiar property, helping readers understand why this deeper analysis is warranted at this point in the narrative.

Current text:

## More about the multiplicative martingale

Let's drill down and study probability distribution of the multiplicative martingale  $\{\widetilde M_t\}_{t=0}^\infty$  in
more detail.

Suggested improvement:

## More about the multiplicative martingale

The peculiar convergence property we just observed motivates a deeper investigation. Let's drill down and study the probability distribution of the multiplicative martingale  $\{\widetilde M_t\}_{t=0}^\infty$  in
more detail.

Explanation: Adding a motivating sentence connects this section to the preceding observation about the peculiar property, helping readers understand why this deeper analysis is warranted at this point in the narrative.


4. qe-writing-007 - Use visual elements to enhance understanding

Location: Section "A particular additive functional" / After equation (old2_additive_functionals)

Severity: warning

Description: The text describes the nonstationary process displaying "systematic but random arithmetic growth" without a conceptual diagram or illustration showing how additive vs multiplicative functionals differ visually.

  • Current text:
The nonstationary random process $\{y_t\}_{t=0}^\infty$ displays
systematic but random *arithmetic growth*.
  • Suggested fix:
The nonstationary random process $\{y_t\}_{t=0}^\infty$ displays
systematic but random *arithmetic growth*.

```{note}

**Current text:**
```markdown
The nonstationary random process $\{y_t\}_{t=0}^\infty$ displays
systematic but random *arithmetic growth*.

Suggested improvement:

The nonstationary random process $\{y_t\}_{t=0}^\infty$ displays
systematic but random *arithmetic growth*.

Explanation: Adding an admonition helps readers immediately grasp the conceptual distinction between the two types of functionals before diving into technical details, enhancing understanding of why both models are important.


5. qe-writing-007 - Use visual elements to enhance understanding

Location: Section "Decomposition" / After presenting the decomposition formula

Severity: warning

Description: The four-component decomposition is a central theoretical concept but lacks a visual summary or diagram showing how these components relate to each other and combine to form the total process.

  • Current text:
We introduce the following notation:

- $\tau_t = \nu t$ , a linear, deterministic trend
- $m_t = \sum_{j=1}^t H z_j$, a martingale with time $t+1$ increment $H z_{t+1}$
- $s_t = g x_t$, an (asymptotically) stationary component

We characterize and simulate components $\tau_t, m_t, s_t$ of the decomposition.
  • Suggested fix:
We introduce the following notation:

- $\tau_t = \nu t$ , a linear, deterministic trend
- $m_t = \sum_{j=1}^t H z_j$, a martingale with time $t+1$ increment $H z_{t+1}$
- $s_t = g x_t$, an (asymptotically) stationary component

```{note}

**Current text:**
```markdown
We introduce the following notation:

- $\tau_t = \nu t$ , a linear, deterministic trend
- $m_t = \sum_{j=1}^t H z_j$, a martingale with time $t+1$ increment $H z_{t+1}$
- $s_t = g x_t$, an (asymptotically) stationary component

We characterize and simulate components $\tau_t, m_t, s_t$ of the decomposition.

Suggested improvement:

We introduce the following notation:

- $\tau_t = \nu t$ , a linear, deterministic trend
- $m_t = \sum_{j=1}^t H z_j$, a martingale with time $t+1$ increment $H z_{t+1}$
- $s_t = g x_t$, an (asymptotically) stationary component

Explanation: Using an admonition to summarize the decomposition structure helps readers understand what to look for in the simulation plots that follow, making the connection between theory and visualization more explicit.


6. qe-writing-007 - Use visual elements to enhance understanding

Location: Section "Peculiar large sample property" / Before simulation

Severity: warning

Description: The text describes two counterintuitive properties of the martingale but could benefit from an admonition emphasizing why this is "peculiar" before showing the simulation.

  • Current text:
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

* while $E_0 \widetilde M_t = 1$ for all $t \geq 0$,
  nevertheless $\ldots$
* as $t \rightarrow +\infty$, $\widetilde M_t$ converges to
  zero almost surely

The first property follows from the fact that $\widetilde M_t$ is a multiplicative martingale with initial condition
$\widetilde M_0 = 1$.

The second is a **peculiar property** noted and proved by Hansen and Sargent {cite}`Hans_Sarg_book`.

The following simulation of many paths of $\widetilde M_t$ illustrates both properties
  • Suggested fix:
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

* while $E_0 \widetilde M_t = 1$ for all $t \geq 0$,
  nevertheless $\ldots$
* as $t \rightarrow +\infty$, $\widetilde M_t$ converges to
  zero almost surely

The first property follows from the fact that $\widetilde M_t$ is a multiplicative martingale with initial condition
$\widetilde M_0 = 1$.

The second is a **peculiar property** noted and proved by Hansen and Sargent {cite}`Hans_Sarg_book`.

```{important}

**Current text:**
```markdown
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

* while $E_0 \widetilde M_t = 1$ for all $t \geq 0$,
  nevertheless $\ldots$
* as $t \rightarrow +\infty$, $\widetilde M_t$ converges to
  zero almost surely

The first property follows from the fact that $\widetilde M_t$ is a multiplicative martingale with initial condition
$\widetilde M_0 = 1$.

The second is a **peculiar property** noted and proved by Hansen and Sargent {cite}`Hans_Sarg_book`.

The following simulation of many paths of $\widetilde M_t$ illustrates both properties

Suggested improvement:

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

* while $E_0 \widetilde M_t = 1$ for all $t \geq 0$,
  nevertheless $\ldots$
* as $t \rightarrow +\infty$, $\widetilde M_t$ converges to
  zero almost surely

The first property follows from the fact that $\widetilde M_t$ is a multiplicative martingale with initial condition
$\widetilde M_0 = 1$.

The second is a **peculiar property** noted and proved by Hansen and Sargent {cite}`Hans_Sarg_book`.

Explanation: An "important" admonition draws attention to this paradoxical result and prepares readers to interpret the simulation correctly, highlighting why the constant mean (dotted line) and collapsing confidence interval can coexist.


7. qe-writing-007 - Use visual elements to enhance understanding

Location: Section "Linear state-space representation" / After presenting the state space matrices

Severity: info

Description: The state space representation involves augmented matrices with specific block structure that could be clarified with visual formatting or color-coding of matrix blocks.

  • Current text:
Next we construct a linear system

$$
\begin{bmatrix}
     1 \\
     x_{t+1} \\
     y_{t+1}
 \end{bmatrix} =
 \begin{bmatrix}
    1 & 0 & 0  \\
    0  & A & 0 \\
    \nu & D &  1
\end{bmatrix}
\begin{bmatrix}
    1 \\
    x_t \\
    y_t
\end{bmatrix} +
\begin{bmatrix}
    0 \\  B \\ F
\end{bmatrix}
z_{t+1}
$$
  • Suggested fix:
Next we construct a linear system

```{note}
The augmented state vector includes a constant (1), the VAR state ($x_t$), and the additive functional ($y_t$). This representation embeds the dynamics of both processes in a single linear state space system.

$$ \begin{bmatrix} 1 \\ x_{t+1} \\ y_{t+1} \end{bmatrix} = \begin{bmatrix} 1 & 0 & 0 \\ 0 & A & 0 \\ \nu & D & 1 \end{bmatrix} \begin{bmatrix} 1 \\ x_t \\ y_t \end{bmatrix} + \begin{bmatrix} 0 \ B \ F \end{bmatrix} z_{t+1} $$

- **Explanation:** Adding a note before the matrix equation helps readers understand the structure and purpose of the augmented system, making the mathematical representation more accessible.

**Current text:**
```markdown
Next we construct a linear system

$$
\begin{bmatrix}
     1 \\
     x_{t+1} \\
     y_{t+1}
 \end{bmatrix} =
 \begin{bmatrix}
    1 & 0 & 0  \\
    0  & A & 0 \\
    \nu & D &  1
\end{bmatrix}
\begin{bmatrix}
    1 \\
    x_t \\
    y_t
\end{bmatrix} +
\begin{bmatrix}
    0 \\  B \\ F
\end{bmatrix}
z_{t+1}
$$

Suggested improvement:

Next we construct a linear system

Explanation: Adding a note before the matrix equation helps readers understand the structure and purpose of the augmented system, making the mathematical representation more accessible.


8. qe-writing-007 - Use visual elements to enhance understanding

Location: Section "More about the multiplicative martingale" / Before the density plots

Severity: info

Description: The section discusses the log-normal distribution of the multiplicative martingale but could use an admonition to highlight the key mathematical insight before showing the density evolution.

  • Current text:
It follows that $\log {\widetilde M}_t \sim {\mathcal N} ( -\frac{t H \cdot H}{2}, t H \cdot H )$ and that consequently ${\widetilde M}_t$ is log normal.

### Simulating a multiplicative martingale again

Next, we want a program to simulate the likelihood ratio process $\{ \tilde{M}_t \}_{t=0}^\infty$.
  • Suggested fix:
It follows that $\log {\widetilde M}_t \sim {\mathcal N} ( -\frac{t H \cdot H}{2}, t H \cdot H )$ and that consequently ${\widetilde M}_t$ is log normal.

```{note}

**Current text:**
```markdown
It follows that $\log {\widetilde M}_t \sim {\mathcal N} ( -\frac{t H \cdot H}{2}, t H \cdot H )$ and that consequently ${\widetilde M}_t$ is log normal.

### Simulating a multiplicative martingale again

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

Suggested improvement:

It follows that $\log {\widetilde M}_t \sim {\mathcal N} ( -\frac{t H \cdot H}{2}, t H \cdot H )$ and that consequently ${\widetilde M}_t$ is log normal.

Explanation: This admonition bridges the theoretical result and the visualizations that follow, helping readers connect the mathematical properties to the distributional dynamics shown in the density plots.


@netlify
Copy link

netlify bot commented Oct 10, 2025

Deploy Preview for lustrous-melomakarona-3ee73e ready!

Name Link
🔨 Latest commit 136d218
🔍 Latest deploy log https://app.netlify.com/projects/lustrous-melomakarona-3ee73e/deploys/68e8de71ff3c8800084896fc
😎 Deploy Preview https://deploy-preview-281--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.

@mmcky mmcky closed this Oct 11, 2025
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.

1 participant