This function fits iteratively a functional linear model using generalized least squares. The errors are allowed to be correlated and/or have unequal variances.
Begin with a preliminary estimation of \(\hat{\theta}=\theta_0\) (for instance, \(\theta_0=0\)). Compute \(\hat{W}\).
Estimate \(b_\Sigma =(Z'\hat{W}Z)^{-1}Z'\hat{W}y\)
Based on the residuals, \(\hat{e}=\left(y-Zb_\Sigma \right)\), update \(\hat{\theta}=\rho\left({\hat{e}}\right)\) where \(\rho\) depends on the dependence structure chosen.
Repeats steps 2 and 3 until convergence (small changes in \(b_\Sigma \) and/or \(\hat{\theta}\)).
fregre.igls(formula,data,basis.x=NULL,basis.b=NULL,
correlation,maxit=100,rn,lambda,weights=rep(1,n),
control,…)
a two-sided linear formula object describing the
model, with the response on the left of a ~
operator and the
terms, separated by +
operators, on the right.
an optional data frame containing the variables named in
model
, correlation
, weights
, and
subset
. By default the variables are taken from the
environment from which gls
is called.
List of basis for functional explanatory data estimation.
List of basis for \(\beta(t)\) parameter estimation.
List of Ridge parameter.
List of Roughness penalty parameter.
an optional 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.
Number of maximum of interactions.
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 NULL
, corresponding to homoscedastic
errors.
a list of control values for the estimation algorithm to
replace the default values returned by the function glsControl
.
Defaults to an empty list.
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.
Beside, the class(z) is "gls", "lm" and "fregre.lm" with the following objects:
Residual variance.
Estimated covariance matrix for the parameters.
A roughness penalty.
Basis used for fdata
or fd
covariates.
Basis used for beta parameter estimation.
List of estimated beta parameter of functional covariates.
List that containing the variables in the model.
formula used in ajusted model.
formula in call.
desing matrix
inverse of covariance matrix
rn
See glsObject for the components of the fit.
Oviedo de la Fuente, M., Febrero-Bande, M., Pilar Munoz, and Dominguez, A. Predicting seasonal influenza transmission using Functional Regression Models with Temporal Dependence. arXiv:1610.08718. https://arxiv.org/abs/1610.08718
# NOT RUN {
# }
# 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))
ldata=list("df"=dataf,"x.d2"=x.d2)
res.gls=fregre.igls(Fat~x.d2,data=ldata,
correlation=list("cor.ARMA"=list()),control=list("p"=1))
res.gls
res.gls$corStruct
# }
Run the code above in your browser using DataLab