Description Usage Arguments Details Value Author(s) See Also Examples
This function returns point Estimations of probability density function and hazard rate ratio function.
1 2 | HRR_sbsp_est(pt_int,cdf,kernel = "gaussian",hazard_bandwidth = NA,
knn = NA, n_hz_sample, n_hz_size = length(cdf))
|
pt_int |
a vector of estimated points. |
cdf |
a sorted vector that needs to be estimated. |
kernel |
a character string giving the smoothing kernel to be used.
This must partially match one of " |
hazard_bandwidth |
the smoothing bandwidth to be used. |
knn |
number of neighbor points to be considered in smoothing for the
" |
n_hz_sample |
number of replicates. |
n_hz_size |
resampled size. Default to be same as |
A smaller n_hz_size
can significantly cut down the running time while
the accuracy is maintained by large n_hz_sample
. It is similar as the
"bagging" method in machine learning.
This function returns a list with components:
fhat |
A function performing the linear interpolation of smoothed probability density function of given data points. |
HRR |
A function performing the linear interpolation of smoothed hazard rate ratio point estimations. |
Zhicong Zhao
HRR_pt_est
for each replicate.
1 2 3 4 5 6 7 8 9 10 | temp <- HRR_sbsp_est(pt_int = seq(0,1,0.1),
cdf = sort(rbeta(5000,2,5)),
kernel = "triangular",
hazard_bandwidth = 0.1,
n_hz_sample = 30)
## plot ##
plot(temp$fhat,col = "blue",xlab = NA,ylab = NA)
points(seq(0,1,0.1),dbeta(seq(0,1,0.1),2,5),type = "l",col = "red")
legend("top",legend = c("estimated density","population density"),
lty = 1, col = c("blue","red"))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.