Nonlinear Regression

Usage

nlr(y, mu=NULL, p=NULL, dist="normal", wt=1, delta=1,
print.level=0, typsiz=abs(p), ndigit=10, gradtol=0.00001,
stepmax=10*sqrt(p%*%p), steptol=0.00001, iterlim=100, fscale=1)

Arguments

y The response vector.
mu A function of p giving the regression equation for the mean.
p Vector of initial estimates of the parameters.
dist The distribution to be used: normal, gamma, or inverse Gauss.
wt Weight vector.
delta Scalar or vector giving the unit of measurement for each response value, set to unity by default. For example, if a response is measured to two decimals, delta=0.01. If the response is transformed, this must be multiplied by the Jacobian. For example, with a log transformation, delta=1/y.
others Arguments controlling nlm.

Description

nlr fits a user-specified nonlinear regression equation by least squares (normal) or its generalization for the gamma and inverse Gauss distributions.

Value

A list of class nlr is returned. The printed output includes the -log likelihood (not the deviance), the corresponding AIC, the parameter estimates, standard errors, and correlations. A list is returned that contains all of the relevant information calculated, including error codes.

See Also

lm, glm, glmm, gnlmm, gnlr, gnlr3, fmr.

Examples

# linear regression
mu1 <- function(p) p[1]+p[2]*x
summary(lm(y~x))
nlr(y,mu=mu1,p=c(3,2))
# nonlinear regression
mu2 <- function(p) p[1]+p[2]*x^p[3]
nlr(y,mu=mu2,p=c(3,2,1))


[Package Contents]