lake_model_intro, time_series_with_matrices, long_run_growth: four small fixes

Open Beginner friendly
#862 1 comment 0 reactions 0 assignees View on GitHub

@nishantmishraa is already working on this.

Since Nov 6, 2026.

  • #863 by @nishantmishraa — open

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
78/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
jupyter-notebook, matplotlib, numpy, python

Research direction

Read the three named lecture files at the referenced cells and lines: lake_model_intro.md, time_series_with_matrices.md, and long_run_growth.md. Check the stated parameter, plotting loop, sample construction, and country color mapping, then make the listed corrections. Done when T affects simulated paths, the plot mean and colors are computed as described, the dead guard is handled, and the notation reads e_0; leave the confirmed r(A) equation unchanged.

Written by the indexing model from the issue text.

Description

Four small things found while these lectures were reviewed on their way into the shared lecture pool (QuantEcon/lectures#42). None is urgent. Line numbers are at 530ede2.

  • lectures/lake_model_intro.md, line 96: $(u_0, e_o)$ should read $(u_0, e_0)$.
  • lectures/lake_model_intro.md, plot_time_paths (line 291): the T parameter is never used, because the loop calls lm.simulate_path(x0=x) without it (line 338), so plot_time_paths(lm, T=...) changes nothing. The closing if ax is None: plt.show() (lines 359–360) never runs either, because ax was already replaced by new axes when it was None (lines 314–315). The figure still appears in a notebook, so only the guard is dead.
  • lectures/time_series_with_matrices.md, the # Plot mean cell (line 467): each pass of for i in range(N) draws a fresh sample of N paths with series_process.sample_y(N, rng=rng) (line 472) and plots only its i-th row, so plotting 100 paths simulates 10,000, and μ_y is replotted on every pass. Drawing one sample before the loop and plotting the mean once gives the same picture. Separately, sample_y (line 437) could build ys as (b + us) @ A_inv.T rather than stacking one product per row.
  • lectures/long_run_growth.md, the color_mapping cell (line 144): country_names = data['countrycode'] holds one entry per row of the data, not per country, so cm.tab20(np.linspace(0, 0.95, len(country_names))) (line 147) spaces the colours over every row, and the dictionary keeps the colour of each code's last row. The colours then depend on how many rows each country has. data['countrycode'].unique() gives one evenly spaced colour per country.

The same review also questioned r(A) = 1 + g at lake_model_intro.md line 272, but that is exact as written: every column of A sums to 1 + g.

When these land here, the pool picks them up through its nightly refresh.

Dominant language
Jupyter Notebook
Stars
67
Forks
33
Avg merge
6h 22m
Merged PRs (30d)
3

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from QuantEcon/lecture-python-intro

All issues in QuantEcon/lecture-python-intro

Similar issues

More Data Visualization issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.