Skip to contents

Takes in a vector of observations and a vector of fixed means (predictions) and returns the maximum likelihood estimate of the variance. With a fixed mean, the MLE for variance is simply the mean squared error.

Usage

fit_normal(x, mu)

Arguments

x

Vector of observed values.

mu

Vector of expected values (fixed means).

Value

The maximum likelihood estimate of the variance (sigma^2).

See also

Other estimate_observation_error: fit_skellam()

Examples

obs <- c(4, 8, 10)
pred <- c(3.1, 7.2, 11)
variance <- fit_normal(obs, pred)
variance
#> [1] 0.8166667