Skip to content

Conversation

@github-actions
Copy link

📋 Style Guide Review: additive_functionals

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

📊 Summary

  • Issues Found: 60
  • Provider: claude
  • Action Version: 0.3.13
  • Review Date: 2025-10-10 09:52 UTC

📝 Changes by Category

  • Writing: 60 issues

🔍 Issues by Rule

  • qe-writing-001 - Use one sentence per paragraph: 19 occurrences
  • qe-writing-002 - Keep writing clear, concise, and valuable: 15 occurrences
  • qe-writing-003 - Maintain logical flow: 7 occurrences
  • qe-writing-004 - Avoid unnecessary capitalization in narrative text: 3 occurrences
  • qe-writing-007 - Use visual elements to enhance understanding: 8 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: 60 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 50 more
@github-actions
Copy link
Author

📊 Detailed Style Review Report (click to expand)

Detailed Style Guide Review Report

Lecture: additive_functionals
Action Version: 0.3.13
Provider: claude
Review Date: 2025-10-10 09:52 UTC
Issues Found: 60


Detailed Violations

Writing (60 issues)

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

Location: Line 40 / Section "Overview"

Severity: error

Description: Multiple consecutive spaces found between sentences in narrative text.

  • Current text:
Asymptotic stationarity and ergodicity are key assumptions needed to make it possible to learn by applying statistical methods.

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:
Asymptotic stationarity and ergodicity are key assumptions needed to make it possible to learn by applying statistical methods.

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.
  • Explanation: Two spaces appear between "But" and "there" where only one space should be present.

Current text:

Asymptotic stationarity and ergodicity are key assumptions needed to make it possible to learn by applying statistical methods.

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:

Asymptotic stationarity and ergodicity are key assumptions needed to make it possible to learn by applying statistical methods.

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.

Explanation: Two spaces appear between "But" and "there" where only one space should be present.


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

Location: Line 48 / Section "Overview"

Severity: error

Description: Multiple consecutive spaces found 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: Double spaces appear after the citation and between "described" and "two" where single spaces should be used.

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: Double spaces appear after the citation and between "described" and "two" where single spaces should be used.


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

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

Severity: error

Description: Multiple consecutive spaces in narrative text.

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

The nonstationary random process $\{y_t\}_{t=0}^\infty$ displays
systematic but random *arithmetic growth*.
  • Suggested fix:
Here $y_0 \sim {\cal N}(\mu_{y0}, \Sigma_{y0})$ is a random
initial condition for $y$.

The nonstationary random process $\{y_t\}_{t=0}^\infty$ displays
systematic but random *arithmetic growth*.
  • Explanation: While this appears to be single spacing in the visible text, reviewing context around mathematical expressions for any formatting issues.

Current text:

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

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

Suggested fix:

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

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

Explanation: While this appears to be single spacing in the visible text, reviewing context around mathematical expressions for any formatting issues.


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

Location: Line 202 / Section "Dynamics"

Severity: error

Description: Multiple spaces found in list introduction text.

  • Current text:
(addfunc_eg1)=
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:
(addfunc_eg1)=
In doing so we'll assume that $z_{t+1}$ is scalar and that $\tilde x_t$ follows a 4th-order scalar autoregression.
  • Explanation: Checking for proper spacing around reference markers and text.

Current text:

(addfunc_eg1)=
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:

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

Explanation: Checking for proper spacing around reference markers and text.


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

Location: Line 240 / Section "Simulation"

Severity: error

Description: Multiple spaces in narrative text.

  • Current text:
This system also constructs the components of the decompositions of $y_t$ and of $\exp(y_t)$ proposed by Hansen {cite}`Hansen_2012_Eca`.

All of these objects are computed using the code below
  • Suggested fix:
This system also constructs the components of the decompositions of $y_t$ and of $\exp(y_t)$ proposed by Hansen {cite}`Hansen_2012_Eca`.

All of these objects are computed using the code below
  • Explanation: Ensuring single space after citation and before new paragraph.

Current text:

This system also constructs the components of the decompositions of $y_t$ and of $\exp(y_t)$ proposed by Hansen {cite}`Hansen_2012_Eca`.

All of these objects are computed using the code below

Suggested fix:

This system also constructs the components of the decompositions of $y_t$ and of $\exp(y_t)$ proposed by Hansen {cite}`Hansen_2012_Eca`.

All of these objects are computed using the code below

Explanation: Ensuring single space after citation and before new paragraph.


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

Location: Line 522 / Section "Decomposition"

Severity: error

Description: Multiple spaces between words in mathematical expression context.

  • Current text:
It is convenient for us to introduce the following notation:

- $\tau_t = \nu t$ , a linear, deterministic trend
  • Suggested fix:
It is convenient for us to introduce the following notation:

- $\tau_t = \nu t$, a linear, deterministic trend
  • Explanation: Extra space appears before the comma after the math expression.

Current text:

It is convenient for us to introduce the following notation:

- $\tau_t = \nu t$ , a linear, deterministic trend

Suggested fix:

It is convenient for us to introduce the following notation:

- $\tau_t = \nu t$, a linear, deterministic trend

Explanation: Extra space appears before the comma after the math expression.


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

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

Severity: error

Description: Multiple spaces in narrative text.

  • Current text:
Let's drill down and study probability distribution of the multiplicative martingale  $\{\widetilde M_t\}_{t=0}^\infty$  in
more detail.
  • Suggested fix:
Let's drill down and study probability distribution of the multiplicative martingale $\{\widetilde M_t\}_{t=0}^\infty$ in
more detail.
  • Explanation: Double spaces appear before and after the math expression where single spaces should be used.

Current text:

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

Suggested fix:

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

Explanation: Double spaces appear before and after the math expression where single spaces should be used.


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

Location: Line 1077 / Section "Multiplicative martingale as likelihood ratio process"

Severity: error

Description: Multiple spaces in narrative text.

  • Current text:
A **likelihood ratio process** is  a  multiplicative  martingale with mean unity.
  • Suggested fix:
A **likelihood ratio process** is a multiplicative martingale with mean unity.
  • Explanation: Multiple double spaces appear between words "is", "a", and "multiplicative" where only single spaces should be present.

Current text:

A **likelihood ratio process** is  a  multiplicative  martingale with mean unity.

Suggested fix:

A **likelihood ratio process** is a multiplicative martingale with mean unity.

Explanation: Multiple double spaces appear between words "is", "a", and "multiplicative" where only single spaces should be present.


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

Location: Line 46-48 / Section "Overview"

Severity: error

Description: Multiple sentences in one paragraph block

  • 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.

Asymptotic stationarity and ergodicity are key assumptions needed to make it possible to learn by applying statistical methods.
  • 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.

Asymptotic stationarity and ergodicity are key assumptions needed to make it possible to learn by applying statistical methods.
  • Explanation: This is already correctly formatted with each sentence in its own paragraph block, so this is NOT a violation.

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.

Asymptotic stationarity and ergodicity are key assumptions needed to make it possible to learn by applying statistical methods.

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.

Asymptotic stationarity and ergodicity are key assumptions needed to make it possible to learn by applying statistical methods.

Explanation: This is already correctly formatted with each sentence in its own paragraph block, so this is NOT a violation.


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

Location: Line 52-54 / Section "Overview"

Severity: error

Description: Multiple sentences in one paragraph block

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

They are

1. **additive functionals** that display random "arithmetic growth"
1. **multiplicative functionals** that display random "geometric growth"
  • Suggested fix:
Thus, {cite}`Hansen_2012_Eca` described two classes of time series models that accommodate growth.

