scb.mean {SCBmeanfd} | R Documentation |
Build Simultaneous Confidence Bands for Mean Functions
Description
Fit a local linear estimator and build simultaneous confidence bands (SCB) for the mean of functional data.
Usage
scb.mean(x, y, bandwidth, level = .95, degree = 1,
scbtype = c("normal","bootstrap","both","no"), gridsize = length(x),
keep.y = TRUE, nrep = 2e4, nboot = 5e3, parallel = c("no", "multicore", "snow"),
ncpus = getOption("boot.ncpus",1L), cl = NULL)
Arguments
x |
a numeric vector of x data. Missing values are not accepted. |
y |
a matrix or data frame with functional observations (= curves) stored in rows. The number of columns of |
bandwidth |
the kernel bandwidth smoothing parameter. |
level |
the level of the simultaneous confidence bands. |
degree |
the degree of the local polynomial fit. |
scbtype |
the type of simultaneous confidence bands to build: "normal", "bootstrap", "both", or "no". |
gridsize |
the size of the grid used to evaluate the mean function estimates and SCB. Defaults to length(x). |
keep.y |
logical; if |
nrep |
number of replicates for the Gaussian SCB method (20,000 by default). |
nboot |
number of replicates for the bootstrap SCB method (5,000 by default). |
parallel |
the computation method for the SCB. By default, computations are sequential ( |
ncpus |
number of cores to use for parallel computing when |
cl |
name of the cluster to use for parallel computing when |
Details
The local polynomial fitting uses a standard normal kernel and is implemented via the locpoly
function.
Bootstrap SCB are implemented with the boot
function and typically require more computation time than normal SCB.
Value
An object of class "SCBand"
. To accommodate the different functions creating objects of this class (scb.mean
, scb.model
, and scb.equal
), some components of the object are set to NULL
. The component list is:
x |
the x data. |
y |
the y data if |
call |
the function call. |
model |
|
par |
|
nonpar |
a nonparametric estimate. |
bandwidth |
the argument |
degree |
the degree of local polynomial used. Currently, only local linear estimation is supported. |
level |
the argument |
scbtype |
the argument |
teststat |
|
pnorm |
|
pboot |
|
qnorm |
the quantile used to build the normal SCB. |
qboot |
the quantile used to build the bootstrap SCB. |
normscb |
a matrix containing the normal SCB stored in columns. |
bootscb |
a matrix containing the bootstrap SCB stored in columns. |
gridsize |
the argument |
nrep |
the argument |
nboot |
the argument |
Depending on the value of scbtype
, some of
the fields qnorm
, normscb
, nrep
, qboot
, normboot
and nboot
may be NULL
.
References
Degras, D. (2011). Simultaneous confidence bands for nonparametric regression with functional data. Statistica Sinica, 21, 1735–1765.
See Also
Examples
## Not run:
## Plasma citrate data
data(plasma)
time <- 8:21
h <- cv.select(time, plasma, 1, c(.5, 1))
scbplasma <- scb.mean(time, plasma, bandwidth = h, scbtype = "both", gridsize = 100)
scbplasma
plot(scbplasma, cex = .2, legend.cex = .85, xlab = "Time", ylab = "Concentration",
main = "Plasma citrate data")
## End(Not run)