Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ jobs:
- name: Check out repository
uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 0 # Fetch full history for git diff

- name: Set up Quarto
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ jobs:
steps:
- name: Check out repository
uses: actions/checkout@v4
with:
submodules: true

- name: Set up Quarto
uses: quarto-dev/quarto-actions/setup@v2
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ MANIFEST

# TeX (LaTeX intermediate files)
*.tex
!macros-pdf.tex
*.aux
*.log
*.toc
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "macros"]
path = macros
url = https://github.com/d-morrison/macros.git
4 changes: 4 additions & 0 deletions _quarto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@ format:
toc: true
number-sections: true
embed-resources: false
include-in-header:
- macros/macros.qmd
pdf:
include-in-header:
- macros-pdf.tex
geometry:
- top=15mm
- bottom=20mm
Expand Down
26 changes: 26 additions & 0 deletions chapter2.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,32 @@ $$
\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 |
Expand Down
1 change: 1 addition & 0 deletions macros
Submodule macros added at 146a61
Loading
Loading