This repository has been archived by the owner on Sep 30, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 41
/
Copy path2018-02-21 Small Worlds and Large Worlds.Rpres
157 lines (123 loc) · 3.28 KB
/
2018-02-21 Small Worlds and Large Worlds.Rpres
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
Small Worlds and Large Worlds
========================================================
author: schifferl
date: February 21, 2018
width: 1440
height: 950
McElreath, R. *Statistical Rethinking: A Bayesian Course with Examples in R and
Stan*. (CRC Press/Taylor & Francis Group, 2016).
Small worlds and large worlds
========================================================
incremental: true
<br>
<br>
<p style="width: 100%; text-align: center;">
<img src="figures/figure_2.1.jpg">
</p>
***
<br>
<br>
<p style="width: 100%; text-align: center;">
<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/2/2c/North_America_from_low_orbiting_satellite_Suomi_NPP.jpg/768px-North_America_from_low_orbiting_satellite_Suomi_NPP.jpg">
</p>
A bag of four marbles
========================================================
incremental: true
<br>
<br>
- Consider a bag of four marbles
- Marbles are either blue or white
- Divine all possible combinations
- Call these *conjectures*
***
<br>
<br>
- Consider the 1 blue, 3 white conjecture
- Draw three times with replacement
- How many ways to produce:
- Blue, white, blue
A bag of four marbles
========================================================
incremental: true
<br>
<br>
<p style="width: 100%; text-align: center;">
<img src="figures/figure_2.2.png">
</p>
***
<br>
<br>
<p style="width: 100%; text-align: center;">
<img src="figures/figure_2.3.png">
</p>
A bag of four marbles
========================================================
incremental: true
<br>
<br>
<p style="width: 100%; text-align: center;">
<img src="figures/figure_2.X.png">
</p>
<br>
<p style="width: 100%; text-align: center;">
<img src="figures/figure_2.Y.png">
</p>
<br>
```{r}
ways <- c(0, 3, 8, 9, 0)
ways / sum(ways)
```
Definitions
========================================================
incremental: true
<br>
<br>
Parameter - An index of possible explanations
<br>
Likelihood - Relative number of ways to produce a parameter
<br>
Prior Probability - Prior plausibility of produce specific value of a parameter
<br>
Posterior Probability - Updated plausibility of a parameter given observations
Globe toss
========================================================
incremental: true
<br>
<br>
<p style="width: 100%; text-align: center;">
<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/2/2c/North_America_from_low_orbiting_satellite_Suomi_NPP.jpg/768px-North_America_from_low_orbiting_satellite_Suomi_NPP.jpg">
</p>
Globe toss
========================================================
incremental: true
- Model (story)
- Update (prior)
- Evaluate (BIC)
Globe toss
========================================================
incremental: true
<p style="width: 100%; text-align: center;">
<img src="figures/figure_2.5.png">
</p>
Bayes' theorem
========================================================
incremental: true
<br>
<br>
<p style="width: 100%; text-align: center;">
<img src="figures/figure_2.A.png">
</p>
<br>
<p style="width: 100%; text-align: center;">
<img src="figures/figure_2.B.png">
</p>
Condition Priors
========================================================
incremental: true
- Given your data, construct a prior
- Produce a likelihood for a parameter
- Calculate a posterior
***
- Grid approximation
- Quadratic approximation
- Markov chain Monte Carlo