Learn R Programming

fda.usc (version 1.0.0)

fregre.bootstrap: Bootstrap regression

Description

Estimate the beta parameter by bootstrap

Usage

fregre.bootstrap(model,nb=500,newX=NULL,smo=0.1,
smoX=0.05,alpha=0.95,kmax.fix=FALSE,draw=TRUE,...)

Arguments

model
fregre.pc, fregre.pls or fregre.basis object.
nb
Number of bootstrap samples
newX
(optional), new functional explanatory data of fdata class .
smo
Smoothing parameter as a proportion of response variance.
smoX
Smoothing parameter for fdata object as a proportion of variance-covariance matrix of the explanatory functional variable.
alpha
Significance level.
kmax.fix
The maximum number of principal comoponents, partial least squares components or number of basis is fixed by model object.
draw
=TRUE, plot the bootstrap estimated beta, and (optional) the CI for the predicted response values.
...
Further arguments passed to or from other methods.

Value

  • Return:
  • beta.bootFunctional beta estimated by bootstrap method.
  • norm.bootnorm of diferences beetween the nboot betas estimated by bootstrap and beta estimated by regression model.
  • coefs.bootnboot X nbasis of bootstrap estimated coefficients of basis
  • knn.fixnb basis, CP or PLS factors selected in each regression.
  • y.prednboot X n matrix of predicted response values.
  • y.bootnboot X n matrix of bootstrap predicted response values.

Details

Compute the beta estimated in influence.fdata for functional regression using principal components representation fregre.pc, Partial least squares components (PLS) representation fregre.pls or basis representation fregre.basis. If a new curves are in newX argumentthe smoothed bootstrap method estimates the response using the bootstrap samples.

References

Febrero-Bande, M., Galeano, P. and Gonzalez-Manteiga, W. (2010). Measures of influence for the functional linear model with scalar response. Journal of Multivariate Analysis 101, 327-339. Febrero-Bande, M., Oviedo de la Fuente, M. (2012). Statistical Computing in Functional Data Analysis: The R Package fda.usc. Journal of Statistical Software, 51(4), 1-28. http://www.jstatsoft.org/v51/i04/

See Also

See Also as: fregre.pc, fregre.pls, fregre.basis, .

Examples

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

res.basis=fregre.basis(x,y)
newx=tecator$absorp.fdata[-c(1:129)]
newy=tecator$y$Fat[-c(1:129)]
nb<-10 # Time-consuming
res.boot1=fregre.bootstrap(res.basis,nb=nb,newX=newx,kmax.fix=TRUE)
predy=predict(res.basis,newx)
plot(predy-newy,col=2)

## predicted responses by bootstrap
# res.boot1$ypred

## With FPC and FPLS basis
# res.pc=fregre.pc(x,y,1:6)
# res.pls=fregre.pls(x,y)
# res.boot2=fregre.bootstrap(res.pls,nb=5,newX=newx,kmax.fix=TRUE)
# res.boot3=fregre.bootstrap(res.pc,nb=5,newX=newx,kmax.fix=TRUE)

Run the code above in your browser using DataLab