Skip to content

Commit 84a6c0c

Browse files
HumphreyYangthomassargent30mmcky
authored
[likelihood_ratio_processes] Update structure and SyntaxWarnings (#497)
* update sections * updates * remove syntax errors * minor updates * updates * updates * Tom's edits of likelihood ratio lecture July 26 * update * Tom's July 27 edits of likelihood Bayes lecture * Tom's second June 27 edits of likelihood-Bayes lecture * minor adjustments * pin jax==0.6.2 * update simulation * updates * updates * minor updates * update discussion into an exercise * Tom's July 28 edits of likelihood ratio lecture --------- Co-authored-by: thomassargent30 <[email protected]> Co-authored-by: mmcky <[email protected]>
1 parent b5c7b63 commit 84a6c0c

File tree

8 files changed

+1574
-1092
lines changed

8 files changed

+1574
-1092
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
run: |
2424
pip install --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/cu128
2525
pip install pyro-ppl
26-
pip install --upgrade "jax[cuda12-local]"
26+
pip install --upgrade "jax[cuda12-local]==0.6.2"
2727
pip install numpyro pyro-ppl
2828
python scripts/test-jax-install.py
2929
- name: Check nvidia Drivers

lectures/finite_markov.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1077,7 +1077,7 @@ for x0, col in ((0, 'blue'), (1, 'green')):
10771077
X_bar = (X == 0).cumsum() / (1 + np.arange(N, dtype=float))
10781078
# Plot
10791079
ax.fill_between(range(N), np.zeros(N), X_bar - p, color=col, alpha=0.1)
1080-
ax.plot(X_bar - p, color=col, label=f'$X_0 = \, {x0} $')
1080+
ax.plot(X_bar - p, color=col, label=fr'$X_0 = \, {x0} $')
10811081
# Overlay in black--make lines clearer
10821082
ax.plot(X_bar - p, 'k-', alpha=0.6)
10831083
@@ -1280,7 +1280,7 @@ Q = np.zeros((n, n), dtype=int)
12801280
with open(infile) as f:
12811281
edges = f.readlines()
12821282
for edge in edges:
1283-
from_node, to_node = re.findall('\w', edge)
1283+
from_node, to_node = re.findall(r'\w', edge)
12841284
i, j = alphabet.index(from_node), alphabet.index(to_node)
12851285
Q[i, j] = 1
12861286
# Create the corresponding Markov matrix P

lectures/imp_sample.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ w_range = np.linspace(1e-2, 1-1e-5, 1000)
9090
9191
plt.plot(w_range, g(w_range), label='g')
9292
plt.plot(w_range, f(w_range), label='f')
93-
plt.xlabel('$\omega$')
93+
plt.xlabel(r'$\omega$')
9494
plt.legend()
9595
plt.title('density functions $f$ and $g$')
9696
plt.show()
@@ -104,8 +104,8 @@ l = jit(lambda w: f(w) / g(w))
104104

105105
```{code-cell} ipython3
106106
plt.plot(w_range, l(w_range))
107-
plt.title('$\ell(\omega)$')
108-
plt.xlabel('$\omega$')
107+
plt.title(r'$\ell(\omega)$')
108+
plt.xlabel(r'$\omega$')
109109
plt.show()
110110
```
111111

@@ -314,7 +314,7 @@ for i, t in enumerate([1, 5, 10, 20]):
314314
for n, bins, μ_hat, σ_hat in [[n_p, bins_p, μ_hat_p, σ_hat_p],
315315
[n_q, bins_q, μ_hat_q, σ_hat_q]]:
316316
idx = np.argmax(n)
317-
axs[row, col].text(bins[idx], n[idx], '$\hat{μ}$='+f'{μ_hat:.4g}'+', $\hat{σ}=$'+f'{σ_hat:.4g}')
317+
axs[row, col].text(bins[idx], n[idx], r'$\hat{μ}$='+f'{μ_hat:.4g}'+r', $\hat{σ}=$'+f'{σ_hat:.4g}')
318318
319319
plt.show()
320320
```
@@ -418,7 +418,7 @@ for i, t in enumerate([1, 20]):
418418
for n, bins, μ_hat, σ_hat in [[n_p, bins_p, μ_hat_p, σ_hat_p],
419419
[n_q, bins_q, μ_hat_q, σ_hat_q]]:
420420
idx = np.argmax(n)
421-
axs[i].text(bins[idx], n[idx], '$\hat{μ}$='+f'{μ_hat:.4g}'+', $\hat{σ}=$'+f'{σ_hat:.4g}')
421+
axs[i].text(bins[idx], n[idx], r'$\hat{μ}$='+f'{μ_hat:.4g}'+r', $\hat{σ}=$'+f'{σ_hat:.4g}')
422422
423423
plt.show()
424424
```
@@ -452,7 +452,7 @@ for i, t in enumerate([1, 20]):
452452
for n, bins, μ_hat, σ_hat in [[n_p, bins_p, μ_hat_p, σ_hat_p],
453453
[n_q, bins_q, μ_hat_q, σ_hat_q]]:
454454
idx = np.argmax(n)
455-
axs[i].text(bins[idx], n[idx], '$\hat{μ}$='+f'{μ_hat:.4g}'+', $\hat{σ}=$'+f'{σ_hat:.4g}')
455+
axs[i].text(bins[idx], n[idx], r'$\hat{μ}$='+f'{μ_hat:.4g}'+r', $\hat{σ}=$'+f'{σ_hat:.4g}')
456456
457457
plt.show()
458458
```

0 commit comments

Comments
 (0)