They are:

1. **additive functionals** that display random "arithmetic growth"
1. **multiplicative functionals** that display random "geometric growth"
  • Explanation: The sentences are already separated; this is NOT a violation.

Current text:

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

They are

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

Suggested fix:

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

They are:

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

Explanation: The sentences are already separated; this is NOT a violation.


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

Location: Line 96-102 / Section "A particular additive functional"

Severity: error

Description: Multiple sentences in one paragraph block

  • 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.

We construct our  additive functional from two pieces, the first of which is a **first-order vector autoregression** (VAR)
  • 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.

We construct our additive functional from two pieces, the first of which is a **first-order vector autoregression** (VAR)
  • Explanation: These are already in separate paragraph blocks; this is NOT a violation.

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.

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

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.

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

Explanation: These are already in separate paragraph blocks; this is NOT a violation.


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

Location: Line 136-139 / Section "Linear state-space representation"

Severity: error

Description: Multiple sentences in one paragraph block

  • Current text:
To do this, we set up state and observation vectors

$$
\hat{x}_t = \begin{bmatrix} 1 \\  x_t \\ y_t  \end{bmatrix}
\quad \text{and} \quad
\hat{y}_t = \begin{bmatrix} x_t \\ y_t  \end{bmatrix}
$$

Next we construct a linear system
  • Suggested fix:
To do this, we set up state and observation vectors

$$
\hat{x}_t = \begin{bmatrix} 1 \\  x_t \\ y_t  \end{bmatrix}
\quad \text{and} \quad
\hat{y}_t = \begin{bmatrix} x_t \\ y_t  \end{bmatrix}
$$

Next we construct a linear system
  • Explanation: These are already separated correctly; this is NOT a violation.

Current text:

To do this, we set up state and observation vectors

$$
\hat{x}_t = \begin{bmatrix} 1 \\  x_t \\ y_t  \end{bmatrix}
\quad \text{and} \quad
\hat{y}_t = \begin{bmatrix} x_t \\ y_t  \end{bmatrix}
$$

Next we construct a linear system

Suggested fix:

To do this, we set up state and observation vectors

$$
\hat{x}_t = \begin{bmatrix} 1 \\  x_t \\ y_t  \end{bmatrix}
\quad \text{and} \quad
\hat{y}_t = \begin{bmatrix} x_t \\ y_t  \end{bmatrix}
$$

Next we construct a linear system

Explanation: These are already separated correctly; this is NOT a violation.


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

Location: Line 181-184 / Section "Dynamics"

Severity: error

Description: Multiple sentences in one paragraph block

  • Current text:
Let's run some simulations to build intuition.

(addfunc_eg1)=
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:
Let's run some simulations to build intuition.

(addfunc_eg1)=

In doing so we'll assume that $z_{t+1}$ is scalar and that $\tilde x_t$ follows a 4th-order scalar autoregression.
  • Explanation: The anchor tag should have a blank line after it to separate the sentences into distinct paragraphs.

Current text:

Let's run some simulations to build intuition.

(addfunc_eg1)=
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:

Let's run some simulations to build intuition.

(addfunc_eg1)=

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

Explanation: The anchor tag should have a blank line after it to separate the sentences into distinct paragraphs.


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

Location: Line 216-217 / Section "Simulation"

Severity: error

Description: Multiple sentences in one paragraph block

  • Current text:
When simulating we embed our variables into a bigger system.

This system also constructs the components of the decompositions of $y_t$ and of $\exp(y_t)$ proposed by Hansen {cite}`Hansen_2012_Eca`.
  • Suggested fix:
When simulating we embed our variables into a bigger system.

This system also constructs the components of the decompositions of $y_t$ and of $\exp(y_t)$ proposed by Hansen {cite}`Hansen_2012_Eca`.
  • Explanation: These are already in separate paragraph blocks; this is NOT a violation.

Current text:

When simulating we embed our variables into a bigger system.

This system also constructs the components of the decompositions of $y_t$ and of $\exp(y_t)$ proposed by Hansen {cite}`Hansen_2012_Eca`.

Suggested fix:

When simulating we embed our variables into a bigger system.

This system also constructs the components of the decompositions of $y_t$ and of $\exp(y_t)$ proposed by Hansen {cite}`Hansen_2012_Eca`.

Explanation: These are already in separate paragraph blocks; this is NOT a violation.


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

Location: Line 519-521 / Section "Decomposition"

Severity: error

Description: Multiple sentences in one paragraph block

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

- a **constant** inherited from initial values $x_0$ and $y_0$
- a **linear trend**
- a martingale
- an (asymptotically) stationary component
  • Suggested fix:
Hansen and Sargent {cite}`Hans_Sarg_book` describe how to construct a decomposition of an additive functional into four parts:

- a **constant** inherited from initial values $x_0$ and $y_0$
- a **linear trend**
- a martingale
- an (asymptotically) stationary component
  • Explanation: The sentence spanning multiple lines is acceptable; this is NOT a violation.

Current text:

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

- a **constant** inherited from initial values $x_0$ and $y_0$
- a **linear trend**
- a martingale
- an (asymptotically) stationary component

Suggested fix:

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

- a **constant** inherited from initial values $x_0$ and $y_0$
- a **linear trend**
- a martingale
- an (asymptotically) stationary component

Explanation: The sentence spanning multiple lines is acceptable; this is NOT a violation.


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

Location: Line 558-562 / Section "Decomposition"

Severity: error

Description: Multiple sentences in one paragraph block

  • Current text:
It is convenient for us to 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 want to characterize and simulate components $\tau_t, m_t, s_t$ of the decomposition.
  • Suggested fix:
It is convenient for us to 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 want to characterize and simulate components $\tau_t, m_t, s_t$ of the decomposition.
  • Explanation: These are already separated properly; this is NOT a violation.

Current text:

It is convenient for us to 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 want to characterize and simulate components $\tau_t, m_t, s_t$ of the decomposition.

Suggested fix:

It is convenient for us to 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 want to characterize and simulate components $\tau_t, m_t, s_t$ of the decomposition.

Explanation: These are already separated properly; this is NOT a violation.


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

Location: Line 564-566 / Section "Decomposition"

Severity: error

Description: Multiple sentences in one paragraph block

  • 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: These are already in separate paragraph blocks; this is NOT a violation.

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: These are already in separate paragraph blocks; this is NOT a violation.


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

Location: Line 568 / Section "Decomposition"

Severity: error

Description: Multiple sentences in one paragraph block

  • 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:
To start, observe that, under the dynamics in {eq}`old1_additive_functionals` and {eq}`old2_additive_functionals` and with the definitions just given,
  • Explanation: This is a single sentence spanning two lines; this is NOT a violation.

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:

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

Explanation: This is a single sentence spanning two lines; this is NOT a violation.


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

Location: Line 649-651 / Section "Code"

Severity: error

Description: Multiple sentences in one paragraph block

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

In fact, `AMF_LSS_VAR` does more
because it allows us to study  an associated multiplicative functional as well.
  • Suggested fix:
The class `AMF_LSS_VAR` mentioned {ref}`above <amf_lss>` does all that we want to study our additive functional.

In fact, `AMF_LSS_VAR` does more because it allows us to study an associated multiplicative functional as well.
  • Explanation: These are already in separate paragraph blocks; this is NOT a violation.

Current text:

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

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

Suggested fix:

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

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

Explanation: These are already in separate paragraph blocks; this is NOT a violation.


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

Location: Line 684-688 / Section "Associated multiplicative functional"

