6 Day 6 (February 6)
6.1 Announcements
Please read (and re-read) Ch. 4 and 6 in BBM2L book.
Final project is posted
Questions about activity 2?
Selected questions/clarifications from journals
- Statistical significance, p-values, and other stuff
- Learning to focus on the important things
- Selecting the best model/distribution
6.2 Building our first statistical model
- The backstory
- Building a statistical model using a Bayesian approach
- Specify (write out) the likelihood/data model
- Specify the parameter model (or prior) including hyper-parameters
- Select an approach to obtain the posterior distribution
- Analytically (i.e., pencil and paper)
- Deterministic numerical algorithm
- Simulation-based or stochastic algorithm (e.g., Metropolis-Hastings, MCMC, importance sampling, ABC, etc)
6.3 Monte Carlo Integration
Deterministic vs stochastic methods to approximate integrals
- Work well for high-dimensional multiple integrals
- Easy to program
Monte Carlo integration
- \[\begin{eqnarray} \text{E}(g(y)) &=& \int g(y)[y|\theta]dy\\ &\approx& \frac{1}{Q}\sum_{q=1}^{Q}g(y_q) \end{eqnarray}\]
- Examples:
- \[\text{E}(y) = \int_{-\infty}^\infty y\frac{1}{\sqrt{2\pi\sigma^2}}\textit{e}^{-\frac{1}{2\sigma^2}(y - \mu)^2}dy\]
## [1] 1.997254
- \[\text{E}((y-\mu)^2) = \int_{-\infty}^\infty (y-\mu)^2\frac{1}{\sqrt{2\pi\sigma^2}}\textit{e}^{-\frac{1}{2\sigma^2}(y - \mu)^2}dy\]
## [1] 9.001411
- \[\text{E}(\frac{1}{y} ) = \int_{-\infty}^\infty \frac{1}{y}\frac{1}{\sqrt{2\pi\sigma^2}}\textit{e}^{-\frac{1}{2\sigma^2}(y - \mu)^2}dy\]
## [1] -0.5539893
Questions about activity 2?
Live example using bat model