optim.np | R Documentation |
Smoothing of functional data using nonparametric kernel estimation with cross-validation (CV) or generalized cross-validation (GCV) methods.
optim.np( fdataobj, h = NULL, W = NULL, Ker = Ker.norm, type.CV = GCV.S, type.S = S.NW, par.CV = list(trim = 0, draw = FALSE), par.S = list(), correl = TRUE, verbose = FALSE, ... )
fdataobj |
|
h |
Smoothing parameter or bandwidth. |
W |
Matrix of weights. |
Ker |
Type of kernel used, by default normal kernel. |
type.CV |
Type of cross-validation. By default generalized cross-validation (GCV) method. Possible values are GCV.S and CV.S |
type.S |
Type of smothing matrix |
par.CV |
List of parameters for type.CV: |
par.S |
List of parameters for |
correl |
logical. If |
verbose |
If |
... |
Further arguments passed to or from other methods. Arguments to be passed for kernel method. |
Calculate the minimum GCV for a vector of values of the smoothing parameter
h
.
Nonparametric smoothing is performed by the kernel function.
The type of kernel to use with the parameter Ker
and the type of
smothing matrix S
to use with the parameter type.S
can be
selected by the user, see function Kernel
.
W is the matrix of weights of the discretization points.
Returns GCV or CV values calculated for input parameters.
gcv
GCV or CV for a vector of values of the smoothing parameter
h
fdataobj
fdata
class object.
fdata.est
Estimated fdata
class object.
h.opt
h
value that minimizes CV or GCV method.
S.opt
Smoothing matrix for the minimum CV or GCV method.
gcv.opt
Minimum of CV or GCV method.
h
Smoothing parameter or bandwidth.
min.np deprecated.
Manuel Febrero-Bande, Manuel Oviedo de la Fuente manuel.oviedo@udc.es
Ferraty, F. and Vieu, P. (2006). Nonparametric functional data analysis. Springer Series in Statistics, New York.
Wasserman, L. All of Nonparametric Statistics. Springer Texts in Statistics, 2006.
Hardle, W. Applied Nonparametric Regression. Cambridge University Press, 1994.
De Brabanter, K., Cao, F., Gijbels, I., Opsomer, J. (2018). Local polynomial regression with correlated errors in random design and unknown correlation structure. Biometrika, 105(3), 681-69.
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. https://www.jstatsoft.org/v51/i04/
Alternative method: optim.basis
## Not run: # Exemple, phoneme DATA data(phoneme) mlearn<-phoneme$learn[1:100] out1<-optim.np(mlearn,type.CV=CV.S,type.S=S.NW) np<-ncol(mlearn) # variance calculations y<-mlearn out<-out1 i<-1 z=qnorm(0.025/np) fdata.est<-out$fdata.est tt<-y[["argvals"]] var.e<-Var.e(y,out$S.opt) var.y<-Var.y(y,out$S.opt) var.y2<-Var.y(y,out$S.opt,var.e) # plot estimated fdata and point confidence interval upper.var.e<-fdata.est[i,]-z*sqrt(diag(var.e)) lower.var.e<-fdata.est[i,]+z*sqrt(diag(var.e)) dev.new() plot(y[i,],lwd=1, ylim=c(min(lower.var.e$data),max(upper.var.e$data)),xlab="t") lines(fdata.est[i,],col=gray(.1),lwd=1) lines(fdata.est[i,]+z*sqrt(diag(var.y)),col=gray(0.7),lwd=2) lines(fdata.est[i,]-z*sqrt(diag(var.y)),col=gray(0.7),lwd=2) lines(upper.var.e,col=gray(.3),lwd=2,lty=2) lines(lower.var.e,col=gray(.3),lwd=2,lty=2) legend("bottom",legend=c("Var.y","Var.error"), col = c(gray(0.7),gray(0.3)),lty=c(1,2)) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.