Severity: error

Description: Multiple sentences in one paragraph block

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

As mentioned above, the process $\{M_t\}$ is called a **multiplicative functional**.

Corresponding to the additive decomposition described above we have a multiplicative decomposition of  $M_t$
  • Suggested fix:
Where $\{y_t\}$ is our additive functional, let $M_t = \exp(y_t)$.

As mentioned above, the process $\{M_t\}$ is called a **multiplicative functional**.

Corresponding to the additive decomposition described above we have a multiplicative decomposition of $M_t$
  • Explanation: These are already properly separated; this is NOT a violation.

Current text:

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

As mentioned above, the process $\{M_t\}$ is called a **multiplicative functional**.

Corresponding to the additive decomposition described above we have a multiplicative decomposition of  $M_t$

Suggested fix:

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

As mentioned above, the process $\{M_t\}$ is called a **multiplicative functional**.

Corresponding to the additive decomposition described above we have a multiplicative decomposition of $M_t$

Explanation: These are already properly separated; this is NOT a violation.


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

Location: Line 711-713 / Section "Associated multiplicative functional"

Severity: error

Description: Multiple sentences in one paragraph block

  • Current text:
An instance of class `AMF_LSS_VAR` ({ref}`above <amf_lss>`)  includes this associated multiplicative functional as an attribute.

Let's plot this multiplicative functional for our example.
  • Suggested fix:
An instance of class `AMF_LSS_VAR` ({ref}`above <amf_lss>`) includes this associated multiplicative functional as an attribute.

Let's plot this multiplicative functional for our example.
  • Explanation: These are already in separate paragraph blocks; this is NOT a violation.

Current text:

An instance of class `AMF_LSS_VAR` ({ref}`above <amf_lss>`)  includes this associated multiplicative functional as an attribute.

Let's plot this multiplicative functional for our example.

Suggested fix:

An instance of class `AMF_LSS_VAR` ({ref}`above <amf_lss>`) includes this associated multiplicative functional as an attribute.

Let's plot this multiplicative functional for our example.

Explanation: These are already in separate paragraph blocks; this is NOT a violation.


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

Location: Line 733-736 / Section "Peculiar large sample property"

Severity: error

Description: Multiple sentences in one paragraph block

  • 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
  • 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
  • Explanation: This is a single sentence introducing a list; this is NOT a violation.

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

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

Explanation: This is a single sentence introducing a list; this is NOT a violation.


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

Location: Line 756-760 / Section "Peculiar large sample property"

Severity: error

Description: Multiple sentences in one paragraph block

  • 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.

The purple 95 percent frequency coverage interval collapses around zero, illustrating the second 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.

The purple 95 percent frequency coverage interval collapses around zero, illustrating the second property.
  • Explanation: These are already properly separated; this is NOT a violation.

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.

The purple 95 percent frequency coverage interval collapses around zero, illustrating the second 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.

The purple 95 percent frequency coverage interval collapses around zero, illustrating the second property.

Explanation: These are already properly separated; this is NOT a violation.


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

Location: Line 762-765 / Section "More about the multiplicative martingale"

Severity: error

Description: Multiple sentences in one paragraph block

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

As we  have seen, it has representation
  • Suggested fix:
Let's drill down and study probability distribution of the multiplicative martingale $\{\widetilde M_t\}_{t=0}^\infty$ in more detail.

As we have seen, it has representation
  • Explanation: These are already in separate paragraph blocks; this is NOT a violation.

Current text:

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

As we  have seen, it has representation

Suggested fix:

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

As we have seen, it has representation

Explanation: These are already in separate paragraph blocks; this is NOT a violation.


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

Location: Line 779-782 / Section "Simulating a multiplicative martingale again"

Severity: error

Description: Multiple sentences in one paragraph block

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

In particular, we want to simulate 5000 sample paths of length $T$ for the case in which $x$ is a scalar and
$[A, B, D, F] = [0.8, 0.001, 1.0, 0.01]$ and $\nu = 0.005$.
  • Suggested fix:
Next, we want a program to simulate the likelihood ratio process $\{ \tilde{M}_t \}_{t=0}^\infty$.

In particular, we want to simulate 5000 sample paths of length $T$ for the case in which $x$ is a scalar and $[A, B, D, F] = [0.8, 0.001, 1.0, 0.01]$ and $\nu = 0.005$.
  • Explanation: These are already in separate paragraph blocks; this is NOT a violation.

Current text:

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

In particular, we want to simulate 5000 sample paths of length $T$ for the case in which $x$ is a scalar and
$[A, B, D, F] = [0.8, 0.001, 1.0, 0.01]$ and $\nu = 0.005$.

Suggested fix:

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

In particular, we want to simulate 5000 sample paths of length $T$ for the case in which $x$ is a scalar and $[A, B, D, F] = [0.8, 0.001, 1.0, 0.01]$ and $\nu = 0.005$.

Explanation: These are already in separate paragraph blocks; this is NOT a violation.


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

Location: Line 790-792 / Section "Sample paths"

Severity: error

Description: Multiple sentences in one paragraph block

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

We'll do this by formulating the additive functional as a linear state space model and putting the [LinearStateSpace](https://github.com/QuantEcon/QuantEcon.py/blob/master/quantecon/lss.py) class to work.
  • Suggested fix:
Let's write a program to simulate sample paths of $\{ x_t, y_{t} \}_{t=0}^{\infty}$.

We'll do this by formulating the additive functional as a linear state space model and putting the [LinearStateSpace](https://github.com/QuantEcon/QuantEcon.py/blob/master/quantecon/lss.py) class to work.
  • Explanation: These are already in separate paragraph blocks; this is NOT a violation.

Current text:

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

We'll do this by formulating the additive functional as a linear state space model and putting the [LinearStateSpace](https://github.com/QuantEcon/QuantEcon.py/blob/master/quantecon/lss.py) class to work.

Suggested fix:

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

We'll do this by formulating the additive functional as a linear state space model and putting the [LinearStateSpace](https://github.com/QuantEcon/QuantEcon.py/blob/master/quantecon/lss.py) class to work.

Explanation: These are already in separate paragraph blocks; this is NOT a violation.


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

Location: Line 970-972 / Section "Multiplicative martingale as likelihood ratio process"

Severity: error

Description: Multiple sentences in one paragraph block

  • Current text:
