Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

fregre.igls

Fit of Functional Generalized Least Squares Model Iteratively


Description

This function fits iteratively a functional linear model using generalized least squares. The errors are allowed to be correlated and/or have unequal variances.

  1. Begin with a preliminary estimation of \hat{θ}=θ_0 (for instance, θ_0=0). Compute \hat{W}.

  2. Estimate b_Σ =(Z'\hat{W}Z)^{-1}Z'\hat{W}y

  3. Based on the residuals, \hat{e}=≤ft(y-Zb_Σ \right), update \hat{θ}=ρ≤ft({\hat{e}}\right) where ρ depends on the dependence structure chosen.

  4. Repeats steps 2 and 3 until convergence (small changes in b_Σ and/or \hat{θ}).

Usage

fregre.igls(
  formula,
  data,
  basis.x = NULL,
  basis.b = NULL,
  correlation,
  maxit = 100,
  rn,
  lambda,
  weights = rep(1, n),
  control,
  ...
)

Arguments

formula

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.

data

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.

basis.x

List of basis for functional explanatory data estimation.

basis.b

List of basis for β(t) parameter estimation.

correlation

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.

maxit

Number of maximum of interactions.

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 NULL, corresponding to homoscedastic errors.

control

Control parameters.

...

Further arguments passed to or from other methods.

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 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 that containing the variables in the model.

  • formula formula used in ajusted model.

  • formula.ini formula in call.

  • XX desing matrix

  • W inverse of covariance matrix

  • fdataob

  • rn rn

  • vs.list

  • correlation See glsObject for the components of the fit.

References

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

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))
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

## End(Not run)

fda.usc

Functional Data Analysis and Utilities for Statistical Computing

v2.0.2
GPL-2
Authors
Manuel Febrero Bande [aut], Manuel Oviedo de la Fuente [aut, cre], Pedro Galeano [ctb], Alicia Nieto [ctb], Eduardo Garcia-Portugues [ctb]
Initial release
2020-02-17

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.