** Technically, the probability of any single value in a continuous variable is 0. But, we can think of a small neighborhood around each value instead.
PDFs: Like histograms shrinking binwidth to (very close to) 0… but the math is complicated.
\(P(x = a) = 0\) if \(x\) is continuously distributed
\(P(a <= x < b)\) is what we work with
| Command | What it does |
|---|---|
rnorm(n, mean = 0, sd = 1) |
\(n\) random numbers |
dnorm(x, mean = 0, sd = 1) |
normal density at \(x\) |
pnorm(q, mean = 0, sd = 1) |
\(P(x \leq q)\) (CDF value) |
qnorm(p, mean = 0, sd = 1) |
\(P(x \leq q) = p\) (solves for \(q\)) This is the quantile function |
Other distribution types exist: Exponential, Gamma, Beta, t, F…
They all follow the rXXX, dXXX, pXXX, qXXX pattern (but have different parameters)
