Linear models include regression and ANOVA and are widely used to analyse normally distributed data and estimate the effects of terms in the model. Ordinary least squares is equivalent to a maximum likelihood estimation when errors are independent with equal variances. General linear models extend this to the case where errors are not independent and there may be random terms in the model. A mixed linear model containing both fixed and random effects is often a convenient way to estimate both fixed and random effects and their variances. Estimation of the variances of these random terms is used to estimate genetic parameters such as heritability.