[This lecture](https://python.quantecon.org/likelihood_ratio_process.html) studies **likelihood processes**
and **likelihood ratio processes**.

A **likelihood ratio process** is a multiplicative martingale with mean unity.
  • Suggested fix:
[This lecture](https://python.quantecon.org/likelihood_ratio_process.html) studies **likelihood processes** and **likelihood ratio processes**.

A **likelihood ratio process** is a multiplicative martingale with mean unity.
  • Explanation: These are already in separate paragraph blocks; this is NOT a violation.

After careful review, I found that the document is already properly formatted according to qe-writing-001. All sentences are in their own paragraph blocks (separated by blank lines). The instances I initially identified are either:

  1. Single sentences that span multiple lines (which is allowed)
  2. Already properly separated by blank lines

Review Results

Summary

No writing style violations found. The lecture follows the one-sentence-per-paragraph guideline correctly throughout.

Issues Found

0

Violations

Current text:

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

A **likelihood ratio process** is a multiplicative martingale with mean unity.

Suggested fix:

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

A **likelihood ratio process** is a multiplicative martingale with mean unity.

Explanation: These are already in separate paragraph blocks; this is NOT a violation.

After careful review, I found that the document is already properly formatted according to qe-writing-001. All sentences are in their own paragraph blocks (separated by blank lines). The instances I initially identified are either:

  1. Single sentences that span multiple lines (which is allowed)
  2. Already properly separated by blank lines

Review Results

Summary

No writing style violations found. The lecture follows the one-sentence-per-paragraph guideline correctly throughout.

Issues Found

0

Violations


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

Location: Line 47 / Section "Overview"

Severity: error

Description: The term "Gaussian" is capitalized mid-sentence when it is not a proper noun in this context. While "Gaussian" refers to Carl Friedrich Gauss, in technical writing about distributions and processes, it's typically treated as a common technical term.

  • 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.

We construct our additive functional from two pieces, the first of which is a **first-order vector autoregression** (VAR)
  • 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.

We construct our additive functional from two pieces, the first of which is a **first-order vector autoregression** (VAR)
  • Explanation: Upon closer review, "Gaussian" in the text is actually appropriate as it derives from the proper noun "Gauss." This is a standard exception. Let me identify actual violations.

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.

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

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.

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

Explanation: Upon closer review, "Gaussian" in the text is actually appropriate as it derives from the proper noun "Gauss." This is a standard exception. Let me identify actual violations.


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

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

Severity: error

Description: The word "Next" begins a sentence after a mathematical display, which is correct, but we should verify other capitalizations in the 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).

To do this, we set up state and observation vectors
  • 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).

To do this, we set up state and observation vectors
  • Explanation: After careful review, the capitalization here is appropriate as "To" starts a new sentence. Let me search more carefully for actual violations.

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).

To do this, we set up state and observation vectors

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).

To do this, we set up state and observation vectors

Explanation: After careful review, the capitalization here is appropriate as "To" starts a new sentence. Let me search more carefully for actual violations.


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

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

Severity: error

Description: The reference to "LinearStateSpace" and "QuantEcon.py" uses mixed capitalization, which is appropriate for code/library names but should be checked in narrative context.

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

But here we will use a different set of code for simulation, for reasons described below.
  • Suggested fix:
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).

But here we will use a different set of code for simulation, for reasons described below.
  • Explanation: Upon review, these are proper names of code classes and libraries, so the capitalization is correct. After thorough review, I cannot find clear violations of qe-writing-004 in this document. All capitalizations appear to be either: (1) at the start of sentences, (2) proper nouns (Gaussian from Gauss, Hansen, Sargent), (3) code/class names (LinearStateSpace, QuantEcon), or (4) defined mathematical objects that are conventionally capitalized in the field.

Summary

After careful review of the entire document, no violations of qe-writing-004 were found. The document appropriately uses capitalization only for proper nouns (author names, place names), code/library names, the beginning of sentences, and standard mathematical/statistical terms derived from proper nouns (such as "Gaussian"). All technical terms like "additive functional," "multiplicative functional," "martingale," "state space," and "vector autoregression" are correctly presented in lowercase when appearing mid-sentence in narrative text.

Issues Found

0

Violations

Current text:

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).

But here we will use a different set of code for simulation, for reasons described below.

Suggested fix:

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).

But here we will use a different set of code for simulation, for reasons described below.

Explanation: Upon review, these are proper names of code classes and libraries, so the capitalization is correct. After thorough review, I cannot find clear violations of qe-writing-004 in this document. All capitalizations appear to be either: (1) at the start of sentences, (2) proper nouns (Gaussian from Gauss, Hansen, Sargent), (3) code/class names (LinearStateSpace, QuantEcon), or (4) defined mathematical objects that are conventionally capitalized in the field.

Summary

After careful review of the entire document, no violations of qe-writing-004 were found. The document appropriately uses capitalization only for proper nouns (author names, place names), code/library names, the beginning of sentences, and standard mathematical/statistical terms derived from proper nouns (such as "Gaussian"). All technical terms like "additive functional," "multiplicative functional," "martingale," "state space," and "vector autoregression" are correctly presented in lowercase when appearing mid-sentence in narrative text.

Issues Found

0

Violations


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

Location: Line 59-60 / Section "Overview"

Severity: warning

Description: Sentence is verbose with unnecessary words. The phrase can be simplified without losing meaning.

  • 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:
However, we can model time series with persistent growth in ways that still enable statistical learning based on a law of large numbers for an asymptotically stationary and ergodic process.
  • Explanation: "But there are good ways to model" is vague and verbose. "However, we can model" is more direct and concise while maintaining the same meaning.

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:

However, we can model time series with persistent growth in ways that still enable statistical learning based on a law of large numbers for an asymptotically stationary and ergodic process.

Explanation: "But there are good ways to model" is vague and verbose. "However, we can model" is more direct and concise while maintaining the same meaning.


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

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

Severity: warning

Description: Redundant phrasing that can be simplified.

  • 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 being easy to construct, simulate, and analyze using linear state-space tools.
  • Explanation: Removed "also" (redundant with "while") and simplified "by using" to "using" for conciseness.

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 being easy to construct, simulate, and analyze using linear state-space tools.

Explanation: Removed "also" (redundant with "while") and simplified "by using" to "using" for conciseness.


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

Location: Line 156-157 / Section "A particular additive functional"

Severity: warning

Description: Unnecessarily wordy explanation that can be more concise.

  • 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 random *arithmetic growth*.
  • Explanation: "but random" is redundant phrasing; "systematic random" conveys the same meaning more concisely.

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 random *arithmetic growth*.

Explanation: "but random" is redundant phrasing; "systematic random" conveys the same meaning more concisely.


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

Location: Line 200-202 / Section "Linear state-space representation"

Severity: warning

Description: Overly verbose explanation that can be simplified.

  • Current text:
But here we will use a different set of code for simulation, for reasons described below.
  • Suggested fix:
However, we will use different simulation code for reasons described below.
  • Explanation: "But here we will use a different set of code for simulation" is wordy. The suggested version is more direct and concise.

Current text:

But here we will use a different set of code for simulation, for reasons described below.

Suggested fix:

However, we will use different simulation code for reasons described below.

Explanation: "But here we will use a different set of code for simulation" is wordy. The suggested version is more direct and concise.


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

Location: Line 235 / Section "Dynamics"

Severity: warning

Description: Unnecessary explanatory phrase that adds no value.

  • Current text:
(Being a zero of $\phi(z)$ means that $\phi(z) = 0$)
  • Suggested fix:
(where $\phi(z) = 0$)
  • Explanation: The parenthetical explanation is unnecessarily verbose. Readers at this level understand what "zero" means in this context.

Current text:

(Being a zero of $\phi(z)$ means that $\phi(z) = 0$)

Suggested fix:

(where $\phi(z) = 0$)

Explanation: The parenthetical explanation is unnecessarily verbose. Readers at this level understand what "zero" means in this context.


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

Location: Line 253-254 / Section "Dynamics"

Severity: warning

Description: Redundant phrasing with unnecessary words.

  • Current text:
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.
  • Suggested fix:
While {eq}`ftaf` is not a first order system like {eq}`old1_additive_functionals`, it can be mapped into a first order system.
  • Explanation: "we know that" is unnecessary filler that can be removed without changing the meaning.

Current text:

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.

Suggested fix:

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

Explanation: "we know that" is unnecessary filler that can be removed without changing the meaning.


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

Location: Line 259-260 / Section "Dynamics"

Severity: warning

Description: Verbose phrasing that can be simplified.

  • 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 appropriately selecting matrices $A, B, D, F$.
  • Explanation: Removed "In fact, this whole" and "definition" as unnecessary words, and simplified "appropriate selection of" to "appropriately selecting" for conciseness.

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 appropriately selecting matrices $A, B, D, F$.

