coef.gsl_nls: Extract model coefficients

View source: R/nls_methods.R

coef.gsl_nlsR Documentation

Extract model coefficients

Description

Returns the fitted model coefficients from a "gsl_nls" object. coefficients can also be used as an alias.

Usage

## S3 method for class 'gsl_nls'
coef(object, ...)

Arguments

object

An object inheriting from class "gsl_nls".

...

At present no optional arguments are used.

Value

Named numeric vector of fitted coefficients similar to coef

See Also

coef

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

coef(obj)

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

Related to coef.gsl_nls in gslnls...