Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct answers about sigma in ch4 lin reg #220

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions Rethinking_2/End_of_chapter_problems/Chapter_4.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,10 @@
},
{
"cell_type": "markdown",
"metadata": {},
"metadata": {
"jp-MarkdownHeadingCollapsed": true,
"tags": []
},
"source": [
"### 4M2.\n",
"Translate the model just above into a quap formula.\n",
Expand Down Expand Up @@ -188,7 +191,7 @@
"\n",
"$\\beta$ ~ $logN(0,1)$ #It seems perfectly sensible that the amount an average student's height changes per year should only be positive. Additionally, I have no idea what the growth rate is so this enocodes ignorance about the rate of change of height per year\n",
"\n",
"$\\sigma$ ~ $Unif(0,50)$"
"$\\sigma$ ~ $Unif(0,0.5)$ #This is the standard deviation of height, at a given age and expected height. This cannot conceivably be more than 1 metre. Half is a more sensible upper bound."
]
},
{
Expand All @@ -215,7 +218,9 @@
"more than 64cm. How does this lead you to revise your priors?\n",
"\n",
"#### Answer \n",
"This would cause me to use an even larger range of plausable values in my prior for $\\sigma$. Given my assumption for the students ages, increasing the range seems to be not sensible for the data at hand.\n",
"A maximum variance ($\\sigma^2$) can be enforced through an upper bound on the prior for $\\sigma$, set to $\\sqrt(64) = 8$ cm, or 0.08 m. Therefore the prior becomes\n",
"\n",
"$\\sigma$ ~ $Unif(0,0.08)$\n",
"\n",
"### 4M7.\n",
"\n",
Expand Down Expand Up @@ -1621,9 +1626,7 @@
{
"cell_type": "code",
"execution_count": 43,
"metadata": {
"scrolled": false
},
"metadata": {},
"outputs": [
{
"name": "stderr",
Expand Down Expand Up @@ -1714,7 +1717,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.5"
"version": "3.10.6"
}
},
"nbformat": 4,
Expand Down