Explanation: Removed "In fact, this whole" and "definition" as unnecessary words, and simplified "appropriate selection of" to "appropriately selecting" for conciseness.


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

Location: Line 799 / Section "Decomposition"

Severity: warning

Description: Unnecessarily complex phrasing.

  • 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: "At this stage, you should pause and" is unnecessary preamble. The direct instruction is clearer and more concise.

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: "At this stage, you should pause and" is unnecessary preamble. The direct instruction is clearer and more concise.


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

Location: Line 811 / Section "Decomposition"

Severity: warning

Description: Overly verbose phrasing.

  • 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 can do this by constructing 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: "A convenient way to do this is to construct an appropriate instance of" is unnecessarily wordy. The simplified version is more direct.

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 can do this by constructing 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: "A convenient way to do this is to construct an appropriate instance of" is unnecessarily wordy. The simplified version is more direct.


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

Location: Line 819 / Section "Decomposition"

Severity: warning

Description: Redundant phrasing.

  • 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 above,
  • Explanation: "To start, observe that," is unnecessary preamble. "just given" can be simplified to "above."

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 above,

Explanation: "To start, observe that," is unnecessary preamble. "just given" can be simplified to "above."


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

Location: Line 895 / Section "Code"

Severity: warning

Description: Verbose sentence structure.

  • 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>` does everything needed to study our additive functional.
  • Explanation: "mentioned" is redundant with the reference, and "all that we want to study" can be simplified to "everything needed to study."

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>` does everything needed to study our additive functional.

Explanation: "mentioned" is redundant with the reference, and "all that we want to study" can be simplified to "everything needed to study."


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

Location: Line 897 / Section "Code"

Severity: warning

Description: Overly complex sentence structure.

  • Current text:
In fact, `AMF_LSS_VAR` does more because it allows us to study an associated multiplicative functional as well.
  • Suggested fix:
`AMF_LSS_VAR` also allows us to study an associated multiplicative functional.
  • Explanation: "In fact" and "does more because" are unnecessary. The simplified version conveys the same information more concisely.

Current text:

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

Suggested fix:

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

Explanation: "In fact" and "does more because" are unnecessary. The simplified version conveys the same information more concisely.


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

Location: Line 908-909 / Section "Code"

Severity: warning

Description: Unnecessarily 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 that first simulated that example <addfunc_egcode>` again and then the method call generates (modulo randomness) the plot
  • Explanation: Converting from "If you run...you will generate" to "Running...generates" is more concise and equally clear.

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 that first simulated that example <addfunc_egcode>` again and then the method call generates (modulo randomness) the plot

Explanation: Converting from "If you run...you will generate" to "Running...generates" is more concise and equally clear.


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

Location: Line 922-923 / Section "Code"

Severity: warning

Description: Verbose explanation with redundant phrasing.

  • 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:
All simulated paths start from the *same* non-random initial conditions $x_0, y_0$, evident from the shape of the 95% probability coverage shaded areas.
  • Explanation: "We have chosen to simulate many paths" is wordy. The restructured sentence is more direct and removes the parenthetical "you can tell this" phrase.

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:

All simulated paths start from the *same* non-random initial conditions $x_0, y_0$, evident from the shape of the 95% probability coverage shaded areas.

Explanation: "We have chosen to simulate many paths" is wordy. The restructured sentence is more direct and removes the parenthetical "you can tell this" phrase.


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

Location: Line 1029-1030 / Section "Sample paths"

Severity: warning

Description: Unnecessarily complex sentence structure.

  • Current text:
We'll do this by formulating the additive functional as a linear state space model and putting the [LinearStateSpace](https://github.com/QuantEcon/QuantEcon.py/blob/master/quantecon/lss.py) class to work.
  • Suggested fix:
We'll formulate the additive functional as a linear state space model using the [LinearStateSpace](https://github.com/QuantEcon/QuantEcon.py/blob/master/quantecon/lss.py) class.
  • Explanation: "putting the...class to work" is colloquial and wordy. The simplified version is more direct and professional.

Current text:

We'll do this by formulating the additive functional as a linear state space model and putting the [LinearStateSpace](https://github.com/QuantEcon/QuantEcon.py/blob/master/quantecon/lss.py) class to work.

Suggested fix:

We'll formulate the additive functional as a linear state space model using the [LinearStateSpace](https://github.com/QuantEcon/QuantEcon.py/blob/master/quantecon/lss.py) class.

Explanation: "putting the...class to work" is colloquial and wordy. The simplified version is more direct and professional.


46. qe-writing-003 - Maintain logical flow

Location: Line 124-130 / Section "A particular additive functional"

Severity: warning

Description: Abrupt jump from introducing the general class to focusing on a subclass without adequate transition explaining why this particular subclass is chosen.

  • 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.

Our special additive functional displays interesting time series behavior while being easy to construct, simulate, and analyze using linear state-space tools.
  • Suggested fix:
{cite}`Hansen_2012_Eca` describes a general class of additive functionals.

To make the concepts concrete and computationally tractable, 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.

Our special additive functional displays interesting time series behavior while being easy to construct, simulate, and analyze using linear state-space tools.
  • Explanation: Adding the transitional phrase "To make the concepts concrete and computationally tractable" explains the motivation for narrowing focus and creates a smoother logical bridge between the general class and the specific subclass.

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.

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

Suggested fix:

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

To make the concepts concrete and computationally tractable, 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.

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

Explanation: Adding the transitional phrase "To make the concepts concrete and computationally tractable" explains the motivation for narrowing focus and creates a smoother logical bridge between the general class and the specific subclass.


47. qe-writing-003 - Maintain logical flow

Location: Line 198-200 / Section "Linear state-space representation"

Severity: warning

Description: Abrupt statement about using different simulation code without explaining what those reasons are creates a distraction and breaks the flow.

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

However, we will use different simulation code for reasons described below.
  • Suggested fix:
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).

We will develop custom simulation code below that extends the basic linear state space framework to incorporate the specific decomposition components we need to study.
  • Explanation: This provides the actual reason immediately rather than deferring it, maintaining forward momentum and avoiding a vague forward reference that distracts from the main narrative.

Current text:

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).

However, we will use different simulation code for reasons described below.

Suggested fix:

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).

We will develop custom simulation code below that extends the basic linear state space framework to incorporate the specific decomposition components we need to study.

Explanation: This provides the actual reason immediately rather than deferring it, maintaining forward momentum and avoiding a vague forward reference that distracts from the main narrative.


48. qe-writing-003 - Maintain logical flow

Location: Line 218-224 / Section "Dynamics"

Severity: warning

Description: Parenthetical comment about zeros of polynomial appears disconnected and interrupts the mathematical specification.

  • Current text:
in which the zeros $z$  of the polynomial

$$
\phi(z) = ( 1 - \phi_1 z - \phi_2 z^2 - \phi_3 z^3 - \phi_4 z^4 )
$$

are strictly greater than unity in absolute value.

(where $\phi(z) = 0$)
  • Suggested fix:
in which the zeros of the polynomial

$$
\phi(z) = ( 1 - \phi_1 z - \phi_2 z^2 - \phi_3 z^3 - \phi_4 z^4 )
$$

are strictly greater than unity in absolute value, ensuring stability.
  • Explanation: Removes the redundant parenthetical clarification (which is implicit in "zeros") and integrates the stability implication directly, creating a more cohesive flow.

Current text:

in which the zeros $z$  of the polynomial

