Learn R Programming

spsh (version 1.1.0)

logLikFun.norm: 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.2004spsh.

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.

Value

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

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.

References

Seber.2004spsh

Examples

Run this code
# NOT RUN {
# 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)
# }

Run the code above in your browser using DataLab