-
Notifications
You must be signed in to change notification settings - Fork 1
/
test.Rmd
92 lines (48 loc) · 3.26 KB
/
test.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
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
---
title: "Statistical_Rethinking_RM"
author: "SM"
date: "`r format(Sys.time(), '%B %d, %Y')`"
format:
html:
toc: true
toc_float: true
toc-title: "Contents"
toc-depth: 5
toc-location: left
number_sections: true
fig_caption: true
code-tools: true
code-fold: true
code-summary: 'Show code'
code-link: true
code_highlight: tango
code_download: true
theme: sandstone
highlight: tango
smooth-scroll: true
mathjax: local
self_contained: false
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
Linear model with n number of predictor variables:
$$\mu_i = \alpha + \beta_1 \text{x}_{1i} + \beta_2 \text{x}_{2i} + ... + \beta_n \text{x}_{ni}$$
![\large \frac{-b\pm\sqrt{b^2-4ac}}{2a}](https://latex.codecogs.com/svg.latex?x%3D%5Cfrac%7B-b%5Cpm%5Csqrt%7Bb%5E2-4ac%7D%7D%7B2a%7D)
wrong
![\large ](https://latex.codecogs.com/svg.latex?\boldsymbol{\gamma = \beta_R + \beta_{AR}(1) = -0.18 + 0.35 = 0.17})
<img src="https://latex.codecogs.com/svg.latex?\dpi{220}\text{Posterior =}\frac{\text{Likelihood x Prior}}{\text{Average Likelihood}}"title="\text{Posterior =}\frac{\text{Likelihood x Prior}}{\text{Average Likelihood}}"/>
<img src="https://latex.codecogs.com/svg.latex?\dpi{110}\text{Posterior} = \frac{\textbf{Likelihood} \times \textbf{Prior}}{\text{Average Likelihood}}" title="\text{Posterior} = \frac{\textbf{Likelihood} \times \textbf{Prior}}{\text{Average Likelihood}}"/>
test
<img src="https://latex.codecogs.com/svg.latex?\inline&space;\dpi{110}\boldsymbol{\begin{align*}h_i &\sim Normal(\mu_i, \sigma) \ &&& height &\sim dnorm(mu, sigma) \\\mu_i &= \alpha + \beta x_i \ &&& mu &\leftarrow a + b \times weight \\\alpha &\sim Normal(178, 100) \ &&& a &\sim dnorm(178, 100)\\\beta &\sim Normal(0, 10) \ &&& b &\sim dnorm(0, 10)\\\sigma &\sim Uniform(0, 50) \ &&& sigma &\sim dunif(0, 50)\\\end{align*}" title="" />
new
<img src="https://latex.codecogs.com/svg.latex?\dpi{110}\inline&space;\dpi{110}\boldsymbol{\begin{align*}Pr(p|w,n) = \frac{Binomial(w|n,p) ~ Uniform(p|0,1)}{\int Binomial(w|n,p) ~ Uniform(p|0,1)dp}\\ \end{align*}" title="" />
<img src="https://latex.codecogs.com/svg.latex?\dpi{110}\mathbf{Posterior} = \frac{\mathbf{Likelihood} \times \mathbf{Prior}}{\mathbf{Average\ Likelihood}}" title="\mathbf{Posterior} = \frac{\mathbf{Likelihood} \times \mathbf{Prior}}{\mathbf{Average\ Likelihood}}"/>
Now since both right-hand sides are equal to the same thing, we can set them equal to one another and solve for the posterior probability: ![](https://latex.codecogs.com/svg.latex?\mathbf{Pr(s|y)} = \frac{\mathbf{Pr(y|s)~Pr(s)}}{\mathbf{Pr(y)}})
![\large](https://latex.codecogs.com/svg.latex?\mathbf{w_i = \frac{exp \left(- \frac{1}{2}dWAIC_i \right)}{\sum_{j=1}^m exp\left(- \frac{1}{2}dWAIC_j \right)}})
mu, sigma symbol
<img src="https://latex.codecogs.com/svg.image?\boldsymbol{\sigma}" title="" />
take
![](https://latex.codecogs.com/svg.latex?\boldsymbol{\mu_i = \alpha + \beta_x x_i + \beta_z Z_i})
<img src="https://latex.codecogs.com/svg.latex?\dpi{110}\textbf{plausibility of p after D}_{\textbf{new}} \boldsymbol{=} \frac{\textbf{ways p can produce D}_{\textbf{new}} \boldsymbol{\times} \textbf{prior plausibility p}}{\textbf{sum of products}}"title="" />
test deployment