Skip to content

Adds the eigenvalues lecture and, separately, the lake lecture - #94

Merged
jstac merged 5 commits into
mainfrom
add-eigen
Feb 24, 2023
Merged

jstac merged 5 commits into
mainfrom
add-eigen

Conversation

@jstac

@jstac jstac commented Feb 17, 2023

Copy link
Copy Markdown
Contributor

Note that, since this lecture is quite long, I pulled out the discussion of the lake model of employment and unemployment and put it in file lake_model.md.

@netlify

netlify Bot commented Feb 17, 2023 •

Copy link
Copy Markdown

✅ Deploy Preview for taupe-gaufre-c4e660 ready!

Name Link
🔨 Latest commit c1a55d4
🔍 Latest deploy log https://app.netlify.com/sites/taupe-gaufre-c4e660/deploys/63f2ac35812bd300086de2f3
😎 Deploy Preview https://deploy-preview-94--taupe-gaufre-c4e660.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 site settings.

@jstac

jstac commented Feb 17, 2023

Copy link
Copy Markdown
Contributor Author

@mmcky , error is "ERROR: Couldn't find cache key for notebook file lectures/eigen.md. Outputs will not be inserted."

Does that mean I need to clear a cache?

@shlff Could you please review the lecture eigen.md?

@mmcky

mmcky commented Feb 17, 2023

Copy link
Copy Markdown
Contributor

@jstac have these lectures been added to _toc.yml

Comment thread lectures/lake_model.md Outdated
@@ -0,0 +1,205 @@

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@jstac looks like this empty line needs to be removed for jupytext to understand the metadata

@jstac

jstac commented Feb 17, 2023

Copy link
Copy Markdown
Contributor Author

@jstac have these lectures been added to _toc.yml

No, sorry, I forgot. All help is appreciated.

Comment thread lectures/eigen.md

Let's first see examples of a sequence of iterates $(A^kx)_{k \geq 0}$ under different maps $A$.
Let's first see examples of a sequence of iterates $(A^k x)_{k \geq 0}$ under
different maps $A$.

@shlff shlff Feb 17, 2023 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@shlff shlff left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for writing such a beautiful lecture @jstac. The idea of using functions grid_transform and circle_transform to visualise the matrix transformation looks pretty cool to me.

Please find my comments above. Feel free to let me know if you like some of them and I can update them in a commit.

Comment thread lectures/eigen.md Outdated
\lambda I$ are linearly dependent.
### Complex Values

So far our definition of eigenvalues and eigenvector seems straightforward.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

eigenvector -->> eigenvectors

Comment thread lectures/eigen.md Outdated

So far our definition of eigenvalues and eigenvector seems straightforward.

There is, however, one complication we haven't metioned yet:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

metioned -->> mentioned

Comment thread lectures/eigen.md Outdated

Although we truncate the infite sum at $k = 50$,
both methods give us the same result which illustrates the result of the Neumann Series lemma.
Although we truncate the infite sum at $k = 50$, both methods give us the same

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

infite -->> infinite

Comment thread lectures/eigen.md Outdated

Consider the following equation where we multiply a $n \times m$ matrix $A$ with a $m \times 1$
column vector $x$ to obtain a $n \times 1$ column vector $y$.
To understand the second point of view, suppose we multiply a $n \times m$

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

a $n \times m$ -->> an $n \times m$

Comment thread lectures/eigen.md Outdated
Consider the following equation where we multiply a $n \times m$ matrix $A$ with a $m \times 1$
column vector $x$ to obtain a $n \times 1$ column vector $y$.
To understand the second point of view, suppose we multiply a $n \times m$
matrix $A$ with a $m \times 1$ column vector $x$ to obtain a $n \times 1$

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

a $n \times 1$ -->> an $n \times 1$

Comment thread lectures/eigen.md
@@ -751,247 +879,51 @@ Here are some examples to illustrate this further.
3. $A = \begin{bmatrix} 1 & 0 \\ 0 & 1 \end{bmatrix}$ is reducible since $A^k = A$ for all $k \geq 0$ and thus

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Here $A$ is not reducible since it is an identity matrix.

Comment thread lectures/eigen.md Outdated

If a matrix $A \geq 0$ then,

1. the dominant eigenvalue of A, r(A), is real-valued and nonnegative.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should add $$ to A and r(A).

Comment thread lectures/eigen.md Outdated
2. for any other eigenvalue (possibly complex) $\lambda$ of $A$, $|\lambda| \leq r(A)$.
3. we can find a nonnegative and nonzero eigenvector $v$ such that $Av = r(A)v$.