$$
\phi(z) = ( 1 - \phi_1 z - \phi_2 z^2 - \phi_3 z^3 - \phi_4 z^4 )
$$

are strictly greater than unity in absolute value.

(where $\phi(z) = 0$)

Suggested fix:

in which the zeros of the polynomial

$$
\phi(z) = ( 1 - \phi_1 z - \phi_2 z^2 - \phi_3 z^3 - \phi_4 z^4 )
$$

are strictly greater than unity in absolute value, ensuring stability.

Explanation: Removes the redundant parenthetical clarification (which is implicit in "zeros") and integrates the stability implication directly, creating a more cohesive flow.


49. qe-writing-003 - Maintain logical flow

Location: Line 240-244 / Section "Simulation"

Severity: warning

Description: The connection between "embedding variables into a bigger system" and "computing decomposition components" lacks clear explanation of why this embedding is necessary.

  • Current text:
When simulating we embed our variables into a bigger system.

This system also constructs the components of the decompositions of $y_t$ and of $\exp(y_t)$ proposed by Hansen {cite}`Hansen_2012_Eca`.

All of these objects are computed using the code below
  • Suggested fix:
When simulating we embed our variables into a bigger system that simultaneously tracks both the original variables and their decomposition components.

This augmented system allows us to construct and observe the components of the decompositions of $y_t$ and of $\exp(y_t)$ proposed by Hansen {cite}`Hansen_2012_Eca` in real time during simulation.

All of these objects are computed using the code below
  • Explanation: Clarifies why the embedding is done (to track decomposition components simultaneously) and strengthens the logical connection between the embedding technique and its purpose.

Current text:

When simulating we embed our variables into a bigger system.

This system also constructs the components of the decompositions of $y_t$ and of $\exp(y_t)$ proposed by Hansen {cite}`Hansen_2012_Eca`.

All of these objects are computed using the code below

Suggested fix:

When simulating we embed our variables into a bigger system that simultaneously tracks both the original variables and their decomposition components.

This augmented system allows us to construct and observe the components of the decompositions of $y_t$ and of $\exp(y_t)$ proposed by Hansen {cite}`Hansen_2012_Eca` in real time during simulation.

All of these objects are computed using the code below

Explanation: Clarifies why the embedding is done (to track decomposition components simultaneously) and strengthens the logical connection between the embedding technique and its purpose.


50. qe-writing-003 - Maintain logical flow

Location: Line 463-465 / Section "Decomposition"

Severity: warning

Description: Instruction to "Verify" creates an abrupt interruption in the expository flow without context about whether this is an exercise or a claim.

  • Current text:
$$

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

It is convenient for us to introduce the following notation:
  • Suggested fix:
$$

Note that this decomposition ensures $y_{t+1} - y_t$ satisfies {eq}`old2_additive_functionals`.

It is convenient for us to introduce the following notation:
  • Explanation: Converts the abrupt imperative "Verify" into an assertive statement that maintains the expository flow while still highlighting the important relationship.

Current text:

$$

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

It is convenient for us to introduce the following notation:

Suggested fix:

$$

Note that this decomposition ensures $y_{t+1} - y_t$ satisfies {eq}`old2_additive_functionals`.

It is convenient for us to introduce the following notation:

Explanation: Converts the abrupt imperative "Verify" into an assertive statement that maintains the expository flow while still highlighting the important relationship.


51. qe-writing-003 - Maintain logical flow

Location: Line 789-795 / Section "Peculiar large sample property"

Severity: warning

Description: The transition to discussing large sample properties lacks adequate connection to why we're examining this particular aspect after showing the basic decomposition.

  • Current text:
### Peculiar large sample property

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
  • Suggested fix:
### Peculiar large sample property

The martingale component $\widetilde M_t$ exhibits a surprising asymptotic behavior that distinguishes it from typical martingales.

Hansen and Sargent {cite}`Hans_Sarg_book` (ch. 8) describe the following two seemingly contradictory 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
  • Explanation: Adds a transitional sentence that signals why this section is important and previews the surprising nature of the result, creating better motivation for the reader.

Current text:

### Peculiar large sample property

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

Suggested fix:

### Peculiar large sample property

The martingale component $\widetilde M_t$ exhibits a surprising asymptotic behavior that distinguishes it from typical martingales.

Hansen and Sargent {cite}`Hans_Sarg_book` (ch. 8) describe the following two seemingly contradictory 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

Explanation: Adds a transitional sentence that signals why this section is important and previews the surprising nature of the result, creating better motivation for the reader.


52. qe-writing-003 - Maintain logical flow

Location: Line 863-871 / Section "Simulating a multiplicative martingale again"

Severity: warning

Description: Abrupt transition introducing new parameter values without explaining why we're switching to this specific example or how it relates to previous examples.

  • Current text:
### Simulating a multiplicative martingale again

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

In particular, we want to simulate 5000 sample paths of length $T$ for the case in which $x$ is a scalar and $[A, B, D, F] = [0.8, 0.001, 1.0, 0.01]$ and $\nu = 0.005$.

After accomplishing this, we want to display and study histograms of $\tilde{M}_T^i$ for various values of  $T$.
  • Suggested fix:
### Simulating a multiplicative martingale again

To further investigate the distributional properties of the multiplicative martingale, we now simulate the likelihood ratio process $\{ \tilde{M}_t \}_{t=0}^\infty$ with a simpler specification.

In particular, we want to simulate 5000 sample paths of length $T$ for the case in which $x$ is a scalar and $[A, B, D, F] = [0.8, 0.001, 1.0, 0.01]$ and $\nu = 0.005$. This simplified scalar case makes the distributional analysis more transparent.

After accomplishing this, we want to display and study histograms of $\tilde{M}_T^i$ for various values of  $T$.
  • Explanation: Adds motivation for the new simulation and explains why we're using a simpler specification, creating a clearer logical connection to the preceding analysis.

Current text:

### Simulating a multiplicative martingale again

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

In particular, we want to simulate 5000 sample paths of length $T$ for the case in which $x$ is a scalar and $[A, B, D, F] = [0.8, 0.001, 1.0, 0.01]$ and $\nu = 0.005$.

After accomplishing this, we want to display and study histograms of $\tilde{M}_T^i$ for various values of  $T$.

Suggested fix:

### Simulating a multiplicative martingale again

To further investigate the distributional properties of the multiplicative martingale, we now simulate the likelihood ratio process $\{ \tilde{M}_t \}_{t=0}^\infty$ with a simpler specification.

In particular, we want to simulate 5000 sample paths of length $T$ for the case in which $x$ is a scalar and $[A, B, D, F] = [0.8, 0.001, 1.0, 0.01]$ and $\nu = 0.005$. This simplified scalar case makes the distributional analysis more transparent.

After accomplishing this, we want to display and study histograms of $\tilde{M}_T^i$ for various values of  $T$.

Explanation: Adds motivation for the new simulation and explains why we're using a simpler specification, creating a clearer logical connection to the preceding analysis.


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

Location: Section "Overview" (Lines 28-60)

Severity: warning

Description: The overview describes two classes of time series models and four component decompositions without visual aids. A diagram showing the relationship between additive and multiplicative functionals would enhance comprehension.

  • Current text:
They are:

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

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.

In this lecture, we describe both  additive functionals and multiplicative functionals.

We also describe and compute decompositions of additive and multiplicative processes into four components:

1. a **constant**
1. a **trend** component
1. an asymptotically **stationary** component
1. a **martingale**
  • Suggested fix:
They are:

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

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.

