Last chance! 50% off unlimited learning
Sale ends in
Ker
argument), h
is the smoothing parameter and $d$ is a metric or a semi-metric (see metric
argument).
The function estimates the value of smoothing parameter (also called bandwidth) h
through Generalized Cross-validation GCV
criteria, see GCV.S
or CV.S
.fregre.np.cv(fdataobj,y,h=NULL,Ker=AKer.norm,metric=metric.lp,
type.CV = GCV.S,type.S=S.NW,par.CV=list(trim=0),par.S=list(w=1),...)
fdata
class object.n
.metric.lp
.GCV.S
method.S
. By default S
is calculated by Nadaraya-Watson kernel estimator (S.NW
).type.CV
: trim
, the alpha of the trimming and draw=TRUE
.type.S
: w
, the weights.metric.lp
o other metric function.y
minus fitted values
.x
and newx
.GCV.S
or CV.S
. It computes the distance between curves using the metric.lp
, although any other semimetric could be used (see semimetric.basis
or semimetric.NPFDA
functions).
Different asymmetric kernels can be used, see Kernel.asymmetric
.fregre.np
, summary.fregre.fd
and predict.fregre.fd
.
Alternative method: fregre.basis.cv
and fregre.np.cv
.data(tecator)
absorp=tecator$absorp.fdata
ind=1:129
x=absorp[ind,]
y=tecator$y$Fat[ind]
Ker=AKer.tri
res.np=fregre.np.cv(x,y,Ker=Ker)
summary.fregre.fd(res.np)
res.np2=fregre.np.cv(x,y,type.CV=GCV.S,criteria="Shibata")
summary.fregre.fd(res.np2)
## Example with other semimetrics (not run)
res.pca1=fregre.np.cv(x,y,Ker=Ker,metric=semimetric.pca,q=1)
summary.fregre.fd(res.pca1)
res.deriv=fregre.np.cv(x,y,Ker=Ker,metric=semimetric.deriv)
summary.fregre.fd(res.deriv)
x.d2=fdata.deriv(x,nderiv=1,method="fmm",class.out='fdata')
res.deriv2=fregre.np.cv(x.d2,y,Ker=Ker)
summary.fregre.fd(res.deriv2)
x.d3=fdata.deriv(x,nderiv=1,method="bspline",class.out='fdata')
res.deriv3=fregre.np.cv(x.d3,y,Ker=Ker)
summary.fregre.fd(res.deriv3)
Run the code above in your browser using DataLab