fregre.gls | R Documentation |
This function fits a functional linear model using generalized least squares. The errors are allowed to be correlated and/or have unequal variances.
fregre.gls(
formula,
data,
correlation = NULL,
basis.x = NULL,
basis.b = NULL,
rn,
lambda,
weights = NULL,
subset,
method = c("REML", "ML"),
control = list(),
verbose = FALSE,
criteria = "GCCV1",
...
)
formula |
a two-sided linear formula object describing the model, with
the response on the left of a |
data |
an optional data frame containing the variables named in
|
correlation |
an optional corStruct object describing the
within-group correlation structure. See the documentation of
corClasses for a description of the available |
basis.x |
List of basis for functional explanatory data estimation. |
basis.b |
List of basis for |
rn |
List of Ridge parameter. |
lambda |
List of Roughness penalty parameter. |
weights |
an optional 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 |
subset |
an optional expression indicating which subset of the rows of
|
method |
a character string. If |
control |
a list of control values for the estimation algorithm to replace the default values returned by the function glsControl. Defaults to an empty list. |
verbose |
an optional logical value. If |
criteria |
GCCV criteria, see |
... |
some methods for this generic require additional arguments. None are used in this method. |
An object of class "gls"
representing the functional linear
model fit. Generic functions such as print
, plot
, and
summary
have methods to show the results of the fit.
See glsObject for the components of the fit. The functions
resid
, coef
, and fitted
can be
used to extract some of its components.
Besides, the class(z) is "gls", "lm", and "fregre.lm" with the following
objects:
sr2
: Residual variance.
Vp
: Estimated covariance matrix for the parameters.
lambda
: A roughness penalty.
basis.x
: Basis used for fdata
or fd
covariates.
basis.b
: Basis used for beta parameter estimation.
beta.l
: List of estimated beta parameter of functional covariates.
data
: List containing the variables in the model.
formula
: Formula used in the adjusted model.
formula.ini
: Formula in call.
W
: Inverse of covariance matrix.
correlation
: See glsObject
for the components of the fit.
Oviedo de la Fuente, M., Febrero-Bande, M., Pilar Munoz, and Dominguez, A. (2018). Predicting seasonal influenza transmission using functional regression models with temporal dependence. PloS one, 13(4), e0194250. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1371/journal.pone.0194250")}
## Not run:
data(tecator)
x=tecator$absorp.fdata
x.d2<-fdata.deriv(x,nderiv=)
tt<-x[["argvals"]]
dataf=as.data.frame(tecator$y)
# plot the response
plot(ts(tecator$y$Fat))
nbasis.x=11;nbasis.b=7
basis1=create.bspline.basis(rangeval=range(tt),nbasis=nbasis.x)
basis2=create.bspline.basis(rangeval=range(tt),nbasis=nbasis.b)
basis.x=list("x.d2"=basis1)
basis.b=list("x.d2"=basis2)
ldata=list("df"=dataf,"x.d2"=x.d2)
res.gls=fregre.gls(Fat~x.d2,data=ldata, correlation=corAR1(),
basis.x=basis.x,basis.b=basis.b)
summary(res.gls)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.