Description Usage Arguments Value References See Also Examples
The function ComputeBW computes the bandwidth that minimizes the pointwise Mean Squared Error using the subsampling principle in combination with undersmoothing.
1 |
data |
Dataframe with three variables:
|
x |
numeric vector containing the points where the confidence intervals are computed. |
bw data-driven bandwidth vector of size length(x)
containing the bandwidth value for each point in x.
Groeneboom, P. and Hendrickx, K. (2017). The nonparametric bootstrap for the current status model. Electronic Journal of Statistics 11(2):3446-3848.
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 | 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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.