Learn R Programming

fda.usc (version 0.9.8.1)

fregre.pc: Functional (Ridge) Regression with scalar response using Principal Components Analysis.

Description

Computes functional (ridge) regression between functional explanatory variable $X(t)$ and scalar response $Y$ using Principal Components Analysis. $$Y=\big+\epsilon=\int_{T}{X(t)\beta(t)dt+\epsilon}$$ where $\big< \cdot , \cdot \big>$ denotes the inner product on $L_2$ and $\epsilon$ are random errors with mean zero , finite variance $\sigma^2$ and $E[X(t)\epsilon]=0$.

Usage

fregre.pc(fdataobj, y, l = NULL,rn = 0, ...)

Arguments

fdataobj
fdata class object or fdata.comp class object created by create.pc.basis function.
y
Scalar response with length n.
l
Vector of principal components. If is null l (by default), l=1:3.
rn
Ridge parameter. Default value is rn=0, i.e. no penalization is used.
...
Further arguments passed to or from other methods.

Value

  • Return:
  • callThe matched call of fregre.pc function.
  • beta.estbeta coefficient estimated of class fdata
  • coefficientsA named vector of coefficients.
  • fitted.valuesEstimated scalar response.
  • residualsy-fitted values.
  • HHat matrix.
  • dfThe residual degrees of freedom. In ridge regression, df(rn) is the effective degrees of freedom.
  • r2Coefficient of determination.
  • GCVGCV criterion.
  • sr2Residual variance.
  • lIndex of principal components selected.
  • rnAmount of shrinkage.
  • fdata.compFitted object in fdata2pc function.
  • lmlm object.
  • fdataobjFunctional explanatory data.
  • yScalar response.

Details

The function computes the $\left{\nu_k\right}_{k=1}^{\infty}$ orthonormal basis of functional principal components to represent the functional data as $X_i(t)=\sum_{k=1}^{\infty}\gamma_{ik}\nu_k$ and the functional parameter as $\beta(t)=\sum_{k=1}^{\infty}\beta_k\nu_k$, where $\gamma_{ik}=\Big< X_i(t),\nu_k\Big>$ and $\beta_{k}=\Big<\beta,\nu_k\big>$. The estimation of $\beta(t)$ can be made by a few principal components (PC) under the assumption that $\beta_{k}=0$, for $k>k_n$ and the integral can be approximated by: $$\hat{y}=\Big=\sum_{k=1}^{k_{n}}{\gamma_{ik}\hat{\beta}_{k}}$$ where, $$\hat{\beta}_{(1:k_{n})}=\sum_{k=1}^{k_n}\frac{\gamma_{.k}^{T}y}{n\lambda_{k}}$$ and $\gamma_{(1:k_{n})}$ is the ($n$,$k_{n}$) matrix with $k_n$ principal components estimation of $\beta$ scores and $\lambda_i$ the eigenvalues of the PC. $$\hat{y}=\Big=\sum_{k=1}^{k_{n}}{\gamma_{ik}\hat{\beta}_{k}}$$ where, $$\hat{\beta}_{(1:k_{n})}=\sum_{k=1}^{k_n}\frac{\gamma_{.k}^{T}y}{n\lambda_{k}+rn}$$ The response can also be fitted by: $$\hat{y}=\sum_{k=1}^{k_n} \nu_k^{T}(\nu_k^{T}\nu_k)^{-1}\nu_k^{T}y$$ and for ridge regression by: $$\hat{y}=\nu_k^{T}(\nu_k^{T}\nu_k+rnI)^{-1}\nu_k^{T}y$$

References

Cai TT, Hall P. 2006. Prediction in functional linear regression. Annals of Statistics 34: 2159{-}2179. Cardot H, Ferraty F, Sarda P. 1999. Functional linear model. Statistics and Probability Letters 45: 11{-}22. Hall P, Hosseini{-}Nasab M. 2006. On properties of functional principal components analysis. Journal of the Royal Statistical Society B 68: 109{-}126.

See Also

See Also as: fregre.pc.cv, summary.fregre.fd and predict.fregre.fd. Alternative method: fregre.basis and fregre.np.

Examples

Run this code
data(tecator)
absorp=tecator$absorp.fdata
ind=1:129
x=absorp[ind,]
y=tecator$y$Fat[ind]

res=fregre.pc(x,y)
summary(res)
res2=fregre.pc(x,y,l=c(1,3,4))
summary(res2)
# Functional Ridge Regression
res3=fregre.pc(x,y,l=c(1,3,4),rn=1)
summary(res3)
res4=fregre.pc(x,y,l=c(1,3,4),rn=10)
summary(res4)
betas<-c(res$beta.est,res2$beta.est,res3$beta.est,res4$beta.est)
plot(betas)

Run the code above in your browser using DataLab