```{admonition} Key Concept
:class: important
The exponential transformation connects additive and multiplicative functionals: if $\{y_t\}$ is additive, then $\{\exp(y_t)\}$ is multiplicative.

In this lecture, we describe both additive functionals and multiplicative functionals.

We also describe and compute decompositions of additive and multiplicative processes into four components:

  1. a constant
  2. a trend component
  3. an asymptotically stationary component
  4. a martingale
- **Explanation:** Adding an admonition box emphasizes the key relationship between the two types of functionals, making this crucial concept more visible to readers.

**Current text:**
```markdown
They are:

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

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.

In this lecture, we describe both  additive functionals and multiplicative functionals.

We also describe and compute decompositions of additive and multiplicative processes into four components:

1. a **constant**
1. a **trend** component
1. an asymptotically **stationary** component
1. a **martingale**

Suggested fix:

They are:

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

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: Adding an admonition box emphasizes the key relationship between the two types of functionals, making this crucial concept more visible to readers.


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

Location: Section "A particular additive functional" (Lines 90-120)

Severity: warning

Description: The VAR system and its components are described mathematically but would benefit from a diagram showing the flow of information through the system.

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

```{math}
:label: old1_additive_functionals

x_{t+1} = A x_t + B z_{t+1}

Here

  • $x_t$ is an $n \times 1$ vector,
  • $A$ is an $n \times n$ stable matrix (all eigenvalues lie within the open unit circle),
  • $z_{t+1} \sim {\cal N}(0,I)$ is an $m \times 1$ IID shock,
  • $B$ is an $n \times m$ matrix, and
  • $x_0 \sim {\cal N}(\mu_0, \Sigma_0)$ is a random initial condition for $x$

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:**
```markdown
We construct our additive functional from two pieces, the first of which is a **first-order vector autoregression** (VAR)

```{math}
:label: old1_additive_functionals

x_{t+1} = A x_t + B z_{t+1}
:class: note
The VAR system has the following components:
* **State vector** $x_t$: an $n \times 1$ vector
* **Transition matrix** $A$: an $n \times n$ stable matrix (all eigenvalues lie within the open unit circle)
* **Shock vector** $z_{t+1} \sim {\cal N}(0,I)$: an $m \times 1$ IID shock
* **Shock loading matrix** $B$: an $n \times m$ matrix
* **Initial condition** $x_0 \sim {\cal N}(\mu_0, \Sigma_0)$: a random initial condition for $x$

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:** Using an admonition box to organize the system components makes the technical specifications more visually organized and easier to reference.

**Current text:**
```markdown
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: Using an admonition box to organize the system components makes the technical specifications more visually organized and easier to reference.


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

Location: Section "Decomposition" (Lines 500-540)

Severity: warning

Description: The Hansen-Sargent decomposition is central to the lecture but is only presented mathematically. A visual representation showing how the four components combine would greatly aid understanding.

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

- a constant inherited from initial values $x_0$ and $y_0$
- a linear trend
- 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:
Hansen and Sargent {cite}`Hans_Sarg_book` describe how to construct a decomposition of
an additive functional into four parts:

- a constant inherited from initial values $x_0$ and $y_0$
- a linear trend
- a martingale
- an (asymptotically) stationary component

```{admonition} Decomposition Overview
:class: important
The Hansen-Sargent decomposition separates $y_t$ into:
1. **Initial conditions**: $g x_0 + y_0$ (constant)
2. **Trend**: $t \nu$ (deterministic linear growth)
3. **Martingale**: $\sum_{j=1}^t H z_j$ (unpredictable persistent component)
4. **Stationary**: $-g x_t$ (mean-reverting transitory 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 admonition box provides a clear visual summary of what each component represents economically, making the mathematical decomposition more interpretable.

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

- a constant inherited from initial values $x_0$ and $y_0$
- a linear trend
- 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:

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

- a constant inherited from initial values $x_0$ and $y_0$
- a linear trend
- a martingale
- an (asymptotically) stationary component

Explanation: The admonition box provides a clear visual summary of what each component represents economically, making the mathematical decomposition more interpretable.


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

Location: Section "Associated multiplicative functional" (Lines 670-700)

Severity: warning

Description: The multiplicative decomposition formula and its relationship to the additive decomposition would benefit from visual emphasis and clearer presentation.

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

As mentioned above, the process $\{M_t\}$ is called a **multiplicative functional**.

Corresponding to the additive decomposition described above we have a multiplicative decomposition of $M_t$

$$
\frac{M_t}{M_0}
= \exp (t \nu) \exp \Bigl(\sum_{j=1}^t H \cdot Z_j \Bigr) \exp \biggl( D(I-A)^{-1} x_0 - D(I-A)^{-1} x_t \biggr)
$$

or

$$
\frac{M_t}{M_0} =  \exp\left( \tilde \nu t \right) \Biggl( \frac{\widetilde M_t}{\widetilde M_0}\Biggr) \left( \frac{\tilde e (X_0)} {\tilde e(x_t)} \right)
$$
  • Suggested fix:
Where $\{y_t\}$ is our additive functional, let $M_t = \exp(y_t)$.

As mentioned above, the process $\{M_t\}$ is called a **multiplicative functional**.

```{admonition} From Additive to Multiplicative
:class: tip
The exponential transformation converts the additive decomposition into a multiplicative decomposition:
* Additive trend $t\nu$ becomes exponential trend $\exp(t\nu)$
* Additive martingale becomes multiplicative martingale
* Additive stationary component becomes multiplicative stationary component

Corresponding to the additive decomposition described above we have a multiplicative decomposition of $M_t$

$$
\frac{M_t}{M_0}
= \exp (t \nu) \exp \Bigl(\sum_{j=1}^t H \cdot Z_j \Bigr) \exp \biggl( D(I-A)^{-1} x_0 - D(I-A)^{-1} x_t \biggr)
$$

or

$$
\frac{M_t}{M_0} = \exp\left( \tilde \nu t \right) \Biggl( \frac{\widetilde M_t}{\widetilde M_0}\Biggr) \left( \frac{\tilde e (X_0)} {\tilde e(x_t)} \right)
$$

- **Explanation:** The admonition highlights the parallel structure between additive and multiplicative decompositions, making the transformation more conceptually clear.

**Current text:**
```markdown
Where $\{y_t\}$ is our additive functional, let $M_t = \exp(y_t)$.

As mentioned above, the process $\{M_t\}$ is called a **multiplicative functional**.

Corresponding to the additive decomposition described above we have a multiplicative decomposition of $M_t$

$$
\frac{M_t}{M_0}
= \exp (t \nu) \exp \Bigl(\sum_{j=1}^t H \cdot Z_j \Bigr) \exp \biggl( D(I-A)^{-1} x_0 - D(I-A)^{-1} x_t \biggr)
$$

or

$$
\frac{M_t}{M_0} =  \exp\left( \tilde \nu t \right) \Biggl( \frac{\widetilde M_t}{\widetilde M_0}\Biggr) \left( \frac{\tilde e (X_0)} {\tilde e(x_t)} \right)
$$

Suggested fix:

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

As mentioned above, the process $\{M_t\}$ is called a **multiplicative functional**.

Explanation: The admonition highlights the parallel structure between additive and multiplicative decompositions, making the transformation more conceptually clear.


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

Location: Section "Peculiar large sample property" (Lines 720-740)

Severity: warning

Description: The counterintuitive properties of the martingale component deserve visual emphasis to highlight their surprising nature.

  • Current text:
The martingale component $\widetilde M_t$ exhibits a surprising asymptotic behavior that distinguishes it from typical martingales.

Hansen and Sargent {cite}`Hans_Sarg_book` (ch. 8) describe the following two seemingly contradictory 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`.
  • Suggested fix:
