Skip to content

Commit

Permalink
uq lecture
Browse files Browse the repository at this point in the history
  • Loading branch information
doctor-phil committed Oct 16, 2023
1 parent 7d4642f commit 60c09f0
Show file tree
Hide file tree
Showing 55 changed files with 1,921 additions and 46 deletions.
Binary file added lectures/lectures/data/fig/bias_good.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lectures/lectures/data/fig/bias_variance.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion lectures/lectures/dynamics.html
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ <h2>Fixed Points for Linear Functions</h2>
<span id="cb2-2"><a href="#cb2-2"></a>eigvals, eigvecs <span class="op">=</span> eig(A)</span>
<span id="cb2-3"><a href="#cb2-3"></a><span class="bu">print</span>(<span class="ss">f"lambda_1=</span><span class="sc">{</span>eigvals[<span class="dv">0</span>]<span class="sc">}</span><span class="ss">, ||x* - A x*||=</span><span class="sc">{</span>norm(A <span class="op">@</span> eigvecs[:,<span class="dv">0</span>] <span class="op">-</span> eigvecs[:,<span class="dv">0</span>])<span class="sc">}</span><span class="ss">"</span>)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-stdout">
<pre><code>lambda_1=(1+0j), ||x* - A x*||=1.5700924586837752e-16</code></pre>
<pre><code>lambda_1=(1+0j), ||x* - A x*||=1.1102230246251565e-16</code></pre>
</div>
</div>
</section>
Expand Down
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.
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.
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.
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.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 10 additions & 10 deletions lectures/lectures/eigenvalue_applications.html
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ <h2>Iterating with <span class="math inline">\(\rho(A) &gt; 1\)</span></h2>
</div><div class="column">
<div class="cell-output cell-output-stdout">
<pre><code>rho(A) = 1.079128784747792
x_200 = [3406689.32410674 6102361.18640517]</code></pre>
x_200 = [3406689.32410673 6102361.18640516]</code></pre>
</div>
</div>
</div>
Expand Down Expand Up @@ -556,7 +556,7 @@ <h2>Iterating with <span class="math inline">\(\rho(A) = 1\)</span></h2>
<span id="cb8-6"><a href="#cb8-6"></a><span class="bu">print</span>(<span class="ss">f"x_</span><span class="sc">{</span>t<span class="sc">}</span><span class="ss"> = </span><span class="sc">{</span>np<span class="sc">.</span>linalg<span class="sc">.</span>matrix_power(A, t) <span class="op">@</span> x_0<span class="sc">}</span><span class="ss">"</span>)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-stdout">
<pre><code>check orthogonal: dot(x_1,x_2) approx 0: 0.0
rho(A) = 1.0000000000000002
rho(A) = 1.0
x_200 = [ 0.27639321 -0.17082039]</code></pre>
</div>
</div>
Expand Down Expand Up @@ -803,7 +803,7 @@ <h2>Condition Numbers of Matrices</h2>
<span id="cb21-2"><a href="#cb21-2"></a><span class="bu">print</span>(<span class="ss">f"condition(A) = </span><span class="sc">{</span>cond(A)<span class="sc">}</span><span class="ss">, condition(A^(-1)) = </span><span class="sc">{</span>cond(inv(A))<span class="sc">}</span><span class="ss">"</span>)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-stdout">
<pre><code>condition(I) = 1.0
condition(A) = 40000001.939191714, condition(A^(-1)) = 40000002.00307444</code></pre>
condition(A) = 40000001.962777555, condition(A^(-1)) = 40000002.02779216</code></pre>
</div>
</div>
</section>
Expand Down Expand Up @@ -859,8 +859,8 @@ <h2>Solving an Example</h2>
<span id="cb23-8"><a href="#cb23-8"></a><span class="ss">error using inv(A) = </span><span class="sc">{</span>norm(A <span class="op">@</span> c_inv <span class="op">-</span> y, np.inf)<span class="sc">}</span><span class="ss">"</span>)</span>
<span id="cb23-9"><a href="#cb23-9"></a><span class="bu">print</span>(<span class="ss">f"cond(A) = </span><span class="sc">{</span>cond(A)<span class="sc">}</span><span class="ss">"</span>)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-stdout">
<pre><code>error = 5.820766091346741e-11, error using inv(A) = 1.3387762010097504e-09
cond(A) = 564652.3214074654</code></pre>
<pre><code>error = 1.574562702444382e-11, error using inv(A) = 1.1932570487260818e-09
cond(A) = 564652.3214000753</code></pre>
</div>
</div>
</section>
Expand All @@ -877,8 +877,8 @@ <h2>Things Getting Poorly Conditioned Quickly</h2>
<span id="cb25-8"><a href="#cb25-8"></a><span class="ss">error using inv(A) = </span><span class="sc">{</span>norm(A <span class="op">@</span> c_inv <span class="op">-</span> y, np.inf)<span class="sc">}</span><span class="ss">"</span>)</span>
<span id="cb25-9"><a href="#cb25-9"></a><span class="bu">print</span>(<span class="ss">f"cond(A) = </span><span class="sc">{</span>cond(A)<span class="sc">}</span><span class="ss">"</span>)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-stdout">
<pre><code>error = 1.280568540096283e-09, error using inv(A) = 6.463262252509594e-06
cond(A) = 4462817558043.969</code></pre>
<pre><code>error = 5.334186425898224e-10, error using inv(A) = 6.22717197984457e-06
cond(A) = 4462824600234.486</code></pre>
</div>
</div>
</section>
Expand All @@ -895,8 +895,8 @@ <h2>Matrix Inverses Fail Completely for <span class="math inline">\(N = 20\)</sp
<span id="cb27-8"><a href="#cb27-8"></a><span class="ss">error using inv(A) = </span><span class="sc">{</span>norm(A <span class="op">@</span> c_inv <span class="op">-</span> y, np.inf)<span class="sc">}</span><span class="ss">"</span>)</span>
<span id="cb27-9"><a href="#cb27-9"></a><span class="bu">print</span>(<span class="ss">f"cond(A) = </span><span class="sc">{</span>cond(A)<span class="sc">:.4g}</span><span class="ss">"</span>)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-stdout">
<pre><code>error = 5.820766091346741e-10, error using inv(A) = 2460.8631448635133
cond(A) = 5.771e+24</code></pre>
<pre><code>error = 6.784830475226045e-10, error using inv(A) = 31732.823760853855
cond(A) = 1.697e+24</code></pre>
</div>
</div>
</section>
Expand All @@ -917,7 +917,7 @@ <h2>Moral of this Story</h2>
<span id="cb29-4"><a href="#cb29-4"></a>A_monomial <span class="op">=</span> np.array([[x_i<span class="op">**</span>n <span class="cf">for</span> n <span class="kw">in</span> <span class="bu">range</span>(N <span class="op">+</span> <span class="dv">1</span>)] <span class="cf">for</span> x_i <span class="kw">in</span> x]) <span class="co"># or np.vander</span></span>
<span id="cb29-5"><a href="#cb29-5"></a><span class="bu">print</span>(<span class="ss">f"cond(A) = </span><span class="sc">{</span>cond(A)<span class="sc">:.4g}</span><span class="ss">, cond(A_monomial) = </span><span class="sc">{</span>cond(A_monomial)<span class="sc">:.4g}</span><span class="ss">"</span>)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-stdout">
<pre><code>cond(A) = 3.64e+09, cond(A_monomial) = 1.694e+17</code></pre>
<pre><code>cond(A) = 3.64e+09, cond(A_monomial) = 2.926e+18</code></pre>
</div>
</div>

