-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathchapter2.qmd
More file actions
78 lines (47 loc) · 2.2 KB
/
chapter2.qmd
File metadata and controls
78 lines (47 loc) · 2.2 KB
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
# Chapter 2: Advanced Topics
This is the second chapter. Continue building your book with more chapters.
## Mathematical Equations
You can include mathematical equations using LaTeX syntax:
Inline equation: $E = mc^2$
Display equation:
$$
\int_{-\infty}^{\infty} e^{-x^2} dx = \sqrt{\pi}
$$
## Custom Macros
This book uses the [`d-morrison/macros`](https://github.com/d-morrison/macros) submodule to provide convenient LaTeX shorthand for statistical and mathematical notation.
### Probability and Distributions
The normal distribution $\Normal\paren{\m, \ss}$ can be written using macros as `$\Normal\paren{\m, \ss}$`, where `\m` expands to $\mu$ and `\ss` expands to $\sigma^2$.
A random variable $X \dist \Normal\paren{\mu, \sigma^2}$ has expectation $\E{X} = \mu$ and variance $\Var{X} = \sigma^2$.
### Regression Notation
In linear regression, we estimate $\vbeta$ using ordinary least squares. The fitted values are $\hy = \mX \hb$, where $\hb = \inv{\mX' \mX} \mX' \vy$.
The standard error of $\hb$ is $\hse{\hb} = \hs \sqrt{\inv{\mX' \mX}}$.
### Likelihood and Estimation
The log-likelihood function $\llik(\th)$ is maximized at the MLE $\hth_{\text{ML}}$.
The score function is $\score(\th) = \deriv{\th} \llik(\th)$ and the observed information is $\oinf(\th) = -\hess(\th)$.
### Logistic Regression
The logit link function is $\logitf{\pi} = \logt\paren{\frac{\pi}{1 - \pi}}$ and its inverse is $\expitf{\eta} = \frac{e^\eta}{1 + e^\eta}$.
## Tables
| Column 1 | Column 2 | Column 3 |
|----------|----------|----------|
| Data 1 | Data 2 | Data 3 |
| Data 4 | Data 5 | Data 6 |
: Example table caption {#tbl-example}
## Figures
You can include images by placing them in the `images/` directory:
```markdown
{#fig-example}
```
Then reference the figure in text using `@fig-example`.
## Callouts
::: {.callout-note}
This is a note callout. Use it to highlight important information.
:::
::: {.callout-tip}
This is a tip callout. Share helpful suggestions with your readers.
:::
::: {.callout-warning}
This is a warning callout. Alert readers to potential issues.
:::
::: {.callout-important}
This is an important callout. Emphasize critical information.
:::