ComputeBW {curstatCI} | R Documentation |
Data-driven bandwidth vector
Description
The function ComputeBW computes the bandwidth that minimizes the pointwise Mean Squared Error using the subsampling principle in combination with undersmoothing.
Usage
ComputeBW(data, x)
Arguments
data |
Dataframe with three variables:
|
x |
numeric vector containing the points where the confidence intervals are computed. |
Value
bw data-driven bandwidth vector of size length(x)
containing the bandwidth value for each point in x.
References
Groeneboom, P. and Hendrickx, K. (2017). The nonparametric bootstrap for the current status model. Electronic Journal of Statistics 11(2):3446-3848.
See Also
vignette("curstatCI")
Examples
library(Rcpp)
library(curstatCI)
# sample size
n <- 1000
# truncated exponential distribution on (0,2)
set.seed(100)
t <- rep(NA, n)
delta <- rep(NA, n)
for(i in (1:n) ){
x<-runif(1)
y<--log(1-(1-exp(-2))*x)
t[i]<-2*runif(1);
if(y<=t[i]){ delta[i]<-1}
else{delta[i]<-0}}
A<-cbind(t[order(t)], delta[order(t)], rep(1,n))
# x vector
grid<-seq(0.1,1.9 ,by = 0.1)
# data-driven bandwidth vector
bw <- ComputeBW(data =A, x = grid)
plot(grid, bw)