normll: Normal - Log-Likelihood

Description Usage Arguments Details Author(s) References See Also

View source: R/norm.R

Description

Calculates the log-likelihood of X following a normal distribution.

Usage

1
normll(mu, sigma, x, neg = TRUE)

Arguments

mu

Numeric. Location parameter mean μ.

sigma

Numeric. Positive number. Scale parameter standard deviation σ = √{σ^2}.

x

Numeric vector. Values of the random variable X.

neg

Logical. If TRUE, returns, negative log-likelihood.

Details

The natural log of the likelihood function for the normal (or Gaussian or Gauss or Laplace–Gauss) distribution is given by

\ln \mathcal{L} ≤ft( μ, σ^2 \mid x \right) = \mathcal{l} ≤ft( μ, σ^2 \mid x \right) \\ \mathcal{l} ≤ft( μ, σ^2 \mid x \right) = \ln ≤ft\{ ≤ft( \frac{1}{√{2 π σ^2}} \right)^n \exp ≤ft[ - \frac{1}{2 σ^2} ∑_{i = 1}^{n} ≤ft( x_i - μ \right)^2 \right] \right\} \\ = - \frac{n}{2} \ln 2 π σ^2 - \frac{1}{2 σ^2} ∑_{i = 1}^{n} ≤ft( x_i - μ \right)^2 . %(\#eq:dist-normll)

with independent and identically distributed sample data x \in \mathbf{R}, μ is the location parameter mean being estimated ≤ft( μ \in \mathbf{R} \right), and σ^2 is the scale parameter variance being estimated ≤ft( σ^2 > 0 \right).

The negative log-likelihood is given by

- \mathcal{l} ≤ft( μ, σ^2 \mid x \right) = - ≤ft[ - \frac{n}{2} \ln 2 π σ^2 - \frac{1}{2 σ^2} ∑_{i = 1}^{n} ≤ft( x_i - μ \right)^2 \right] \\ = \frac{n}{2} \ln 2 π σ^2 + \frac{1}{2 σ^2} ∑_{i = 1}^{n} ≤ft( x_i - μ \right)^2 . %(\#eq:dist-normnegll)

Author(s)

Ivan Jacob Agaloos Pesigan

References

Wikipedia: Normal Distribution

Wikipedia: IID

Wikipedia: Likelihood Function

See Also

Other normal likelihood functions: norm2ll(), normL(), normobj(), normpdf()


jeksterslabds/jeksterslabRdist documentation built on Aug. 9, 2020, 7:33 a.m.