View source: R/conf_int_funcs.R
TNSurv | R Documentation |
Survival function of truncated normal distribution.
TNSurv(truncation, vTy, nu_norm, sig, mu = 0)
truncation |
A data frame of truncation with 3 columns: min_mean, max_mean, and contained. Each row corresponds to a truncation interval with lower and upper limits specified by min_mean and max_mean, respectively. In addition, contained is binary-valued and indicates whether this interval is included in the final truncation set. |
vTy |
Numeric; the value to evaluate the survival function on |
nu_norm |
Numeric; part 1 of standard deviation |
sig |
Numeric; part 2 of standard deviation |
mu |
Numeric; mean of untruncated distribution, default to 0 |
Let X be a normal random variable with mean mu
and standard deviation sig*nu_norm
.
This function returns P(X ≥ v^{T}y | X \in \code{truncation)}, where truncation
is a subset of the real line.
Log-sum-exp operations are used to avoid underflows in the upper tail probability of the truncated normal distribution.
Input:
truncation <- data.frame(matrix(c(-2,1,0,2),byrow = T,ncol=2)) colnames(truncation) <- c("min_mean", "max_mean") truncation$contained <- 1 TNSurv(truncation,vTy=0, nu_norm=1, sig=1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.