gnls(model, data, params, start, correlation, weights, subset, na.action, naPattern, control, verbose)
data is given, all names used in the formula should be defined as parameters or variables in the data frame.
model,
correlation,
weights,
subset, and
naPattern. By default the variables are taken from the environment in which
gnls is called.
p1,...,pn represent parameters included on the right hand side of
model and
x1+...+xm define a linear model for the parameters (when the left hand side of the formula contains several parameters, they are all assumed to follow the same linear model described by the right hand side expression).
A
1 on the right hand side of the formula(s) indicates a single fixed effects for the corresponding parameter(s).
By default, the parameters are obtained from the names of
start.
model. It can be omitted when a
selfStarting function is used in
model, in which case the starting estimates will be obtained from a single call to the
nls function.
corStruct object describing the within-group correlation structure. See the documentation of
corClasses for a description of the available
corStruct classes. If a grouping variable is to be used, it must be specified
in the
form argument to the
corStruct constructor. Defaults to
NULL, corresponding to uncorrelated errors.
varFunc object or one-sided formula describing the within-group heteroscedasticity structure. If given as a formula, it is used as the argument to
varFixed, corresponding to fixed variance weights. See the documentation on
varClasses for a description of the available
varFunc classes. Defaults to
NULL, corresponding to homoscesdatic errors.
data that should be used in the fit. This can be a logical vector, a numeric vector indicating which observation numbers are to be included, or a character vector of the row names to be included. All observations are included by default.
NAs. The default action (
na.fail) causes
gnls to print an error message and terminate if there are any incomplete observations.
gnlsControl. Defaults to an empty list.
TRUE information on the evolution of the iterative algorithm is printed. Default is
FALSE.
gnls, also inheriting from class
gls, representing the nonlinear model fit. Generic functions such as
print,
plot and
summary have methods to show the
results of the fit. See
gnlsObject for the components of the fit. The functions
resid,
coef, and
fitted can be used to extract some of its components.
Box, G.E.P., Jenkins, G.M., and Reinsel G.C. (1994). Time Series Analysis: Forecasting and Control (3rd Edition). San Francisco: Holden-Day.
Carrol, R.J. and Ruppert, D. (1988). Transformation and Weighting in Regression. New York: Chapman and Hall.
Davidian, M. and Giltinan, D.M. (1995). Nonlinear Mixed Effects Models for Repeated Measurement Data. London: Chapman and Hall.
Littel, R.C., Milliken, G.A., Stroup, W.W., and Wolfinger, R.D. (1996). SAS Systems for Mixed Models. Cary, North Carolina: SAS Institute, Inc.
Venables, W.N. and Ripley, B.D. (1997). Modern Applied Statistics with S-PLUS (2nd Edition). New York: Springer-Verlag.
The different correlation structures available for the
correlation argument are described in Box, Jenkins, and Reinsel (1994), Littel, Milliken, Stroup, and Wolfinger (1996), and Venables and Ripley (1997). The use of variance functions for linear and nonlinear models is presented in detail in Carrol and Ruppert (1988), and Davidian and Giltinan (1995).
# variance increases with a power of the absolute fitted values
fm1 <- gnls(weight ~ SSlogis(Time, Asym, xmid, scal), Soybean,
weights = varPower())
# errors follow an auto-regressive process of order 1
fm2 <- gnls(weight ~ SSlogis(Time, Asym, xmid, scal), Soybean,
correlation = corAR1())