logLikFun.norm {spsh}R Documentation

Calculation of the Log-likelihood assuming Identially, Independenzly and Normally Distributed errors

Description

Calculates the i-th log-likelihood of each y-yhat pair as described in (Seber and Wild 2004).

Usage

logLikFun.norm(y, yhat, sigma)

Arguments

y

A vector of n observed properties/variables of interest.

yhat

A vector of n model simulated properties/variables of interest.

sigma

A vector of length 1 considering homoscedastic residuals.

Details

The underlying assumption is, that the model residuals (errors) are independently, and identically distributed (i.i.d.) following a normal distribution. Alternatively consider using dnorm.

Value

log-likelihood value of an normal distribution with N~(0, sigma^2)

Note

The assumption of i.i.d. and normal distribution is best investigated a posteriori.

Author(s)

Tobias KD Weber , tobias.weber@uni-hohenheim.de

References

Seber GAF, Wild CJ (2004). Nonlinear regression, Wiley series in probability and mathematical statistics. Wiley, New York. ISBN 978-0-471-47135-6.

Examples

# homoscedastic residuals
sig.s  <- .01
y.scat <- rnorm(100, 0, sig.s)
yhat   <- (1:100)^1.2
y      <- yhat + y.scat
sum(logLikFun.norm(y, yhat, sig.s))
plot(yhat-y)

[Package spsh version 1.1.0 Index]