Expand Down
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.
1 change: 1 addition & 0 deletions lectures/lectures/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ <h1>Lectures</h1>
<li><a href="probability.html" target="_blank">Probability, Conditioning, and Independence</a>, <a href="probability.ipynb" target="_blank">Jupyter</a>, <a href="probability.pdf" target="_blank">PDF</a></li>
<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.qmd.html" target="_blank">Uncertainty Quantification in Applied Economics</a>, <a href="uncertainty_bias_variance.qmd.ipynb" target="_blank">Jupyter</a>, <a href="uncertainty_bias_variance.qmd.pdf" target="_blank">PDF</a></li>
</ol>


Expand Down
13 changes: 0 additions & 13 deletions lectures/lectures/introduction_to_causality.html
Original file line number Diff line number Diff line change
Expand Up @@ -1061,19 +1061,6 @@ <h2>Estimating Treatment Effects Without Randomization</h2>
</section>
<section id="estimating-treatment-effects-without-randomization-1" class="slide level2">
<h2>Estimating Treatment Effects Without Randomization</h2>
<ul>
<li><p>Many identification assumptions are based on the idea of <strong>selection on observables</strong></p>
<ul>
<li>This means that the treatment assignment is independent of the potential outcomes <em>conditional</em> on the observed covariates</li>
<li>In other words, <span class="math inline">\(Y_0\)</span> and <span class="math inline">\(Y_1\)</span> are independent of <span class="math inline">\(T\)</span> conditional on <span class="math inline">\(X\)</span></li>
</ul></li>
<li><p>This allows us to do things like <strong>match</strong> units in the treatment and control groups that are similar on average</p>
<ul>
<li>We can then estimate the treatment effect by comparing the outcomes of the matched units, assuming that the matched units are similar on average</li>
</ul></li>
<li><p>Another option is to use <strong>instrumental variables</strong> to estimate the treatment effect</p></li>
<li><p>Alternatively, a <strong>structural model</strong> can be used to estimate the treatment effect by integrating a theoretical model to fill in the missing counterfactuals</p></li>
</ul>

