PlugInBand {NPHazardRate} | R Documentation |
Simple Plug in badnwidth selector
Description
Provides the asymptotic MISE optimal plug-in bandwidth for the hazard rate estimator HazardRateEst
, see Hua, Patil and Bagkavos (2018). The bandwidth is also suitable for use as a pilot bandwidth in TransHazRateEst
and VarBandHazEst
.
Usage
PlugInBand(xin, xout, cens, kfun )
Arguments
xin |
A vector of data points |
xout |
The point at which the estimates should be calculated. |
cens |
Censoring Indicators. |
kfun |
A kernel function. |
Details
The asymptotic MISE optimal plug-in bandwidth selector for HazardRateEst
is defined by
h_{ opt} = \left[\frac{R(K)}{nR(\lambda_T'')\mu_{2,K}^2}\int \frac{\lambda_T(x)}{1-F(x)}\,dx \right]^{1/5}
see (9) in Hua, Patil and Bagkavos (2018). The estimate of R(\lambda_T'')
to be used in h_{opt}
is
R(\hat \lambda_T'') = \int_0^\xi \left (\hat \lambda_T''(x|\hat b_n^\ast) \right )^2\,dx.
Also,
\int_0^T \frac{\lambda_T(x)}{1-F(x)}\,dx
is estimated by applying the extended Simpson's numerical integration rule, SimpsonInt
, on
\frac{\hat \lambda_T(x|\hat b_n^\ast) }{1-F(x)}
where 1-F(x)
is estimated by KMest
. The estimation is implemented in the NP.M.Estimate
function.
Currently b_n^\ast
is estimated by bw.nrd
. However according to (11) in Hua, Patil and Bagkavos (2018)., in future versions this package will support
b_n^\ast = \left \{ \frac{5R(K'')}{n \mu_{2,K}^2 R(\lambda_T^{(4)})} \int \frac{\lambda_T(x)}{1-F(x)}\,dx \right \}^{1/9}.
where
R(\hat \lambda_T^{(4)}) = \frac{(\hat a(\hat a-1)(\hat a-2)(\hat a-3)(\hat a-4))^2}{(2\hat a-9){\hat{b}}^{2\hat a} } (\xi^{2\hat a-9} - {p_\alpha}^{2\hat a-9}), \hat a\neq 9/2
and \hat M
is already estimated by NP.M.Estimate
as expalined above (it will be much more stable than using a Weibull reference model).
Value
A scalar with the value of the suggested bandwidth.
References
See Also
Examples
x<-seq(0, 5,length=100) #design points where the estimate will be calculated
SampleSize<-100 #amount of data to be generated
ti<- rweibull(SampleSize, .6, 1) # draw a random sample
ui<-rexp(SampleSize, .2) # censoring sample
cat("\n AMOUNT OF CENSORING: ", length(which(ti>ui))/length(ti)*100, "\n")
x1<-pmin(ti,ui) # observed data
cen<-rep.int(1, SampleSize) # initialize censoring indicators
cen[which(ti>ui)]<-0 # 0's correspond to censored indicators
huse1<- PlugInBand(x1, x, cen, Biweight)
huse1