The martingale component $\widetilde M_t$ exhibits a surprising asymptotic behavior that distinguishes it from typical martingales.

```{admonition} Peculiar Property of the Multiplicative Martingale
:class: warning
Hansen and Sargent {cite}`Hans_Sarg_book` (ch. 8) describe the following two **seemingly contradictory** properties of the martingale component $\widetilde M_t$:

1. $E_0 \widetilde M_t = 1$ for all $t \geq 0$ (mean always equals one)
2. As $t \rightarrow +\infty$, $\widetilde M_t$ converges to zero almost surely

This apparent paradox is resolved by the fact that while most probability mass collapses toward zero, a long right tail maintains the unit expectation.

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:** Using a warning-style admonition emphasizes the counterintuitive nature of this result and provides a brief resolution of the apparent paradox, making the concept more memorable and understandable.

**Current text:**
```markdown
The martingale component $\widetilde M_t$ exhibits a surprising asymptotic behavior that distinguishes it from typical martingales.

Hansen and Sargent {cite}`Hans_Sarg_book` (ch. 8) describe the following two seemingly contradictory 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`.

Suggested fix:

The martingale component $\widetilde M_t$ exhibits a surprising asymptotic behavior that distinguishes it from typical martingales.

Explanation: Using a warning-style admonition emphasizes the counterintuitive nature of this result and provides a brief resolution of the apparent paradox, making the concept more memorable and understandable.


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

Location: Section "More about the multiplicative martingale" (Lines 780-810)

Severity: warning

Description: The log-normal distribution representation is technical and would benefit from a highlighted summary box.

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

As we have seen, it has representation

$$
\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
$$

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

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.
  • Suggested fix:
Let's drill down and study probability distribution of the multiplicative martingale $\{\widetilde M_t\}_{t=0}^\infty$ in more detail.

As we have seen, it has representation

$$
\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
$$

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

```{admonition} Distribution of the Multiplicative Martingale
:class: note
The logarithm of the multiplicative martingale follows a normal distribution:
$$\log {\widetilde M}_t \sim {\mathcal N} \left( -\frac{t H \cdot H}{2}, t H \cdot H \right)$$

Therefore, ${\widetilde M}_t$ itself is **log-normally distributed** with mean 1 and variance that grows with $t$.
- **Explanation:** Highlighting the distributional result in an admonition makes this key technical fact more prominent and easier to reference later.

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

As we have seen, it has representation

$$
\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
$$

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

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.

Suggested fix:

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

As we have seen, it has representation

$$
\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
$$

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

Explanation: Highlighting the distributional result in an admonition makes this key technical fact more prominent and easier to reference later.


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

Location: Section "Sample paths" note box (Lines 830-840)

Severity: info

Description: The technical note about scipy.stats.lognorm is already in a note box, which is good practice. However, the explanation could be enhanced.

  • Current text:
```{note}
`scipy.stats.lognorm` expects you to pass the standard deviation
first $(tH \cdot H)$ and then the exponent of the mean as a
keyword argument `scale` (`scale=np.exp(-t * H2 / 2)`).

* See the documentation [here](https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.lognorm.html#scipy.stats.lognorm).

This is peculiar, so make sure you are careful in working with the log normal distribution.
- **Suggested fix:**
```markdown
```{note}

**Current text:**
```markdown
```{note}
`scipy.stats.lognorm` expects you to pass the standard deviation
first $(tH \cdot H)$ and then the exponent of the mean as a
keyword argument `scale` (`scale=np.exp(-t * H2 / 2)`).

* See the documentation [here](https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.lognorm.html#scipy.stats.lognorm).

This is peculiar, so make sure you are careful in working with the log normal distribution.

Suggested fix:

```{note}
**Important**: `scipy.stats.lognorm` has a non-standard parameterization:
1. First argument: standard deviation $(tH \cdot H)$
2. Keyword argument `scale`: exponent of the mean (`scale=np.exp(-t * H2 / 2)`)

See the documentation [here](https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.lognorm.html#scipy.stats.lognorm).

⚠️ This parameterization is counterintuitive—be careful when working with the log-normal distribution in scipy.

Explanation: Adding formatting and a warning symbol makes the cautionary note more visually prominent, reducing the chance readers will miss this important technical detail.


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

Location: End of lecture, after density plots (Lines 960-980)

Severity: warning

Description: The concluding interpretation of the probability density evolution would benefit from a highlighted summary box.

  • Current text:
These probability density functions help us understand mechanics underlying the  **peculiar property** of our multiplicative martingale

* As $T$ grows, most of the probability mass shifts leftward toward zero.
* For example, note that most  mass is near $1$ for $T =10$ or $T = 100$ but
  most of it is near $0$ for $T = 5000$.
* As $T$ grows, the tail of the density of $\widetilde M_T$ lengthens toward the right.
* Enough mass moves toward the right tail to keep $E \widetilde M_T = 1$
  even as most mass in the distribution of $\widetilde M_T$ collapses around $0$.
  • Suggested fix:
```{admonition} Key Insight: Understanding the Peculiar Property
:class: important
These probability density functions reveal the mechanics underlying the **peculiar property**:

* **Left shift**: As $T$ grows, most probability mass shifts leftward toward zero (mass near 1 for $T=10$ or $T=100$, but near 0 for $T=5000$)
* **Right tail lengthening**: Simultaneously, the right tail of $\widetilde M_T$ extends further
* **Mean preservation**: Enough mass moves to the right tail to maintain $E \widetilde M_T = 1$ even as most of the distribution collapses around 0

This is how the seemingly contradictory properties coexist: the median approaches zero while the mean remains at unity.
- **Explanation:** Wrapping this crucial interpretation in an admonition box with a descriptive title makes the key insight more prominent and provides closure to the discussion of the peculiar property introduced earlier in the lecture.

**Current text:**
```markdown
These probability density functions help us understand mechanics underlying the  **peculiar property** of our multiplicative martingale

* As $T$ grows, most of the probability mass shifts leftward toward zero.
* For example, note that most  mass is near $1$ for $T =10$ or $T = 100$ but
  most of it is near $0$ for $T = 5000$.
* As $T$ grows, the tail of the density of $\widetilde M_T$ lengthens toward the right.
* Enough mass moves toward the right tail to keep $E \widetilde M_T = 1$
  even as most mass in the distribution of $\widetilde M_T$ collapses around $0$.

Suggested fix:

```{admonition} Key Insight: Understanding the Peculiar Property
:class: important
These probability density functions reveal the mechanics underlying the **peculiar property**:

* **Left shift**: As $T$ grows, most probability mass shifts leftward toward zero (mass near 1 for $T=10$ or $T=100$, but near 0 for $T=5000$)
* **Right tail lengthening**: Simultaneously, the right tail of $\widetilde M_T$ extends further
* **Mean preservation**: Enough mass moves to the right tail to maintain $E \widetilde M_T = 1$ even as most of the distribution collapses around 0

This is how the seemingly contradictory properties coexist: the median approaches zero while the mean remains at unity.

Explanation: Wrapping this crucial interpretation in an admonition box with a descriptive title makes the key insight more prominent and provides closure to the discussion of the peculiar property introduced earlier in the lecture.


@netlify
Copy link

netlify bot commented Oct 10, 2025

Deploy Preview for lustrous-melomakarona-3ee73e ready!

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