<div class="footer footer-default">

Expand Down
22 changes: 11 additions & 11 deletions lectures/lectures/latent_variables.html
Original file line number Diff line number Diff line change
Expand Up @@ -611,9 +611,9 @@ <h2>PCA Without Dimension Reduction</h2>
<span id="cb4-5"><a href="#cb4-5"></a> <span class="bu">print</span>(<span class="ss">f"Explained Variance (ordered):</span><span class="ch">\n</span><span class="sc">{</span>pca<span class="sc">.</span>explained_variance_ratio_<span class="sc">}</span><span class="ss">"</span>)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-stdout">
<pre><code>Singular Values (sqrt eigenvalues):
[25.0823 1.0254 0.6468]
[21.5216 0.8732 0.7096]
Explained Variance (ordered):
[0.9977 0.0017 0.0007]</code></pre>
[0.9973 0.0016 0.0011]</code></pre>
</div>
</div>
</section>
Expand All @@ -626,8 +626,8 @@ <h2>Dimension Reduction with PCA</h2>
<span id="cb6-4"><a href="#cb6-4"></a><span class="bu">print</span>(<span class="ss">f"Correlation of Z_1 to Z_hat_1 = </span><span class="sc">{</span>np<span class="sc">.</span>corrcoef(Z.T, Z_hat.T)[<span class="dv">0</span>,<span class="dv">2</span>]<span class="sc">}</span><span class="ss">"</span>)</span>
<span id="cb6-5"><a href="#cb6-5"></a><span class="bu">print</span>(<span class="ss">f"Correlation of Z_2 to Z_hat_2 = </span><span class="sc">{</span>np<span class="sc">.</span>corrcoef(Z.T, Z_hat.T)[<span class="dv">1</span>,<span class="dv">3</span>]<span class="sc">}</span><span class="ss">"</span>)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-stdout">
<pre><code>Correlation of Z_1 to Z_hat_1 = 0.9989685407197146
Correlation of Z_2 to Z_hat_2 = -0.622136330126575</code></pre>
<pre><code>Correlation of Z_1 to Z_hat_1 = 0.9987396670122092
Correlation of Z_2 to Z_hat_2 = -0.6413512732572132</code></pre>
</div>
</div>
</section>
Expand Down Expand Up @@ -813,7 +813,7 @@ <h2>Plotting Code with Seaborn</h2>
<span id="cb9-6"><a href="#cb9-6"></a>plt.show()</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div><div class="column">
<div class="cell-output cell-output-display">
<p><img data-src="latent_variables_files/figure-revealjs/cell-7-output-1.png" width="830" height="449"></p>
<p><img data-src="latent_variables_files/figure-revealjs/cell-7-output-1.png" width="823" height="449"></p>
</div>
</div>
</div>
Expand All @@ -832,7 +832,7 @@ <h2>k-means to Recover the Latent Groups</h2>
<span id="cb10-4"><a href="#cb10-4"></a>corr <span class="op">=</span> df[<span class="st">"k"</span>].corr(df[<span class="st">"k_hat"</span>])</span>
<span id="cb10-5"><a href="#cb10-5"></a><span class="bu">print</span>(<span class="ss">f"Correlation between k and k_hat:</span><span class="sc">{</span>corr<span class="sc">:.2f}</span><span class="ss">"</span>)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-stdout">
<pre><code>Correlation between k and k_hat:-0.83</code></pre>
<pre><code>Correlation between k and k_hat:-0.93</code></pre>
</div>
</div>
</section>
Expand Down Expand Up @@ -870,7 +870,7 @@ <h2>Potentially Swap <span class="math inline">\(\hat{k}\)</span> and Compare</h
<span id="cb13-6"><a href="#cb13-6"></a> <span class="cf">if</span> x[<span class="st">'k'</span>] <span class="op">==</span> x[<span class="st">'k_hat'</span>] <span class="cf">else</span> <span class="vs">r'$k \neq \hat</span><span class="sc">{k}</span><span class="vs">$'</span>,</span>
<span id="cb13-7"><a href="#cb13-7"></a> axis<span class="op">=</span><span class="dv">1</span>)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-stdout">
<pre><code>Correlation now 0.8300415031127608</code></pre>
<pre><code>Correlation now 0.9300465034877902</code></pre>
</div>
</div>
</section>
Expand All @@ -886,7 +886,7 @@ <h2>Plotting the Uncovered Latent Groups</h2>
<span id="cb15-6"><a href="#cb15-6"></a>plt.show()</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div><div class="column">
<div class="cell-output cell-output-display">
<p><img data-src="latent_variables_files/figure-revealjs/cell-11-output-1.png" width="534" height="376"></p>
<p><img data-src="latent_variables_files/figure-revealjs/cell-11-output-1.png" width="526" height="376"></p>
</div>
</div>
</div>
Expand Down Expand Up @@ -945,7 +945,7 @@ <h2>Digging Deeper</h2>
<div class="sourceCode cell-code" id="cb19"><pre class="sourceCode numberSource python number-lines code-with-copy"><code class="sourceCode python"><span id="cb19-1"><a href="#cb19-1"></a>Lambda, Q <span class="op">=</span> eig(A)</span>
<span id="cb19-2"><a href="#cb19-2"></a><span class="bu">print</span>(np.real(Lambda))</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-stdout">
<pre><code>[ 1.10000000e+00 -2.65486721e-09]</code></pre>
<pre><code>[ 1.10000000e+00 -2.65486733e-09]</code></pre>
</div>
</div>
<ul>
Expand All @@ -968,7 +968,7 @@ <h2>Evolution Matrix is Very Simple with <span class="math inline">\(\lambda_2 =
<span id="cb21-3"><a href="#cb21-3"></a>q_1_inv <span class="op">=</span> np.reshape(inv(Q)[<span class="dv">0</span>,:], (<span class="dv">1</span>,<span class="dv">2</span>))</span>
<span id="cb21-4"><a href="#cb21-4"></a>norm(A <span class="op">-</span> lambda_1 <span class="op">*</span> q_1 <span class="op">@</span> q_1_inv) <span class="co"># pretty close to zero!</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-display" data-execution_count="15">
<pre><code>2.663274529925679e-09</code></pre>
<pre><code>2.663274500543771e-09</code></pre>
</div>
</div>
</section>
Expand Down Expand Up @@ -998,7 +998,7 @@ <h2>Implementation</h2>
<span id="cb23-5"><a href="#cb23-5"></a><span class="bu">print</span>(<span class="ss">f"norm = </span><span class="sc">{</span>norm(d[:,<span class="dv">1</span>:] <span class="op">-</span> d_hat)<span class="sc">}</span><span class="ss">"</span>)</span>
<span id="cb23-6"><a href="#cb23-6"></a>y_hat <span class="op">=</span> G <span class="op">@</span> d_hat</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-stdout">
<pre><code>norm = 2.3494397540428033e-10</code></pre>
<pre><code>norm = 2.3494410875961204e-10</code></pre>
</div>
</div>
<p>Let’s see if these line up perfectly</p>
Expand Down
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.
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.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 5 additions & 5 deletions lectures/lectures/linear_algebra_foundations.html
Original file line number Diff line number Diff line change
Expand Up @@ -1121,9 +1121,9 @@ <h2>Example of LLS using Scipy</h2>
<span id="cb48-6"><a href="#cb48-6"></a><span class="bu">print</span>(<span class="ss">f"beta =</span><span class="ch">\n</span><span class="ss"> </span><span class="sc">{</span>beta<span class="sc">}</span><span class="ch">\n</span><span class="ss">beta_hat =</span><span class="ch">\n</span><span class="sc">{</span>beta_hat<span class="sc">}</span><span class="ss">"</span>)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-stdout">
<pre><code>beta =
[-0.81011697 0.47576408 -0.08064125 -0.21201846 -1.02869662]
[ 1.27699654 1.24976206 -0.02314793 -0.1603755 -1.71006662]
beta_hat =
[-0.81519622 0.47790174 -0.08893845 -0.21818441 -1.02778959]</code></pre>
[ 1.26798224 1.24374081 -0.02376603 -0.16370129 -1.72027267]</code></pre>
</div>
</div>
</section>
Expand All @@ -1135,9 +1135,9 @@ <h2>Solving using the Normal Equations</h2>
<span id="cb50-2"><a href="#cb50-2"></a><span class="bu">print</span>(<span class="ss">f"beta =</span><span class="ch">\n</span><span class="ss"> </span><span class="sc">{</span>beta<span class="sc">}</span><span class="ch">\n</span><span class="ss">beta_hat =</span><span class="ch">\n</span><span class="sc">{</span>beta_hat<span class="sc">}</span><span class="ss">"</span>)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-stdout">
<pre><code>beta =
[-0.81011697 0.47576408 -0.08064125 -0.21201846 -1.02869662]
[ 1.27699654 1.24976206 -0.02314793 -0.1603755 -1.71006662]
beta_hat =
[-0.81519622 0.47790174 -0.08893845 -0.21818441 -1.02778959]</code></pre>
[ 1.26798224 1.24374081 -0.02376603 -0.16370129 -1.72027267]</code></pre>
</div>
</div>
</section>
Expand Down Expand Up @@ -1165,7 +1165,7 @@ <h2>Collinearity and Estimation</h2>
<div class="cell" data-execution_count="29">
<div class="sourceCode cell-code" id="cb54"><pre class="sourceCode numberSource python number-lines code-with-copy"><code class="sourceCode python"><span id="cb54-1"><a href="#cb54-1"></a><span class="bu">print</span>(<span class="ss">f"cond(X'*X)=</span><span class="sc">{</span>cond(X.T<span class="op">@</span>X)<span class="sc">}</span><span class="ss">, cond(X_col'*X_col)=</span><span class="sc">{</span>cond(X_col.T<span class="op">@</span>X_col)<span class="sc">}</span><span class="ss">"</span>)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-stdout">
<pre><code>cond(X'*X)=2819.3329786399063, cond(X_col'*X_col)=1.2999933999712892e+16</code></pre>
<pre><code>cond(X'*X)=2819.332978639814, cond(X_col'*X_col)=1.1014450683078442e+16</code></pre>
</div>
</div>
<ul>
Expand Down
4 changes: 2 additions & 2 deletions lectures/lectures/probability.html
Original file line number Diff line number Diff line change
Expand Up @@ -666,7 +666,7 @@ <h2>Using the <code>discrete_rv</code></h2>
<pre><code>E(X) = 34500.0
E(f(X)) = 182.2474487139159
CDF(X) = [0.2 1. 0.1]
Samples of X = [40000 15000 40000 40000 40000]</code></pre>
Samples of X = [40000 40000 10000 40000 40000]</code></pre>
</div>
</div>
</div>
Expand Down Expand Up @@ -729,7 +729,7 @@ <h2>The Binomial Distribution</h2>
<div class="cell-output cell-output-stdout">
<pre><code>Mean: 5.00
Variance: 2.50
Draws of u: [3 5 5 6 6]</code></pre>
Draws of u: [3 5 7 8 3]</code></pre>
</div>
</div>
</div>
Expand Down
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.
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.
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.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions lectures/lectures/stochastic_processes.html
Original file line number Diff line number Diff line change
Expand Up @@ -640,7 +640,7 @@ <h2>Implementation in Python</h2>
<span id="cb2-14"><a href="#cb2-14"></a>plt.plot(X.T)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div><div class="column">
<div class="cell-output cell-output-display">
<p><img data-src="stochastic_processes_files/figure-revealjs/cell-3-output-1.png" width="805" height="411"></p>
<p><img data-src="stochastic_processes_files/figure-revealjs/cell-3-output-1.png" width="781" height="411"></p>
</div>
</div>
</div>
Expand Down Expand Up @@ -729,7 +729,7 @@ <h2>Simulating Unit Root</h2>
<h2>Visualizing the Distribution of Many Trajectories</h2>
<div class="cell" data-execution_count="6">
<div class="cell-output cell-output-display">
<p><img data-src="stochastic_processes_files/figure-revealjs/cell-6-output-1.png" width="813" height="429"></p>
<p><img data-src="stochastic_processes_files/figure-revealjs/cell-6-output-1.png" width="805" height="434"></p>
</div>
</div>
</section>
Expand Down Expand Up @@ -976,7 +976,7 @@ <h2>Coding Markov Chain in Python</h2>
<div class="cell-output cell-output-stdout">
<pre><code>X_0 = 0, X_1 = 0
X_t indices =
[0 0 0 0 0 0 0 0 0 0 0]</code></pre>
[0 1 1 1 1 1 1 1 1 1 1]</code></pre>
</div>
</div>
</div>
Expand Down
Loading

0 comments on commit 60c09f0

Please sign in to comment.