Skip to content

Commit

Permalink
regression
Browse files Browse the repository at this point in the history
  • Loading branch information
doctor-phil committed Oct 30, 2023
1 parent ca0d7e9 commit a743297
Show file tree
Hide file tree
Showing 44 changed files with 5,628 additions and 1,619 deletions.
556 changes: 1 addition & 555 deletions lectures/lectures/causal_graphical_models.html

Large diffs are not rendered by default.

946 changes: 41 additions & 905 deletions lectures/lectures/causal_graphical_models.ipynb

Large diffs are not rendered by default.

Binary file modified lectures/lectures/causal_graphical_models.pdf
Binary file not shown.
Binary file added lectures/lectures/data/fig/flowchart.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 17 additions & 17 deletions lectures/lectures/dynamics.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
" - [Dynamics and Stability in One\n",
" Dimension](https://intro.quantecon.org/scalar_dynam.html)"
],
"id": "d2174d20-5fa3-4c13-b60a-bba0a25e38fa"
"id": "548020bd-5f97-4fc2-9577-fe39f1bfe7b0"
},
{
"cell_type": "code",
Expand Down Expand Up @@ -77,7 +77,7 @@
" - If there is an $(\\lambda, x)$ pair with $\\lambda = 1$ it is a\n",
" fixed point"
],
"id": "77f01c2e-9eb8-46f5-9686-2bf56def69dc"
"id": "1d6aba78-711f-4017-9920-ba08030e931e"
},
{
"cell_type": "code",
Expand Down Expand Up @@ -118,7 +118,7 @@
"\n",
"- Consider $f(x) = \\sqrt{x}$ and $f(x) = x^2$ for $x \\geq 0$"
],
"id": "52186f7f-bb9f-46c6-a310-e7cb7b1ff008"
"id": "c1215c45-66b5-4b2d-bf9c-706c717bc53f"
},
{
"cell_type": "code",
Expand Down Expand Up @@ -163,7 +163,7 @@
"See [QuantEcon Scalar\n",
"dynamics](https://intro.quantecon.org/scalar_dynam.html) for base code"
],
"id": "366f67fc-e87d-480d-aba4-1bd5c52ec2dc"
"id": "29b22096-dade-418b-ae40-bbca38c4b265"
},
{
"cell_type": "code",
Expand Down Expand Up @@ -244,7 +244,7 @@
"source": [
"## Evaluating the $\\sqrt{x}$ near $x=0.05 > 0$"
],
"id": "4fa89b35-5a4a-4be5-9d07-5a2fc5228c79"
"id": "a9f62c10-6fdb-4e92-9974-5e54d09c33f6"
},
{
"cell_type": "code",
Expand All @@ -270,7 +270,7 @@
"source": [
"## Evaluating the $\\sqrt{x}$ near $x=1.1 > 1$"
],
"id": "4442fb15-8577-4dcf-a46b-77d7fbbc951e"
"id": "5d9de567-80f7-449a-bbfe-5c0beacf8874"
},
{
"cell_type": "code",
Expand All @@ -296,7 +296,7 @@
"source": [
"## Evaluating the $x^2$ for $x = 0.6 < 1$"
],
"id": "f705bde5-ce2d-4c0a-8a11-16cfa2f4d01b"
"id": "009ce980-cef4-41f8-9351-d968c65b46bc"
},
{
"cell_type": "code",
Expand All @@ -322,7 +322,7 @@
"source": [
"## Evaluating the $x^2$ for $x = 1.01 > 1$"
],
"id": "94e6852d-65d2-4588-b197-1c5914a2bfca"
"id": "d33be7ac-10c4-4179-9114-8e6f9b9b1676"
},
{
"cell_type": "code",
Expand Down Expand Up @@ -426,7 +426,7 @@
"\n",
"## Plot Against 45 degree line Reminder"
],
"id": "98e97a60-d386-495f-a49e-799647cc2823"
"id": "8ea00fa0-314d-47f5-9b38-a47fb3ccdf26"
},
{
"cell_type": "code",
Expand Down Expand Up @@ -512,7 +512,7 @@
"\n",
"## Implementing the Solow-Swan Model"
],
"id": "32f06caa-ebac-4cc2-beac-417efda30aa4"
"id": "dc266f9a-b0ee-4a05-9a21-88029aea1083"
},
{
"cell_type": "code",
Expand Down Expand Up @@ -552,7 +552,7 @@
"source": [
"## Plotting $k_t$ vs. $k_{t+1}$ verifies our $k^*$"
],
"id": "488314dd-f408-45bc-8e24-3dc9f328bb92"
"id": "8d2719c8-fe0b-4fe6-9bad-21a57ea64087"
},
{
"cell_type": "code",
Expand Down Expand Up @@ -604,7 +604,7 @@
"\n",
"## Simulation"
],
"id": "b55d44ff-165b-4945-9498-9839ec135cfc"
"id": "b91ff75e-1f8e-4fac-bf56-30e959ef2a5e"
},
{
"cell_type": "code",
Expand Down Expand Up @@ -642,7 +642,7 @@
"source": [
"## Capital Transition from $k_0 < k^*$ and $k_0 > k^*$"
],
"id": "1513f5d8-e410-4ccd-90e4-cbae9cfdd995"
"id": "edb0cfae-12ce-478c-a2ef-54d65a9529a6"
},
{
"cell_type": "code",
Expand Down Expand Up @@ -681,7 +681,7 @@
"source": [
"## Trajectories Using the 45 degree Line"
],
"id": "6e954e23-76d5-4e84-8099-d1c2cc1e29d9"
"id": "39214517-4e51-4093-b534-7e9dcedbc462"
},
{
"cell_type": "code",
Expand Down Expand Up @@ -796,7 +796,7 @@
"\n",
"- Consider $A, B, C, D$ as a set of web pages with links given below"
],
"id": "2b2bbb26-23fe-420a-ac7a-572eebd81e56"
"id": "3b94920a-cef4-4a72-9b1c-c47684b76ebc"
},
{
"cell_type": "code",
Expand All @@ -814,7 +814,7 @@
}
],
"source": [],
"id": "d8107b32-db7f-496a-b307-32992f550979"
"id": "54d342b2-9af3-44e8-866d-c8bda72540fa"
},
{
"cell_type": "markdown",
Expand Down Expand Up @@ -891,7 +891,7 @@
" actually compute the eigenvector of a huge matrix with a\n",
" decomposition."
],
"id": "c3e7d652-2f4e-4efe-bf87-6dafaae8090c"
"id": "20e1de5f-8d85-4e05-801e-2badedfdb703"
}
],
"nbformat": 4,
Expand Down
Binary file modified lectures/lectures/dynamics.pdf
Binary file not shown.
34 changes: 17 additions & 17 deletions lectures/lectures/eigenvalue_applications.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
" - [A First Course in Quantitative Economics with\n",
" Python](https://intro.quantecon.org/)"
],
"id": "ba49fd8b-8e8f-4843-bf9d-256f86f8dee3"
"id": "8bb7c23f-dc25-4c2d-ac69-f01e853f3264"
},
{
"cell_type": "code",
Expand Down Expand Up @@ -69,7 +69,7 @@
"\\end{bmatrix}\n",
"$$"
],
"id": "b1b756b3-cd59-49c4-942b-99cf9534a391"
"id": "ce62f0d0-b6a2-4ee2-bfe6-c027ccccb505"
},
{
"cell_type": "code",
Expand Down Expand Up @@ -102,7 +102,7 @@
"\n",
"Iterate $x_{t+1} = A x_t$ from $x_0$ for $t=100$"
],
"id": "8bf49357-d5d8-48f8-8695-13bbc3e4ef63"
"id": "d5c07f6e-6591-437e-9207-30739bb1bb34"
},
{
"cell_type": "code",
Expand Down Expand Up @@ -142,7 +142,7 @@
"\n",
"## Iterating with $\\rho(A) < 1$"
],
"id": "1841e75f-3d84-43d6-83ba-3fae3ed3191f"
"id": "560b199d-567a-4acf-ac87-93f64b6841e5"
},
{
"cell_type": "code",
Expand Down Expand Up @@ -181,7 +181,7 @@
"- Leave previous eigenvectors in $Q$, change $\\Lambda$ to force\n",
" $\\rho(A)$ directly"
],
"id": "ce0aed03-6ce0-4732-af39-aa7f94604b96"
"id": "86cad15a-7bc6-4a4d-bbb2-3f3ae6b67897"
},
{
"cell_type": "code",
Expand Down Expand Up @@ -240,7 +240,7 @@
"\n",
"Simulate by iterating $X_{t+1} = A X_t$ from $X_0$ until $T=100$"
],
"id": "cbaf2397-94dc-4d16-a8c5-8101f15f4f8b"
"id": "5bbc55a4-b08d-448c-b386-bc2aa7d51bbd"
},
{
"cell_type": "code",
Expand Down Expand Up @@ -276,7 +276,7 @@
"source": [
"## Dynamics of Unemployment"
],
"id": "5c35ba84-aae1-482f-92e9-3c9978bb8c81"
"id": "e202d6e2-8a26-410c-abaa-d68edcbbba60"
},
{
"cell_type": "code",
Expand Down Expand Up @@ -334,7 +334,7 @@
"\n",
"## Using the First Eigenvector for the Steady State"
],
"id": "48017896-375e-434b-85a4-6162af7351e0"
"id": "9637cd3b-b616-40fd-a5aa-9b7c818a35b6"
},
{
"cell_type": "code",
Expand Down Expand Up @@ -392,7 +392,7 @@
"\n",
"## Simulating with Different Eigenvalues"
],
"id": "aaed0c0b-b28b-4088-b847-00f5b857c041"
"id": "029a14b1-2bc8-4200-beec-915223906b4e"
},
{
"cell_type": "code",
Expand Down Expand Up @@ -428,7 +428,7 @@
"source": [
"## Convergence Dynamics of Unemployment"
],
"id": "26415618-b729-45a5-8f4d-bd10256edc74"
"id": "509f3bc0-901b-4142-b29f-4b652dee5ccf"
},
{
"cell_type": "code",
Expand Down Expand Up @@ -494,7 +494,7 @@
"\n",
"Here is an example with $1 < \\rho(A) < 1/\\beta$. Try with different $A$"
],
"id": "9c12e38a-f963-4a14-ab12-9062e391ccbf"
"id": "0de0c2fa-bae2-4f3f-b4c3-31ba482a78b6"
},
{
"cell_type": "code",
Expand Down Expand Up @@ -535,7 +535,7 @@
" have very different scales - so there will be times when you need to\n",
" rescale your problems"
],
"id": "671a618b-be9b-4193-b382-1076dc20db6d"
"id": "4dca6b8d-16eb-4818-8f5e-5d9944fa83ff"
},
{
"cell_type": "code",
Expand Down Expand Up @@ -583,7 +583,7 @@
" inv](https://www.mathworks.com/help/matlab/ref/inv.html#bu6sfy8-1)\n",
" for example, where `inv` is a bad idea due to poor conditioning"
],
"id": "a6854bc1-a1c2-443b-922d-abb8d97be145"
"id": "dac27a15-3a15-40c7-bd09-890ab34a74af"
},
{
"cell_type": "code",
Expand Down Expand Up @@ -650,7 +650,7 @@
"- Let’s look at the numerical error here from the interpolation using\n",
" the inf-norm, i.e., $||x||_{\\infty} = \\max_n |x_n|$"
],
"id": "2042e90a-be2e-4737-9753-fee073762605"
"id": "48068fc0-f94a-4f9b-bb68-c05ea8f52160"
},
{
"cell_type": "code",
Expand Down Expand Up @@ -685,7 +685,7 @@
"source": [
"## Things Getting Poorly Conditioned Quickly"
],
"id": "be3cef27-5905-4846-b91c-e798ce291cd9"
"id": "d7649e0a-b981-4c14-934b-a0a95f7dd2a7"
},
{
"cell_type": "code",
Expand Down Expand Up @@ -720,7 +720,7 @@
"source": [
"## Matrix Inverses Fail Completely for $N = 20$"
],
"id": "b61d0948-d401-49e3-a1f8-c7ecdeac1875"
"id": "0f30e023-1b1b-4dae-bb8a-1ce3a0e41179"
},
{
"cell_type": "code",
Expand Down Expand Up @@ -773,7 +773,7 @@
" - Prefer polynomials like Chebyshev, which are designed to be as\n",
" orthogonal as possible"
],
"id": "41bc5e0d-f530-4d54-9a67-669cdf9cc25f"
"id": "249e12c3-a2d0-46b6-992d-e620f8367794"
},
{
"cell_type": "code",
Expand Down
Binary file modified lectures/lectures/eigenvalue_applications.pdf
Binary file not shown.
4 changes: 3 additions & 1 deletion lectures/lectures/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,9 @@ <h1>Lectures</h1>
<li><a href="stochastic_processes.html" target="_blank">Stochastic Processes</a>, <a href="stochastic_processes.ipynb" target="_blank">Jupyter</a>, <a href="stochastic_processes.pdf" target="_blank">PDF</a></li>
<li><a href="introduction_to_causality.html" target="_blank">Intro to Causality</a>, <a href="introduction_to_causality.ipynb" target="_blank">Jupyter</a>, <a href="introduction_to_causality.pdf" target="_blank">PDF</a></li>
<li><a href="uncertainty_bias_variance.html" target="_blank">Uncertainty Quantification in Applied Economics</a>, <a href="uncertainty_bias_variance.ipynb" target="_blank">Jupyter</a>, <a href="uncertainty_bias_variance.pdf" target="_blank">PDF</a></li>
<li><a href="causal_graphical_models.html" target="_blank">Causal Graphical Models</a>, <a href="causal_graphical_models.ipynb" target="_blank">Jupyter</a>, <a href="causal_graphical_models.pdf" target="_blank">PDF</a></li>
<li><a href="causal_graphical_models.html" target="_blank">Introduction to Causal Graphical Models</a>, <a href="causal_graphical_models.ipynb" target="_blank">Jupyter</a>, <a href="causal_graphical_models.pdf" target="_blank">PDF</a></li>
<li><a href="../lectures/using_dags.html">Practical Uses of Directed Graphical Models</a>, <a href="using_dags.ipynb" target="_blank">Jupyter</a>, <a href="using_dags.pdf" target="_blank">PDF</a></li>
<li><a href="../lectures/regression.html">Regression</a>, <a href="regression.ipynb" target="_blank">Jupyter</a>, <a href="regression.pdf" target="_blank">PDF</a></li>
</ol>


Expand Down
14 changes: 10 additions & 4 deletions lectures/lectures/index.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,18 @@
" Quantification in Applied Economics</a>,\n",
" <a href=\"uncertainty_bias_variance.ipynb\" target=\"_blank\">Jupyter</a>,\n",
" <a href=\"uncertainty_bias_variance.pdf\" target=\"_blank\">PDF</a>\n",
"9. <a href=\"causal_graphical_models.html\" target=\"_blank\">Causal Graphical\n",
" Models</a>,\n",
"9. <a href=\"causal_graphical_models.html\" target=\"_blank\">Introduction to\n",
" Causal Graphical Models</a>,\n",
" <a href=\"causal_graphical_models.ipynb\" target=\"_blank\">Jupyter</a>,\n",
" <a href=\"causal_graphical_models.pdf\" target=\"_blank\">PDF</a>"
" <a href=\"causal_graphical_models.pdf\" target=\"_blank\">PDF</a>\n",
"10. [Practical Uses of Directed Graphical Models](using_dags.qmd),\n",
" <a href=\"using_dags.ipynb\" target=\"_blank\">Jupyter</a>,\n",
" <a href=\"using_dags.pdf\" target=\"_blank\">PDF</a>\n",
"11. [Regression](regression.qmd),\n",
" <a href=\"regression.ipynb\" target=\"_blank\">Jupyter</a>,\n",
" <a href=\"regression.pdf\" target=\"_blank\">PDF</a>"
],
"id": "c8fb9f03-d538-4c5b-8373-e7cf536a23ae"
"id": "c7855167-81d7-4423-ad3e-575257df4c67"
}
],
"nbformat": 4,
Expand Down
Loading

0 comments on commit a743297

Please sign in to comment.