-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path5.1-SimModel_Intro.qmd
114 lines (79 loc) · 3.21 KB
/
5.1-SimModel_Intro.qmd
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
---
title: "Simulation Modeling"
subtitle: "Introduction"
author:
- Elizabeth King
- Kevin Middleton
format:
revealjs:
theme: [default, custom.scss]
standalone: true
self-contained: true
logo: QMLS_Logo.png
slide-number: true
show-slide-number: all
code-annotations: hover
bibliography: Randomization.bib
csl: evolution.csl
---
## This Week
- Simulating data for inference
- Introduction to simulation modeling
- Simulating null distributions: Beyond only sampling error
- Approximate Bayesian Computation
- Genetic Algorithms
## Models {.smaller}
```{r}
#| label: setup
#| echo: false
#| warning: false
#| message: false
library(tidyverse)
library(cowplot)
library(viridis)
library(tictoc)
ggplot2::theme_set(theme_cowplot(font_size = 18))
set.seed(89796)
```
Models are simplifications of reality that help us to understand some aspect of our world
>All models are false, but some are useful
- George Box
>Models do not investigate nature. Instead, they investigate the validity of our own thinking, i.e. whether the logic behind an argument is correct. ... Once one begins to think of models as ‘thinking aids’ rather than investigations of natural phenomena, one could even go as far as to say that we only need models because our brains suffer from too many limitations, and are not able to consider all sides of a complicated argument in a balanced way.
- Hannah Kokko in [Modelling for Field Biologists and Other Interesting People](https://www.cambridge.org/core/books/modelling-for-field-biologists-and-other-interesting-people/98929D784764A2B409411AC073878819)
## Generality vs Realism
Making a model is like making a map
{width=100% fig-align="center"}
## Models tell you what will occur *if the model's assumptions are true*
If:
- there is no difference in two groups
- the variable of interest is normally distributed
- you randomly sample 20 from each group
Then:
- you can predict exactly what outcomes will occur with some probability
## Types of Models
- Analytical models
- Simulation models
## Statistical Inference as Modeling
Remember the Goal of Statistics
> "a way of taming **uncertainty**, of turning raw **data** into arguments that can resolve profound questions" [@Amabile1989-pf]
- The statistical analyses that you carry out are *models*.
- Inference depends on evaluating the relative support for different models.
## Example: Wing Dimorphic Crickets
> Do long-winged crickets have a higher resting metabolic rate than short-winged crickets?
:::: {.columns}
::: {.column width="50%"}
<img src="https://i.imgur.com/kgPmw0b.jpg" width="100%" />
:::
::: {.column width="50%"}
Controlling for body mass,
- Metabolic rates do not differ
- Average metabolic rate of long-wings is higher
- Average metabolic rate of long-wings is lower
:::
::::
## Statistical Inference as Modeling
Many problems are more easily (or possibly) solved without a traditional likelihood
1. Simulate your own null distribution to test your hypothesis
2. Sample from distributions and compare to observed values (Approximate Bayesian Computation)
3. Generate "populations" of parameters and let them "evolve" across generations (Genetic Algorithm)
## References