Skip to content

Conversation

@jstac
Copy link
Contributor

@jstac jstac commented Feb 17, 2023

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
Copy link

netlify bot commented Feb 17, 2023

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
Copy link
Contributor Author

jstac commented Feb 17, 2023

@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
Copy link
Contributor

mmcky commented Feb 17, 2023

@jstac have these lectures been added to _toc.yml

@@ -0,0 +1,205 @@

Copy link
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
Copy link
Contributor Author

jstac commented Feb 17, 2023

@jstac have these lectures been added to _toc.yml

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


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$.
Copy link
Member

@shlff shlff Feb 17, 2023

Choose a reason for hiding this comment

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

The methodmatrix_power in the python code cell after the sentence above needs to be defined or imported.

Useful resources:

Copy link
Member

@shlff shlff left a comment

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.

\lambda I$ are linearly dependent.
### Complex Values

So far our definition of eigenvalues and eigenvector seems straightforward.
Copy link
Member

Choose a reason for hiding this comment

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

eigenvector -->> eigenvectors


So far our definition of eigenvalues and eigenvector seems straightforward.

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

Choose a reason for hiding this comment

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

metioned -->> mentioned


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
Member

Choose a reason for hiding this comment

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

infite -->> infinite


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

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


2. $A = \begin{bmatrix} 0 & 1 \\ 1 & 0 \end{bmatrix}$ is irreducible since $a_{12},a_{21} >0$ and $a^{2}_{11},a^{2}_{22} >0$.

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

If a matrix $A \geq 0$ then,
1. the dominant eigenvalue of A, r(A), is real-valued and nonnegative.
Copy link
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).

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
Member

Choose a reason for hiding this comment

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

Same (add $$).

r = max(abs(λ) for λ in evals) # compute spectral radius
print(r)
```

Copy link
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.

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
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?


* $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
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
Copy link
Contributor Author

jstac commented Feb 18, 2023

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
Copy link
Contributor Author

jstac commented Feb 18, 2023

@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
Copy link
Contributor

mmcky commented Feb 18, 2023

@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
Copy link
Contributor Author

jstac commented Feb 19, 2023

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
Contributor

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

@shlff
Copy link
Member

shlff commented Feb 19, 2023

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
Copy link
Contributor

mmcky commented Feb 19, 2023

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
Copy link
Contributor

mmcky commented Feb 19, 2023

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
Copy link
Contributor

mmcky commented Feb 19, 2023

@jstac this is now building with generated previews.

@mmcky
Copy link
Contributor

mmcky commented Feb 19, 2023

@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
Copy link
Contributor Author

jstac commented Feb 24, 2023

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

5 participants