Moreover if A is also irreducible then,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Same (add $$).

Comment thread lectures/eigen.md
r = max(abs(λ) for λ in evals) # compute spectral radius
print(r)
```

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

$(I-A)^{1}$ should be $(I-A)^{-1}$ in line 999.

Comment thread lectures/eigen.md Outdated
and 4 units is the external demand by consumers.
The first row depicts how agriculture's total output $x_1$ is distributed

* $30\%$ is used as inputs within agriculture itself,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should it be $0.3 x_1$ to be consistent with the following notations?

Comment thread lectures/eigen.md Outdated

* $30\%$ is used as inputs within agriculture itself,
* $0.2x_2$ is used as inputs by the industry sector to produce $x_2$ units
* $0.2x_3$ is used as inputs by the service sector to produce $x_3$ units and

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The $0.2x_3$ in line 1052 should be $0.3x_3$.

@jstac

jstac commented Feb 18, 2023

Copy link
Copy Markdown
Contributor Author

Thanks for writing such a beautiful lecture @jstac.

Thanks for your review @shlff . Actually this is all due to @maanasee .

@maanasee , could you please review these comments and then modify accordingly.

I have added eigen to _toc.

@jstac

jstac commented Feb 18, 2023

Copy link
Copy Markdown
Contributor Author

@mmcky I've added eigen to toc but the build is still failing with a cache error. Can you please tell me what I'm doing wrong?

@mmcky

mmcky commented Feb 18, 2023 •

Copy link
Copy Markdown
Contributor

@jstac looking at the build the warnings indicate that eigen.md is not executing due to

NameError: name 'matrix_power' is not defined

Does this run locally for you?

I will write up a note on the quantecon manual to show how you can get the execution reports that are uploaded to each GitHub action run (on failure).

Also should lake_model.md be a part of this PR -- it has a range of reported issues:

  1. not included in _toc.yml
  2. it has inconsistent heading levels

I should be able to dive in and take a closer look later today.

@jstac

jstac commented Feb 19, 2023

Copy link
Copy Markdown
Contributor Author

Thanks @mmcky .

@maanasee Please address the issues above when you have time.

The lake model lecture should be in a separate PR. Could someone please help with this and fix the inconsistent headings?

@maanasee

Copy link
Copy Markdown
Contributor

Thanks @jstac I'll take a look at the issues right now.

@shlff

shlff commented Feb 19, 2023

Copy link
Copy Markdown
Member

Thanks for writing such a beautiful lecture @jstac.

Thanks for your review @shlff . Actually this is all due to @maanasee .

@maanasee , could you please review these comments and then modify accordingly.

I have added eigen to _toc.

Thanks @jstac . Excellent work @maanasee .

@mmcky

mmcky commented Feb 19, 2023

Copy link
Copy Markdown
Contributor

The lake model lecture should be in a separate PR. Could someone please help with this and fix the inconsistent headings?

@jstac the lake model lecture has been removed and I have setup a new PR #99

@mmcky

mmcky commented Feb 19, 2023

Copy link
Copy Markdown
Contributor

BTW -- I have set the CI to require no warnings at all from sphinx which is I think the correct setting. The current issues are:

/home/runner/work/lecture-python-intro/lecture-python-intro/lectures/eigen.md:690: WARNING: Duplicate explicit target name: "la_eigen".
/home/runner/work/lecture-python-intro/lecture-python-intro/lectures/lln_clt.md: WARNING: duplicate theorem label 'theorem-0', other instance in /home/runner/work/lecture-python-intro/lecture-python-intro/lectures/eigen.md

I will fix those warnings now

@github-actions
github-actions Bot temporarily deployed to commit February 19, 2023 23:13 Inactive
@mmcky

mmcky commented Feb 19, 2023

Copy link
Copy Markdown
Contributor

@jstac this is now building with generated previews.

@mmcky

mmcky commented Feb 19, 2023

Copy link
Copy Markdown
Contributor

@maanasee this lecture looks really nice -- thank you.

I was wondering if this python package might be of interest (as a side project some time)

https://www.manim.community

Could be fun to put together some math animations / transforms etc.

@jstac

jstac commented Feb 24, 2023

Copy link
Copy Markdown
Contributor Author

I'm going to go ahead and merge this. Then we'll iterate.

@jstac
jstac merged commit 7d86a89 into main Feb 24, 2023
@jstac
jstac deleted the add-eigen branch March 12, 2023 18:43

This branch was previously deployed

1 inactive deployment
commit — c1a55d41 Deployed Feb 19, 2023 by github-actions[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants