#' Compute the confidence interval index by Minkah & de Wet (2018)
#'
#'@param Sig the significance level (alpha). Defaults to 0.05.
#'@param Coverage The empirical coverage - a number in (0,1).
#'@param Length The empirical length of the interval.
#'@details Comparison of Confidence Interval Estimators: An Index Approach. Minkah & de Wet, 2018.
#'@examples
#'ConfidenceIntervalsIndex(Sig = 0.1,Coverage = 0.95,Length = 0.2)
#'ConfidenceIntervalsIndex(Sig = 0.1,Coverage = 0.9,Length = 0.25)
#'@export
ConfidenceIntervalsIndex <- function(Sig=0.05,Coverage,Length){
k <- (4-2*Sig)/(3-2*Sig) # scaling constant
H <- function(eta,Sig){abs(1-Sig-eta)} # loss function (absolute)
Index <- 1 - 0.5*((1 + H(eta=Coverage,Sig=Sig)) / (1 + (Coverage/(1 + Length))))
return(Index)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.