Learn R Programming

onls (version 0.1-2)

logLik_o: Log-Likelihood for the orthogonal residuals

Description

Returns the log-likelihood as calculated from the orthogonal residuals obtained by residuals_o.

Usage

logLik_o(object)

Value

The log-likelihood as calculated from the orthogonal residuals.

Arguments

object

an object returned from onls.

Author

Andrej-Nikolai Spiess

Examples

Run this code
DNase1 <- subset(DNase, Run == 1)
DNase1$density <- sapply(DNase1$density, function(x) rnorm(1, x, 0.1 * x))
mod <- onls(density ~ Asym/(1 + exp((xmid - log(conc))/scal)), 
             data = DNase1, start = list(Asym = 3, xmid = 0, scal = 1))
logLik_o(mod)

## compare AIC of vertical versus orthogonal residuals.
AIC(mod)
AIC(logLik_o(mod))

Run the code above in your browser using DataLab