quantchem (version 0.13)

derivative: Derivative of fitted polynomial

Description

Calculate derivative of polynomial for given x.

Usage

derivative(obj, x)

Arguments

obj
an object of class 'lm', fitted in y ~ x + I(x^2) + I(x^3) + ... way.
x
a vector of x values

Value

A vector of calculated derivatives.

Details

This function is called via the other high level functions, but it can be also called directly.

See Also

lm

Examples

x = 1:10
y = jitter(x+x^2)
fit = lm(y~x+I(x^2))
derivative(fit,1:10)