logLik.gsl_nls: Extract model log-likelihood

View source: R/nls_methods.R

logLik.gsl_nlsR Documentation

Extract model log-likelihood

Description

Returns the model log-likelihood of a fitted "gsl_nls" object.

Usage

## S3 method for class 'gsl_nls'
logLik(object, REML = FALSE, ...)

Arguments

object

An object inheriting from class "gsl_nls".

REML

logical value; included for compatibility reasons only, should not be used.

...

At present no optional arguments are used.

Value

Numeric object of class "logLik" identical to logLik.

See Also

logLik

Examples

## data
set.seed(1)
n <- 25
xy <- data.frame(
  x = (1:n) / n,
  y = 2.5 * exp(-1.5 * (1:n) / n) + rnorm(n, sd = 0.1)
)
## model
obj <- gsl_nls(fn = y ~ A * exp(-lam * x), data = xy, start = c(A = 1, lam = 1))

logLik(obj)

gslnls documentation built on May 29, 2024, 4:41 a.m.