Learn R Programming

fda.usc (version 0.9.8.1)

fregre.pc.cv: Vaidation criteria for Functional Principal Component (and Ridge) Regression using selection of number of Principal Components

Description

Functional regression with scalar response using selection of number of principal components through cross-validation. The algorithm selects the principal components with best estimates the response. The select is performed by cross-validation (CV) or model selection criteria (MSC). After is computing functional regression using the best selection of principal components (PC).

Usage

fregre.pc.cv(fdataobj, y, kmax = 8, rn = 0, criteria = "SIC", ...)

Arguments

fdataobj
fdata class object or fdata.comp class object created by create.pc.basis function.
y
Scalar response with length n.
kmax
Maximum number of principal comoponents.
criteria
Type of cross-validation (CV) or Model Selecttion Criteria (MSC) applied. Possible values are "CV", "AIC", "AICc", "SIC" and "SICc".
rn
Ridge parameter. Default value is rn=0, i.e. no penalization is used. If =TRUE, a sequence of values is provided
...
Further arguments passed to fregre.pc

Value

  • Return:
  • fregre.pcregression model fitted with best selection of FPC (pc.opt) and ridge parameter (rn.opt).
  • pc.optIndex of principal components selected.
  • rn.optRidge parameter selected.
  • PC.orderMatrix whose columns correspond to the selected index of each principal component with the lowest MSC value by each ridge parameter value (in rows)
  • MSC.orderModel Selection Criteria (MSC) value for complete sequence principal components selected by ridge parameter value in each iteration.

Details

The algorithm selects the best principal components pc.opt from the first kmax PC and (optionally) the best ridge parameter rn.opt from a sequence of non-negative numbers rn. If kmax is a integer (by default and recomended) the procedure is as follows (see example 1):
  • Calculate the best principal component (pc.order[1]) betweenkmaxbyfregre.pc.
  • Calculate the second-best principal component (pc.order [2]) between the(kmax-1)byfregre.pcand calculate the criteria value of the two principal components.
  • The process (point 1 and 2) is repeated untilkmaxprincipal component (pc.order[kmax]).
  • The process (point 1, 2 and 3) is repeated for eachrnvalue.
  • The method selects the principal components (pc.opt=pc.order[1:k.min]) and (optionally) the ridge parameter with minimum MSC criteria.
If kmax is a sequence of integer the procedure is as follows (see example 2):
  • The method selects the best principal components with minimum MSC criteria by stepwise regression usingfregre.pcin each step.
  • The process (point 1) is repeated for eachrnvalue.
  • The method selects the principal components (pc.opt=pc.order[1:k.min]) and (optionally) the ridge parameter with minimum MSC criteria.
Finally, is computing functional PC regression between functional explanatory variable $X(t)$ and scalar response $Y$ using the best selection of PC pc.opt and ridge parameter rn.opt. The criteria selection is done by cross-validation (CV) or Model Selection Criteria (MSC).
  • Predictive Cross-Validation:$PCV(k_n)=\frac{1}{n}\sum_{i=1}^{n}{\Big(y_i -\big< X_i,\hat{\beta}_{(-i,k_n)} \big>\Big)^2}$, criteria=``CV''
  • Model Selection Criteria:$MSC(k_n)=log \left[ \frac{1}{n}\sum_{i=1}^{n}{\Big(y_i-\big< X_i,\hat{\beta}_{(i,k_n)} \big>\Big)^2} \right] +p_n\frac{k_n}{n}$ $p_n=\frac{log(n)}{n}$,criteria=``SIC'' (by default) $p_n=\frac{log(n)}{n-k_n-2}$,criteria=``SICc'' $p_n=2$,criteria=``AIC'' $p_n=\frac{2n}{n-k_n-2}$,criteria=``AICc''
where criteria is an argument that controls the type of validation used in the selection of the smoothing parameter kmax$=k_n$. criteria=``CV'' is not recommended: time-consuming.

References

Cai T., 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, summary.fregre.fd and predict.fregre.fd. Alternative method: fregre.basis.cv and fregre.np.cv.

Examples

Run this code
#################################################################
data(aemet)
names(aemet)
x=aemet$temp
y=apply(aemet$logprec$data,1,sum)

# Example 1: criteria selects the best FPC (recommended)
# kmax is a integer (maximum FPC to consider)
out1=fregre.pc.cv(x,y,8,criteria="AICc")

 
## Example 2: Three equivalent outputs
## using the functional data
# out2=fregre.pc.cv(x,y,8,criteria="SICc") 

## using the FPC components (recommended)
# pc<-fdata2pc(x,8) 											
# out111=fregre.pc.cv(pc,y,criteria="SICc")

## using the FPC components
# out11=fregre.pc.cv(out1$fregre.pc$fdata.comp,y,criteria="SICc") 


## Example 3: stepwise selection criteria (unrecommended)
## kmax is a sequence of integer
# out3=fregre.pc.cv(x,y,1:8,criteria="AICc")
# out4=fregre.pc.cv(x,y,1:8,criteria="SICc")

Run the code above in your browser using DataLab