#'Extract the CDF estimate for a specific quantile from a QPdecon object
#'
#'@export
#'@param qpobj a QPdecon output object, with Pdf = FALSE
#'@param quant a vector of quantiles of interest
#'@details Uses linear interpolation to extract the approximate estimate for the requested quantile.
#'@examples
#'y <- rnorm(100) + rnorm(100)
#' qpobj <- QPdecon::QPdecon(Y=y,Pdf=FALSE,f_Z=1)
#' Decon2CDF(qpobj = qpobj,quant = c(1.64,1.96))
Decon2CDF <- function(qpobj, quant){
x <- qpobj$x
FX_hat <- qpobj$f_X
# linear interpolation to obtain F.hat(x)
CDF_hat <- approx(x = x,y = FX_hat,xout = quant,method = "linear",yleft = 0,yright = 1)$y
return(CDF_hat)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.