more work
This commit is contained in:
23
R/ch2.qmd
23
R/ch2.qmd
@@ -543,4 +543,27 @@ are likelihoods. We are determining how likely each value of
|
||||
$\pi$ is given that we have observed $Y = 1$.
|
||||
:::
|
||||
|
||||
We can formalize the likelihood function $L$ in our example
|
||||
as follows:
|
||||
|
||||
$$L(\pi|y=1) = f(y=1|\pi) = {6 \choose 1}\pi^1(1-\pi)^{6-1}$$
|
||||
$$ = 6\pi(1 - \pi)^5$$
|
||||
|
||||
We can test this out
|
||||
|
||||
```{r}
|
||||
6 * .2 * (.8 ^ 5)
|
||||
```
|
||||
which is the value we get as .2 in the bar plot above.
|
||||
|
||||
the likelihood values for $Y = 1$ are here:
|
||||
|
||||
```{r}
|
||||
d |>
|
||||
filter(ys == 1)|>
|
||||
select(-display_pi) |>
|
||||
knitr::kable()
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user