| fregre.gls {fda.usc} | R Documentation |
Fit Functional Linear Model Using Generalized Least Squares
Description
This function fits a functional linear model using generalized least squares. The errors are allowed to be correlated and/or have unequal variances.
Usage
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",
...
)
Arguments
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 |
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 |
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
|
verbose |
an optional logical value. If |
criteria |
GCCV criteria, see |
... |
some methods for this generic require additional arguments. None are used in this methodl. |
Value
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.
Beside, 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 forfdataorfdcovariates. -
basis.b:Basis used for beta parameter estimation. -
beta.l:List of estimated beta parameter of functional covariates. -
data:List that containing the variables in the model. -
formula:formula used in ajusted model. -
formula.ini:formula in call. -
W:inverse of covariance matrix -
correlation:See glsObject for the components of the fit.
References
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. doi:10.1371/journal.pone.0194250
Examples
## 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)