-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathlab_week_04.Rmd
38 lines (21 loc) · 1.57 KB
/
lab_week_04.Rmd
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
---
title: "EEEB UN3005/GR5005 \nLab - Week 04 - 17 and 19 February 2020"
author: "USE YOUR NAME HERE"
output: pdf_document
fontsize: 12pt
---
```{r setup, include = FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
# Bayesian Basics
## Exercise 1: Applying Bayes' Theorem using Grid Approximation
Imagine if the series of observations in the globe tossing example from the *Statistical Rethinking* text and class were: W L W W, where "W" corresponds to water and "L" corresponds to land.
With this set of observations, use grid approximation (with 11 grid points) to construct the posterior for the parameter *p* (the proportion of water on the globe). Assume a flat prior for *p*.
Plot the posterior distribution.
```{r}
```
## Exercise 2: Thinking Deeper with Bayes' Theorem
Suppose in the globe tossing scenario there are actually two globes, one for Earth and one for Mars. The Earth globe is 30% land. The Mars globe is 100% land. Further suppose that one of these globes—-you don’t know which—-was tossed in the air and produced a “land” observation. Assume that each globe was equally likely to be tossed. Show that the posterior probability that the globe was Earth, conditional on seeing “land” (Pr(Earth|land)), is 0.23.
Note, this problem might seem like it has a lot of information to consider, but it is actually a direct application of Bayes' Theorem. If you're having problems getting started, write out Bayes' Theorem. Also, R is not strictly necessary for this problem. You could do the math by hand, so R is really just a glorified calculator here.
```{r}
```