Cross-validation Functional Regression with scalar response using basis representation.
Computes functional regression between functional explanatory variables and scalar response using basis representation.
fregre.basis.cv( fdataobj, y, basis.x = NULL, basis.b = NULL, type.basis = NULL, lambda = 0, Lfdobj = vec2Lfd(c(0, 0), rtt), type.CV = GCV.S, par.CV = list(trim = 0), weights = rep(1, n), verbose = FALSE, ... )
fdataobj |
|
y |
Scalar response with length |
basis.x |
Basis for functional explanatory data |
basis.b |
Basis for functional beta parameter. |
type.basis |
A vector of character string which determines type of
basis. By default "bspline". It is only used when |
lambda |
A roughness penalty. By default, no penalty |
Lfdobj |
See eval.penalty. |
type.CV |
Type of cross-validation. By default generalized
cross-validation |
par.CV |
List of parameters for |
weights |
weights |
verbose |
If |
... |
Further arguments passed to or from other methods. |
The function fregre.basis.cv()
uses validation criterion defined by argument
type.CV
to estimate the number of basis elements and/or the penalized
parameter (lambda
) that best predicts the response.
If basis = NULL
creates bspline basis.
If the functional covariate fdataobj
is in a format raw data
,
such as matrix or data.frame, creates an object of class fdata
with
default attributes, see fdata
.
If basis.x
is a vector of number of basis elements and
basis.b=NULL
, the function force the same number of elements in the
basis of x
and beta
.
If basis.x$type=``fourier''
and basis.b$type=``fourier''
, the
function decreases the number of fourier basis elements on the
min(k.x,k_b), where k.x and
k.b are the number of basis element of basis.x
and
basis.b
respectively.
Return:
call The matched call.
coefficients A named vector of coefficients
residuals y
minus fitted values
.
fitted.values Estimated scalar response.
beta.est beta parameter estimated of class fd
weights(only for weighted fits) the specified weights.
df The residual degrees of freedom.
r2 Coefficient of determination.
sr2 Residual variance.
H Hat matrix.
y Scalar response.
fdataobj Functional explanatory data of class fdata
.
x.fd Centered functional explanatory data of class fd
.
lambda.opt lambda
value that minimizes CV or GCV method.
gcv.opt Minimum value of CV or GCV method.
basis.x.opt Basis used for functional explanatory data estimation fdata
.
basis.b.opt Basis used for for functional beta
parameter
estimation.
a.est Intercept parameter estimated
lm Return lm
object.
Manuel Febrero-Bande, Manuel Oviedo de la Fuente manuel.oviedo@usc.es
Ramsay, James O. and Silverman, Bernard W. (2006), Functional Data Analysis, 2nd ed., Springer, New York.
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 as: fregre.basis
,
summary.fregre.fd
and predict.fregre.fd
.
Alternative method: fregre.pc.cv
and
fregre.np.cv
.
## Not run: data(tecator) x<-tecator$absorp.fdata[1:129] y=tecator$y$Fat[1:129] b1<-c(15,21,31) b2<-c(7,9) res1=fregre.basis.cv(x,y,basis.x=b1) res2=fregre.basis.cv(x,y,basis.x=b1,basis.b=b2) res1$gcv res2$gcv l=2^(-4:10) res3=fregre.basis.cv(x,y,basis.b=b1,type.basis="fourier", lambda=l,type.CV=GCV.S,par.CV=list(trim=0.15)) res3$gcv ## End(Not run)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.