Description Usage Arguments Details Value References See Also Examples
Implements an adaptive variable bandwidth hazard rate rule for use with the VarBandHazEst
based on the Weibull distribution, with parameters estimated by maximum likelihood
1 | DefVarBandRule(xin, cens)
|
xin |
A vector of data points. Missing values not allowed. |
cens |
A vector of censoring indicators: 1's indicate uncensored observations, 0's correspond to censored obs. |
The adaptive AMISE optimal bandwidth for the variable bandwidth hazard rate estimator VarBandHazEst
is given by
h_2 = ≤ft [ \frac{R(K) M_2}{8nμ_4^2(K) R(g)} \right ]^{1/14}
where
M_2 = \int \frac{λ^{3/2}(x)}{1-F(x)} \,dx
and
g(x)=\frac{1}{24λ(x)^5} \Bigl (24{λ'(x)}^4-36{λ'(x)}^2{λ''(x)}^2λ(x)+6{λ''(x)}^2λ^2(x) + 8λ'(x)λ'''(x)λ^2(x) -λ^{(4)}(x)λ^3(x)\Bigr )
the value of the adaptive bandwidth
HazardRateEst, TransHazRateEst, PlugInBand
1 2 3 4 5 6 7 8 9 10 11 12 13 | library(survival)
x<-seq(0, 5,length=100) #design points where the estimate will be calculated
SampleSize <- 100
ti<- rweibull(SampleSize, .6, 1)#draw a random sample from the actual distribution
ui<-rexp(SampleSize, .05) #draw a random sample from the censoring distribution
cat("\n AMOUNT OF CENSORING: ", length(which(ti>ui))/length(ti)*100, "\n")
x1<-pmin(ti,ui) #this is the observed sample
cen<-rep.int(1, SampleSize) #censoring indicators
cen[which(ti>ui)]<-0 #censored values correspond to zero
h2<-DefVarBandRule(ti, cen) #Deafult Band. Rule - Weibull Reference
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.