\[\Large L(H | D) = p(D | H)\]
Where the D is the data and H is the hypothesis (model) including a both a data generating process with some choice of parameters (aften called \(\theta\)). The error generating process is inherent in the choice of probability distribution used for calculation.
Let’s say we have counted 10 individuals in a plot. Given that the population is Poisson distributed, what is the value of \(\lambda\)?
\[\Large p(x) = \frac{\lambda^{x}e^{-\lambda}}{x!}\]
Compare \(p(D|\theta_{1})\) versus \(p(D|\theta_{2})\)
\[\LARGE G = \frac{L(H_1 | D)}{L(H_2 | D)}\]
\[G = \frac{L(\lambda = 14 | D)}{L(\lambda = 17 | D)}\]
=0.0494634
\[D = 2 [Log(L(\lambda = 14 | D)) - Log(L(\lambda = 17 | D))]\] =6.0130449 with 1DF
p =0.01
Data Generating Process:
\[Visits \sim Resemblance\]Error Generating Process:
\[\Large Visits_i = \beta_0 + \beta_1 Resemblance_i + \epsilon_i\]
\[\Large \epsilon_i \sim N(0, \sigma)\]
\[L(\theta_j | Data) = \prod_{i=1}^n \mathcal{N}(Visits_i\; |\; \beta_{0j} + \beta_{1j} Resemblance_i, \sigma_j)\]
where \(\beta_{0j}, \beta_{1j}, \sigma_j\) are elements of \(\theta_j\)
library(bbmle)
puffer_mle <- mle2(predators ~ dnorm(b0 + b1*resemblance, sd = resid_sd),
data=puffer,
start=list(b0=1, b1=1, resid_sd = 2))
Are these nice symmetric slices?
term | estimate | std.error | statistic | p.value |
---|---|---|---|---|
b0 | 1.924604 | 1.4291143 | 1.346711 | 0.1780732 |
b1 | 2.989502 | 0.5420939 | 5.514730 | 0.0000000 |
resid_sd | 2.896527 | 0.4579823 | 6.324540 | 0.0000000 |
Test Statistic is a Wald Z-Test Assuming a well behaved quadratic Confidence Interval
Quadratic Assumption
2.5 % | 97.5 % | |
---|---|---|
b0 | -1.016771 | 4.866158 |
b1 | 1.873731 | 4.105253 |
resid_sd | 2.187663 | 4.092085 |
Spline Fit to Likelihood Surface
2.5 % | 97.5 % | |
---|---|---|
b0 | -1.016771 | 4.866158 |
b1 | 1.873731 | 4.105253 |
resid_sd | 2.187663 | 4.092085 |
puffer_null_mle <- mle2(predators ~ dnorm(b0, sd = resid_sd),
data=puffer,
start=list(b0=14, resid_sd = 10))
Likelihood Ratio Tests
Model 1: puffer_mle, predators~dnorm(b0+b1*resemblance,sd=resid_sd)
Model 2: puffer_null_mle, predators~dnorm(b0,sd=resid_sd)
Tot Df Deviance Chisq Df Pr(>Chisq)
1 3 99.298
2 2 117.788 18.49 1 1.708e-05 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Likelihood:
term | estimate | std.error | statistic | p.value |
---|---|---|---|---|
b0 | 1.924604 | 1.4291143 | 1.346711 | 0.1780732 |
b1 | 2.989502 | 0.5420939 | 5.514730 | 0.0000000 |
resid_sd | 2.896527 | 0.4579823 | 6.324540 | 0.0000000 |
Least Squares
term | estimate | std.error | statistic | p.value |
---|---|---|---|---|
(Intercept) | 1.924694 | 1.5064163 | 1.277664 | 0.2176012 |
resemblance | 2.989492 | 0.5714163 | 5.231724 | 0.0000564 |
Likelihood:
term | estimate | std.error | statistic | p.value |
---|---|---|---|---|
b0 | 1.924604 | 1.4291143 | 1.346711 | 0.1780732 |
b1 | 2.989502 | 0.5420939 | 5.514730 | 0.0000000 |
resid_sd | 2.896527 | 0.4579823 | 6.324540 | 0.0000000 |
Least Squares
Df | Sum Sq | Mean Sq | F value | Pr(>F) | |
---|---|---|---|---|---|
resemblance | 1 | 255.1532 | 255.153152 | 27.37094 | 5.64e-05 |
Residuals | 18 | 167.7968 | 9.322047 | NA | NA |