bias-variance.R: This script takes small samples from a Gaussian where one variable is a good predictor of another, and a third variable is irrelevant to either. We train OLS and ridge regression on each sample.

gibbs.R: An example of a Gibbs sampler for a simple mixture of two Gaussians.

factor-analysis.R: Examples of PCA and factor analysis.

glmexamples.R: GLMs for binary and non-negative count data. We start with logistic and probit regression, then introduce Poisson regression. This script also shows examples of overdispersion, including a zero-inflated Poisson model.

kalmanfilter.R: A first and second order dynamic linear model for estimating the daily mean high temperature from 11 months of observations. This example requires the "dlm" R package.

poisson-em.R: An implementation of the EM algorithm for a mixture of Poissons.

posteriors.R: Examples of Bayesian conjugate prior pairs for binary, count, and real-valued variables, using beta-binomial, gamma-Poisson, and normal-normal models, respectively.