From eae7166dc0fe9448f8d510bbb6f1e70fd7cc8d15 Mon Sep 17 00:00:00 2001 From: mmcky Date: Mon, 18 Oct 2021 12:11:48 +1100 Subject: [PATCH 01/15] update the software stack --- environment.yml | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/environment.yml b/environment.yml index 12dde5d00..cfe041ee1 100644 --- a/environment.yml +++ b/environment.yml @@ -3,18 +3,14 @@ channels: - default dependencies: - python=3.8 - - anaconda=2020.11 + - anaconda=2021.05 - pip - pip: - - jupyter-book==0.11.2 - - quantecon-book-theme==0.2.3 + - jupyter-book==0.12.0 + - quantecon-book-theme==0.2.7 - sphinx-tojupyter==0.1.2 - sphinxext-rediraffe==0.2.7 - - sphinx-exercise==0.1.1 - - jupytext==1.11.2 + - sphinx-exercise==0.2.1 - ghp-import==1.1.0 - - jupinx==0.2.3 - sphinxcontrib-youtube - # Temporary Fixes - - tornado>=6.1 From c0185a92e17cc65774c15980618c5444f8d46a01 Mon Sep 17 00:00:00 2001 From: mmcky Date: Mon, 18 Oct 2021 15:26:10 +1100 Subject: [PATCH 02/15] upgrade to sphinx-tojupyter==0.2.0 --- environment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/environment.yml b/environment.yml index cfe041ee1..470323dfa 100644 --- a/environment.yml +++ b/environment.yml @@ -8,7 +8,7 @@ dependencies: - pip: - jupyter-book==0.12.0 - quantecon-book-theme==0.2.7 - - sphinx-tojupyter==0.1.2 + - sphinx-tojupyter==0.2.0 - sphinxext-rediraffe==0.2.7 - sphinx-exercise==0.2.1 - ghp-import==1.1.0 From 5f6cebfb9d5c340639196349c8cd66459bb126f7 Mon Sep 17 00:00:00 2001 From: mmcky Date: Mon, 18 Oct 2021 15:29:12 +1100 Subject: [PATCH 03/15] update mathjax settings for sphinx4 --- lectures/_config.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lectures/_config.yml b/lectures/_config.yml index 9f4619a6d..7cb5261ba 100644 --- a/lectures/_config.yml +++ b/lectures/_config.yml @@ -56,12 +56,11 @@ sphinx: description: This website presents a set of lectures on quantitative economic modeling, designed and written by Thomas J. Sargent and John Stachurski. keywords: Python, QuantEcon, Quantitative Economics, Economics, Sloan, Alfred P. Sloan Foundation, Tom J. Sargent, John Stachurski google_analytics_id: UA-54984338-10 - mathjax_config: + mathjax3_config: TeX: Macros: "argmax" : "arg\\,max" "argmin" : "arg\\,min" - mathjax_path: https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-svg.js rediraffe_redirects: index_toc.md: intro.md tojupyter_static_file_path: ["source/_static", "_static"] From c2163f860ddd48f4cd74be0be5cf28426bfc39e0 Mon Sep 17 00:00:00 2001 From: mmcky Date: Mon, 18 Oct 2021 16:10:14 +1100 Subject: [PATCH 04/15] re-enable svg version of mathjax --- lectures/_config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/lectures/_config.yml b/lectures/_config.yml index 7cb5261ba..fd0864369 100644 --- a/lectures/_config.yml +++ b/lectures/_config.yml @@ -61,6 +61,7 @@ sphinx: Macros: "argmax" : "arg\\,max" "argmin" : "arg\\,min" + mathjax_path: https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-svg.js rediraffe_redirects: index_toc.md: intro.md tojupyter_static_file_path: ["source/_static", "_static"] From c364df1b40befbb83a7dffbec896ed821a3e5282 Mon Sep 17 00:00:00 2001 From: mmcky Date: Fri, 19 Nov 2021 15:29:50 +1100 Subject: [PATCH 05/15] upgrade to jupyter-book==0.12.1 --- environment.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/environment.yml b/environment.yml index 470323dfa..5ac3b398a 100644 --- a/environment.yml +++ b/environment.yml @@ -6,8 +6,8 @@ dependencies: - anaconda=2021.05 - pip - pip: - - jupyter-book==0.12.0 - - quantecon-book-theme==0.2.7 + - jupyter-book==0.12.1 + - quantecon-book-theme==0.3.0 - sphinx-tojupyter==0.2.0 - sphinxext-rediraffe==0.2.7 - sphinx-exercise==0.2.1 From 97313d62e2e918ec3a4e0ff0abbe10585f6124d1 Mon Sep 17 00:00:00 2001 From: mmcky Date: Mon, 22 Nov 2021 10:45:12 +1100 Subject: [PATCH 06/15] update to 2021.11 anaconda --- environment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/environment.yml b/environment.yml index 5ac3b398a..6aebcd5d0 100644 --- a/environment.yml +++ b/environment.yml @@ -3,7 +3,7 @@ channels: - default dependencies: - python=3.8 - - anaconda=2021.05 + - anaconda=2021.11 - pip - pip: - jupyter-book==0.12.1 From 654799db4e7986c2b2b3a6c33f5c8560e093498b Mon Sep 17 00:00:00 2001 From: mmcky Date: Wed, 24 Nov 2021 09:45:23 +1100 Subject: [PATCH 07/15] adjust mathjax config --- lectures/_config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lectures/_config.yml b/lectures/_config.yml index fd0864369..f50f4d5e0 100644 --- a/lectures/_config.yml +++ b/lectures/_config.yml @@ -57,8 +57,8 @@ sphinx: keywords: Python, QuantEcon, Quantitative Economics, Economics, Sloan, Alfred P. Sloan Foundation, Tom J. Sargent, John Stachurski google_analytics_id: UA-54984338-10 mathjax3_config: - TeX: - Macros: + tex: + macros: "argmax" : "arg\\,max" "argmin" : "arg\\,min" mathjax_path: https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-svg.js From 91cdfb63e564576b2fffbf776d91004fbb8e90cc Mon Sep 17 00:00:00 2001 From: mmcky Date: Wed, 24 Nov 2021 10:05:23 +1100 Subject: [PATCH 08/15] configure myst-parser with specified extensions --- lectures/_config.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/lectures/_config.yml b/lectures/_config.yml index f50f4d5e0..e26142dee 100644 --- a/lectures/_config.yml +++ b/lectures/_config.yml @@ -3,6 +3,19 @@ author: Thomas J. Sargent & John Stachurski logo: _static/qe-logo-large.png description: This website presents a set of lectures on quantitative economic modeling, designed and written by Thomas J. Sargent and John Stachurski. +parse: + myst_enable_extensions: + - amsmath + - colon_fence + - deflist + - dollarmath + - html_admonition + - html_image + - linkify + - replacements + - smartquotes + - substitution + only_build_toc_files: true execute: execute_notebooks: "cache" From db0fb250f5b9ff99c983147b36dbad4bea15b4f4 Mon Sep 17 00:00:00 2001 From: mmcky Date: Wed, 24 Nov 2021 10:24:28 +1100 Subject: [PATCH 09/15] add in sans fonts --- .github/workflows/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8c6c9c75a..3f9c980d3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,7 +27,8 @@ jobs: latexmk \ xindy \ dvipng \ - cm-super + cm-super \ + fonts-open-sans - name: Display Conda Environment Versions shell: bash -l {0} run: conda list From 9ca361f96e3ec9b73ab371e4a8a3663e7c5e9983 Mon Sep 17 00:00:00 2001 From: mmcky Date: Wed, 24 Nov 2021 10:36:53 +1100 Subject: [PATCH 10/15] try font-manager --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3f9c980d3..634dbc9cf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,7 +28,7 @@ jobs: xindy \ dvipng \ cm-super \ - fonts-open-sans + font-manager - name: Display Conda Environment Versions shell: bash -l {0} run: conda list From feb356d22cd9d8ed6a8a62f801427cbc208c5ac7 Mon Sep 17 00:00:00 2001 From: mmcky Date: Wed, 24 Nov 2021 10:58:36 +1100 Subject: [PATCH 11/15] Try and regenerate font-manager --- .github/workflows/ci.yml | 3 +-- lectures/prob_meaning.md | 2 ++ 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 634dbc9cf..8c6c9c75a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,8 +27,7 @@ jobs: latexmk \ xindy \ dvipng \ - cm-super \ - font-manager + cm-super - name: Display Conda Environment Versions shell: bash -l {0} run: conda list diff --git a/lectures/prob_meaning.md b/lectures/prob_meaning.md index 5c5a6eac2..bd848d742 100644 --- a/lectures/prob_meaning.md +++ b/lectures/prob_meaning.md @@ -76,6 +76,8 @@ config = { "font.serif": ['SimSun'], } rcParams.update(config) + +import matplotlib.font_manager ``` Empowered with these Python tools, we'll now explore the two meanings described above. From a934cbb37f18465eee262d5db28a0dd39cb36efa Mon Sep 17 00:00:00 2001 From: mmcky Date: Wed, 24 Nov 2021 11:13:45 +1100 Subject: [PATCH 12/15] install basic fonts --- .github/workflows/ci.yml | 3 ++- lectures/prob_meaning.md | 5 +---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8c6c9c75a..fea5472a7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,7 +27,8 @@ jobs: latexmk \ xindy \ dvipng \ - cm-super + cm-super \ + msttcorefonts - name: Display Conda Environment Versions shell: bash -l {0} run: conda list diff --git a/lectures/prob_meaning.md b/lectures/prob_meaning.md index bd848d742..92cb29a08 100644 --- a/lectures/prob_meaning.md +++ b/lectures/prob_meaning.md @@ -66,8 +66,7 @@ import matplotlib.pyplot as plt from scipy.stats import binom import scipy.stats as st from matplotlib import rcParams -from IPython.display import set_matplotlib_formats -set_matplotlib_formats('retina') +import matplotlib.font_manager %matplotlib inline config = { @@ -76,8 +75,6 @@ config = { "font.serif": ['SimSun'], } rcParams.update(config) - -import matplotlib.font_manager ``` Empowered with these Python tools, we'll now explore the two meanings described above. From 00f7d7a8239cb2fbe690abd8fe4ab66440933c88 Mon Sep 17 00:00:00 2001 From: mmcky Date: Wed, 24 Nov 2021 11:28:25 +1100 Subject: [PATCH 13/15] just use standard fonts --- lectures/prob_meaning.md | 9 --------- 1 file changed, 9 deletions(-) diff --git a/lectures/prob_meaning.md b/lectures/prob_meaning.md index 92cb29a08..4786606a5 100644 --- a/lectures/prob_meaning.md +++ b/lectures/prob_meaning.md @@ -65,16 +65,7 @@ import prettytable as pt import matplotlib.pyplot as plt from scipy.stats import binom import scipy.stats as st -from matplotlib import rcParams -import matplotlib.font_manager %matplotlib inline - -config = { - "font.family":'serif', - "mathtext.fontset": 'stix', - "font.serif": ['SimSun'], -} -rcParams.update(config) ``` Empowered with these Python tools, we'll now explore the two meanings described above. From 6684f8b862fabaef29dee38a2d1fe38e3201b397 Mon Sep 17 00:00:00 2001 From: mmcky Date: Wed, 24 Nov 2021 11:54:37 +1100 Subject: [PATCH 14/15] adjustments to prob_meaning lecture --- lectures/prob_meaning.md | 42 +++++++++++++++++++++------------------- 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/lectures/prob_meaning.md b/lectures/prob_meaning.md index 4786606a5..7176a63d8 100644 --- a/lectures/prob_meaning.md +++ b/lectures/prob_meaning.md @@ -123,12 +123,12 @@ As usual, a law of large numbers justifies this answer. **Exercise 1:** - * (a) Please write a Python class to compute $f_k^I$ +1. Please write a Python class to compute $f_k^I$ - * (b) Please use your code to compute $f_k^I, k = 0, \ldots , n$ and compare them to +2. Please use your code to compute $f_k^I, k = 0, \ldots , n$ and compare them to $\textrm{Prob}(X = k | \theta)$ for various values of $\theta, n$ and $I$ - * (c) With the Law of Large numbers in mind, use your code to say something +3. With the Law of Large numbers in mind, use your code to say something +++ @@ -350,25 +350,27 @@ a beta distribution with parameters $\alpha, \beta$. **Exercise 2:** -* (a) Please write down the **likelihood function** for a sample of length $n$ from a binomial distribution with parameter $\theta$. +1. Please write down the **likelihood function** for a sample of length $n$ from a binomial distribution with parameter $\theta$. -* (b) Please write down the **posterior** distribution for $\theta$ after observing one flip of the coin. +2. Please write down the **posterior** distribution for $\theta$ after observing one flip of the coin. -* (c) Please pretend that the true value of $\theta = .4$ and that someone who doesn't know this has a beta prior distribution with parameters with $\beta = \alpha = .5$. +3. Please pretend that the true value of $\theta = .4$ and that someone who doesn't know this has a beta prior distribution with parameters with $\beta = \alpha = .5$. -* (d) Please write a Python class to simulate this person's personal posterior distribution for $\theta$ for a _single_ sequence of $n$ draws. +4. Please write a Python class to simulate this person's personal posterior distribution for $\theta$ for a _single_ sequence of $n$ draws. -* (e) Please plot the posterior distribution for $\theta$ as a function of $\theta$ as $n$ grows from $1, 2, \ldots$. +5. Please plot the posterior distribution for $\theta$ as a function of $\theta$ as $n$ grows from $1, 2, \ldots$. -* (f) For various $n$'s, please describe and compute a Bayesian coverage interval for the interval $[.45, .55]$. +6. For various $n$'s, please describe and compute a Bayesian coverage interval for the interval $[.45, .55]$. -* (g) Please tell what question a Bayesian coverage interval answers. +7. Please tell what question a Bayesian coverage interval answers. -* (h) Please use your Python class to study what happens to the posterior distribution as $n \rightarrow + \infty$, again assuming that the true value of $\theta = .4$, though it is unknown to the person doing the updating via Bayes' Law. +8. Please compute the Posterior probabililty that $\theta \in [.45, .55]$ for various values of sample size $n$. + +9. Please use your Python class to study what happens to the posterior distribution as $n \rightarrow + \infty$, again assuming that the true value of $\theta = .4$, though it is unknown to the person doing the updating via Bayes' Law. **Answer:** -* (a) Please write down the **likelihood function** and the **posterior** distribution for $\theta$ after observing one flip of our coin. +1. Please write down the **likelihood function** and the **posterior** distribution for $\theta$ after observing one flip of our coin. Suppose the outcome is __Y__. @@ -379,7 +381,7 @@ L(Y|\theta)= \textrm{Prob}(X = Y | \theta) = \theta^Y (1-\theta)^{1-Y} $$ -* (b) Please write the **posterior** distribution for $\theta$ after observing one flip of our coin. +2. Please write the **posterior** distribution for $\theta$ after observing one flip of our coin. The prior distribution is @@ -402,9 +404,9 @@ $$ \textrm{Prob}(\theta | Y) \sim \textrm{Beta}(\alpha + Y, \beta + (1-Y)) $$ -* (c) Please pretend that the true value of $\theta = .4$ and that someone who doesn't know this has a beta prior with $\beta = \alpha = .5$. +3. Please pretend that the true value of $\theta = .4$ and that someone who doesn't know this has a beta prior with $\beta = \alpha = .5$. -* (d) Please write a Python class to simulate this person's personal posterior distribution for $\theta$ for a _single_ sequence of $n$ draws. +4. Please write a Python class to simulate this person's personal posterior distribution for $\theta$ for a _single_ sequence of $n$ draws. ```{code-cell} ipython3 class Bayesian: @@ -468,7 +470,7 @@ class Bayesian: self.posterior_list.append(self.form_single_posterior(num)) ``` -* (e) Please plot the posterior distribution for $\theta$ as a function of $\theta$ as $n$ grows from $1, 2, \ldots$. +5. Please plot the posterior distribution for $\theta$ as a function of $\theta$ as $n$ grows from $1, 2, \ldots$. ```{code-cell} ipython3 Bay_stat = Bayesian() @@ -495,7 +497,7 @@ ax.legend(fontsize=11) plt.show() ``` -* (f) For various $n$'s, please describe and compute $.05$ and $.95$ quantiles for posterior probabilities. +6. For various $n$'s, please describe and compute $.05$ and $.95$ quantiles for posterior probabilities. ```{code-cell} ipython3 upper_bound = [ii.ppf(0.05) for ii in Bay_stat.posterior_list[:14]] @@ -511,7 +513,7 @@ interval_df As n increases, we can see that Bayesian coverage intervals narrow and move toward $0.4$. -* (g) Please tell what question a Bayesian coverage interval answers. +7. Please tell what question a Bayesian coverage interval answers. The Bayesian coverage interval tells the range of $\theta$ that corresponds to the [$p_1$, $p_2$] quantiles of the cumulative probability distribution (CDF) of the posterior distribution. @@ -523,7 +525,7 @@ $$ F(a)=p_1,F(b)=p_2 $$ -* (h) Please compute the Posterior probabililty that $\theta \in [.45, .55]$ for various values of sample size $n$. +8. Please compute the Posterior probabililty that $\theta \in [.45, .55]$ for various values of sample size $n$. ```{code-cell} ipython3 left_value, right_value = 0.45, 0.55 @@ -557,7 +559,7 @@ When the number of observations becomes large enough, our Bayesian becomes so co That is why we see a nearly horizontal line when the number of observations exceeds 500. -* (i) Please use your Python class to study what happens to the posterior distribution as $n \rightarrow + \infty$, again assuming that the true value of $\theta = .4$, though it is unknown to the person doing the updating via Bayes' Law. +8. Please use your Python class to study what happens to the posterior distribution as $n \rightarrow + \infty$, again assuming that the true value of $\theta = .4$, though it is unknown to the person doing the updating via Bayes' Law. Using the Python class we made above, we can see the evolution of posterior distributions as n approaches infinity. From 6102004a37106640a031e00c9f96aec46cf26a0e Mon Sep 17 00:00:00 2001 From: mmcky Date: Wed, 24 Nov 2021 12:18:47 +1100 Subject: [PATCH 15/15] adjust to letters --- lectures/prob_meaning.md | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/lectures/prob_meaning.md b/lectures/prob_meaning.md index 7176a63d8..3fb10bb06 100644 --- a/lectures/prob_meaning.md +++ b/lectures/prob_meaning.md @@ -350,27 +350,27 @@ a beta distribution with parameters $\alpha, \beta$. **Exercise 2:** -1. Please write down the **likelihood function** for a sample of length $n$ from a binomial distribution with parameter $\theta$. +**a)** Please write down the **likelihood function** for a sample of length $n$ from a binomial distribution with parameter $\theta$. -2. Please write down the **posterior** distribution for $\theta$ after observing one flip of the coin. +**b)** Please write down the **posterior** distribution for $\theta$ after observing one flip of the coin. -3. Please pretend that the true value of $\theta = .4$ and that someone who doesn't know this has a beta prior distribution with parameters with $\beta = \alpha = .5$. +**c)** Please pretend that the true value of $\theta = .4$ and that someone who doesn't know this has a beta prior distribution with parameters with $\beta = \alpha = .5$. -4. Please write a Python class to simulate this person's personal posterior distribution for $\theta$ for a _single_ sequence of $n$ draws. +**d)** Please write a Python class to simulate this person's personal posterior distribution for $\theta$ for a _single_ sequence of $n$ draws. -5. Please plot the posterior distribution for $\theta$ as a function of $\theta$ as $n$ grows from $1, 2, \ldots$. +**e)** Please plot the posterior distribution for $\theta$ as a function of $\theta$ as $n$ grows from $1, 2, \ldots$. -6. For various $n$'s, please describe and compute a Bayesian coverage interval for the interval $[.45, .55]$. +**f)** For various $n$'s, please describe and compute a Bayesian coverage interval for the interval $[.45, .55]$. -7. Please tell what question a Bayesian coverage interval answers. +**g)** Please tell what question a Bayesian coverage interval answers. -8. Please compute the Posterior probabililty that $\theta \in [.45, .55]$ for various values of sample size $n$. +**h)** Please compute the Posterior probabililty that $\theta \in [.45, .55]$ for various values of sample size $n$. -9. Please use your Python class to study what happens to the posterior distribution as $n \rightarrow + \infty$, again assuming that the true value of $\theta = .4$, though it is unknown to the person doing the updating via Bayes' Law. +**i)** Please use your Python class to study what happens to the posterior distribution as $n \rightarrow + \infty$, again assuming that the true value of $\theta = .4$, though it is unknown to the person doing the updating via Bayes' Law. **Answer:** -1. Please write down the **likelihood function** and the **posterior** distribution for $\theta$ after observing one flip of our coin. +**a)** Please write down the **likelihood function** and the **posterior** distribution for $\theta$ after observing one flip of our coin. Suppose the outcome is __Y__. @@ -381,7 +381,7 @@ L(Y|\theta)= \textrm{Prob}(X = Y | \theta) = \theta^Y (1-\theta)^{1-Y} $$ -2. Please write the **posterior** distribution for $\theta$ after observing one flip of our coin. +**b)** Please write the **posterior** distribution for $\theta$ after observing one flip of our coin. The prior distribution is @@ -404,9 +404,9 @@ $$ \textrm{Prob}(\theta | Y) \sim \textrm{Beta}(\alpha + Y, \beta + (1-Y)) $$ -3. Please pretend that the true value of $\theta = .4$ and that someone who doesn't know this has a beta prior with $\beta = \alpha = .5$. +**c)** Please pretend that the true value of $\theta = .4$ and that someone who doesn't know this has a beta prior with $\beta = \alpha = .5$. -4. Please write a Python class to simulate this person's personal posterior distribution for $\theta$ for a _single_ sequence of $n$ draws. +**d)** Please write a Python class to simulate this person's personal posterior distribution for $\theta$ for a _single_ sequence of $n$ draws. ```{code-cell} ipython3 class Bayesian: @@ -470,7 +470,7 @@ class Bayesian: self.posterior_list.append(self.form_single_posterior(num)) ``` -5. Please plot the posterior distribution for $\theta$ as a function of $\theta$ as $n$ grows from $1, 2, \ldots$. +**e)** Please plot the posterior distribution for $\theta$ as a function of $\theta$ as $n$ grows from $1, 2, \ldots$. ```{code-cell} ipython3 Bay_stat = Bayesian() @@ -497,7 +497,7 @@ ax.legend(fontsize=11) plt.show() ``` -6. For various $n$'s, please describe and compute $.05$ and $.95$ quantiles for posterior probabilities. +**f)** For various $n$'s, please describe and compute $.05$ and $.95$ quantiles for posterior probabilities. ```{code-cell} ipython3 upper_bound = [ii.ppf(0.05) for ii in Bay_stat.posterior_list[:14]] @@ -513,7 +513,7 @@ interval_df As n increases, we can see that Bayesian coverage intervals narrow and move toward $0.4$. -7. Please tell what question a Bayesian coverage interval answers. +**g)** Please tell what question a Bayesian coverage interval answers. The Bayesian coverage interval tells the range of $\theta$ that corresponds to the [$p_1$, $p_2$] quantiles of the cumulative probability distribution (CDF) of the posterior distribution. @@ -525,7 +525,7 @@ $$ F(a)=p_1,F(b)=p_2 $$ -8. Please compute the Posterior probabililty that $\theta \in [.45, .55]$ for various values of sample size $n$. +**h)** Please compute the Posterior probabililty that $\theta \in [.45, .55]$ for various values of sample size $n$. ```{code-cell} ipython3 left_value, right_value = 0.45, 0.55 @@ -559,7 +559,7 @@ When the number of observations becomes large enough, our Bayesian becomes so co That is why we see a nearly horizontal line when the number of observations exceeds 500. -8. Please use your Python class to study what happens to the posterior distribution as $n \rightarrow + \infty$, again assuming that the true value of $\theta = .4$, though it is unknown to the person doing the updating via Bayes' Law. +**i)** Please use your Python class to study what happens to the posterior distribution as $n \rightarrow + \infty$, again assuming that the true value of $\theta = .4$, though it is unknown to the person doing the updating via Bayes' Law. Using the Python class we made above, we can see the evolution of posterior distributions as n approaches infinity.