Description Usage Arguments Value References See Also Examples
This is the goodness-of-fit test for parametric models of the mean function described in Degras (2011). The candidate model must be a finite-dimensional function space (curvilinear regression). The test is based on the sup-norm distance between a smoothed parametric estimate and a local linear estimate. Graphically, the candidate model is retained whenever one of the estimates lies within the SCB built around the other.
1 2 3 4 |
x |
a numeric vector of x data. |
y |
a matrix or data frame with functional observations (= curves) stored in rows. The number of columns of |
model |
an integer specifying the degree of a polynomial basis, or a data frame/matrix containing the basis functions stored in columns. In the latter case, the basis functions must be evaluated on a uniform grid of size |
bandwidth |
the kernel bandwidth smoothing parameter. |
level |
the significance level of the test (default = .05). |
degree |
the degree of the local polynomial fit. |
scbtype |
the type of simultaneous confidence bands to build: "normal", "bootstrap", "tGKF", "all", or "no". |
gridsize |
the size of the grid over which the mean function is to be estimated. Defaults to |
keep.y |
logical; if |
nrep |
the number of replicates for the normal SCB method (default = 20,000). |
nboot |
the number of replicates for the bootstrap SCB method (default = 5,000). |
parallel |
the computation method for the bootstrap SCB. By default, computations are sequential ( |
ncpus |
the number of cores to use for parallel computing when |
cl |
the name of the cluster to use for parallel computing when |
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:
|
the argument |
|
the argument |
|
the function call. |
|
the argument |
|
a smoothed parametric estimate. |
|
a local linear estimate. |
|
the argument |
degree |
the degree of the local polynomial. Currently, only local linear estimation is supported. |
level |
the argument |
scbtype |
the argument |
teststat |
the test statistic. |
pnorm |
the p value for the normal-based statistical test. |
pboot |
the p value for the boostrap-based statistical test. |
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 scbtype
, some or all of the fields pnorm
, qnorm
, normscb
, nrep
, pboot
, qboot
, normboot
and nboot
may be NULL
.
Degras, D. (2011). Simultaneous confidence bands for nonparametric regression with functional data.
Statistica Sinica 21, 1735–1765.
Degras, D. (2017). Simultaneous confidence bands for the mean of functional data. WIREs Computational Statistics e1397.
Telschow, F.J.E. and Schwartzman, A. (2019). Simultaneous confidence bands for functional data using the Gaussian kinematic formula. arXiV
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | ## Example from Degras (2011)
## Gaussian process with polynomial mean function
## and Ornstein-Uhlenbeck covariance function
## The SCB and PLRT tests are compared
set.seed(100)
p <- 100 # number of observation points
x <- seq(0, 1, len = p)
mu <- 10 * x^3 - 15 * x^4 + 6 * x^5 # mean
R <- (.25)^2 * exp(20 * log(.9) * abs(outer(x,x,"-"))) # covariance
eigR <- eigen(R, symmetric = TRUE)
simR <- eigR$vectors %*% diag(sqrt(eigR$values))
# Candidate model for mu: polynomial of degree <= 3
# This model, although incorrect, closely approximates mu.
# With n = 50 curves, the SCB and PLRT incorrectly retain the model.
# With n = 70 curves, both tests reject it.
n <- 50
y <- mu + simR %*% matrix(rnorm(n*p), p, n) # simulate data
y <- t(y) # arrange the trajectories in rows
h <- cv.select(x, y, 1)
scb.model(x, y, 3, bandwidth = h) # p value: .652
plrt.model(x, y, 3, verbose = TRUE) # p value: .450
n <- 70
y <- mu + simR %*% matrix(rnorm(n*p), p, n)
y <- t(y)
h <- cv.select(x, y, 1)
scb.model(x, y, 3, bandwidth = h) # p value: .004
plrt.model(x, y, 3, verbose = TRUE) # p value: .001
# Correct model: polynomials of degree <= 5
scb.model(x, y, 5, bandwidth = h) # p value: .696
plrt.model(x, y, 5, verbose = TRUE) # p value: .628
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.