cooks.distance.gsl_nls: Calculate Cook's distance

View source: R/nls_methods.R

cooks.distance.gsl_nlsR Documentation

Calculate Cook's distance

Description

Returns Cook's distance values from a fitted "gsl_nls" object based on the estimated variance-covariance matrix of the model parameters.

Usage

## S3 method for class 'gsl_nls'
cooks.distance(model, ...)

Arguments

model

An object inheriting from class "gsl_nls".

...

At present no optional arguments are used.

Value

Numeric vector of Cook's distance values similar to cooks.distance.

See Also

cooks.distance

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))

cooks.distance(obj)

gslnls documentation built on April 3, 2025, 8:59 p.m.