@@ -4,7 +4,7 @@ jupytext:
4
4
extension : .md
5
5
format_name : myst
6
6
format_version : 0.13
7
- jupytext_version : 1.16.1
7
+ jupytext_version : 1.16.6
8
8
kernelspec :
9
9
display_name : Python 3 (ipykernel)
10
10
language : python
@@ -434,7 +434,7 @@ for μ, σ in zip(μ_vals, σ_vals):
434
434
u = scipy.stats.norm(μ, σ)
435
435
ax.plot(x_grid, u.pdf(x_grid),
436
436
alpha=0.5, lw=2,
437
- label=f '$\mu={μ}, \sigma={σ}$')
437
+ label=rf '$\mu={μ}, \sigma={σ}$')
438
438
ax.set_xlabel('x')
439
439
ax.set_ylabel('PDF')
440
440
plt.legend()
@@ -449,7 +449,7 @@ for μ, σ in zip(μ_vals, σ_vals):
449
449
u = scipy.stats.norm(μ, σ)
450
450
ax.plot(x_grid, u.cdf(x_grid),
451
451
alpha=0.5, lw=2,
452
- label=f '$\mu={μ}, \sigma={σ}$')
452
+ label=rf '$\mu={μ}, \sigma={σ}$')
453
453
ax.set_ylim(0, 1)
454
454
ax.set_xlabel('x')
455
455
ax.set_ylabel('CDF')
@@ -510,7 +510,7 @@ for σ in σ_vals:
510
510
u = scipy.stats.norm(μ, σ)
511
511
ax.plot(x_grid, u.cdf(x_grid),
512
512
alpha=0.5, lw=2,
513
- label=f '$\mu={μ}, \sigma={σ}$')
513
+ label=rf '$\mu={μ}, \sigma={σ}$')
514
514
ax.set_ylim(0, 1)
515
515
ax.set_xlim(0, 3)
516
516
ax.set_xlabel('x')
@@ -554,7 +554,7 @@ for λ in λ_vals:
554
554
u = scipy.stats.expon(scale=1/λ)
555
555
ax.plot(x_grid, u.pdf(x_grid),
556
556
alpha=0.5, lw=2,
557
- label=f '$\lambda={λ}$')
557
+ label=rf '$\lambda={λ}$')
558
558
ax.set_xlabel('x')
559
559
ax.set_ylabel('PDF')
560
560
plt.legend()
@@ -567,7 +567,7 @@ for λ in λ_vals:
567
567
u = scipy.stats.expon(scale=1/λ)
568
568
ax.plot(x_grid, u.cdf(x_grid),
569
569
alpha=0.5, lw=2,
570
- label=f '$\lambda={λ}$')
570
+ label=rf '$\lambda={λ}$')
571
571
ax.set_ylim(0, 1)
572
572
ax.set_xlabel('x')
573
573
ax.set_ylabel('CDF')
@@ -615,7 +615,7 @@ for α, β in zip(α_vals, β_vals):
615
615
u = scipy.stats.beta(α, β)
616
616
ax.plot(x_grid, u.pdf(x_grid),
617
617
alpha=0.5, lw=2,
618
- label=fr '$\alpha={α}, \beta={β}$')
618
+ label=rf '$\alpha={α}, \beta={β}$')
619
619
ax.set_xlabel('x')
620
620
ax.set_ylabel('PDF')
621
621
plt.legend()
@@ -628,7 +628,7 @@ for α, β in zip(α_vals, β_vals):
628
628
u = scipy.stats.beta(α, β)
629
629
ax.plot(x_grid, u.cdf(x_grid),
630
630
alpha=0.5, lw=2,
631
- label=fr '$\alpha={α}, \beta={β}$')
631
+ label=rf '$\alpha={α}, \beta={β}$')
632
632
ax.set_ylim(0, 1)
633
633
ax.set_xlabel('x')
634
634
ax.set_ylabel('CDF')
@@ -675,7 +675,7 @@ for α, β in zip(α_vals, β_vals):
675
675
u = scipy.stats.gamma(α, scale=1/β)
676
676
ax.plot(x_grid, u.pdf(x_grid),
677
677
alpha=0.5, lw=2,
678
- label=fr '$\alpha={α}, \beta={β}$')
678
+ label=rf '$\alpha={α}, \beta={β}$')
679
679
ax.set_xlabel('x')
680
680
ax.set_ylabel('PDF')
681
681
plt.legend()
@@ -688,7 +688,7 @@ for α, β in zip(α_vals, β_vals):
688
688
u = scipy.stats.gamma(α, scale=1/β)
689
689
ax.plot(x_grid, u.cdf(x_grid),
690
690
alpha=0.5, lw=2,
691
- label=fr '$\alpha={α}, \beta={β}$')
691
+ label=rf '$\alpha={α}, \beta={β}$')
692
692
ax.set_ylim(0, 1)
693
693
ax.set_xlabel('x')
694
694
ax.set_ylabel('CDF')
@@ -799,7 +799,7 @@ So we will have one observation for each month.
799
799
:tags: [hide-output]
800
800
801
801
df = yf.download('AMZN', '2000-1-1', '2024-1-1', interval='1mo')
802
- prices = df['Adj Close']
802
+ prices = df['Close']
803
803
x_amazon = prices.pct_change()[1:] * 100
804
804
x_amazon.head()
805
805
```
@@ -876,7 +876,7 @@ For example, let's compare the monthly returns on Amazon shares with the monthly
876
876
:tags: [hide-output]
877
877
878
878
df = yf.download('COST', '2000-1-1', '2024-1-1', interval='1mo')
879
- prices = df['Adj Close']
879
+ prices = df['Close']
880
880
x_costco = prices.pct_change()[1:] * 100
881
881
```
882
882
0 commit comments