Learn R Programming

OptimModel (version 2.0-1)

residuals.optim_fit: Residuals for optim.fit objects

Description

Provides raw and studentized residuals for optim_fit objects.

Usage

# S3 method for optim_fit
residuals(object, type=c("raw", "studentized"),...)

Value

Returns a numeric vector.

Arguments

object

An object resulting from optim.fit().

type

'raw' or 'studentized' residuals.

...

mop up additional arguments.

Author

Steven Novick

See Also

optim_fit

Examples

Run this code
set.seed(123)

x = rep( c(0, 2^(-4:4)), each=4 )
theta = c(0, 100, log(.5), 2)
y1 = hill_model(theta, x) + rnorm( length(x), sd=2 )

fit1=optim_fit(theta, hill_model, x=x, y=y1)
residuals(fit1)
residuals(fit1, type="s")

Run the code above in your browser using DataLab