TNSurv: Survival function of truncated normal distribution.

View source: R/conf_int_funcs.R

TNSurvR Documentation

Survival function of truncated normal distribution.

Description

Survival function of truncated normal distribution.

Usage

TNSurv(truncation, vTy, nu_norm, sig, mu = 0)

Arguments

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

Details

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:

Examples

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)

yiqunchen/PGInference documentation built on March 20, 2022, 11:51 p.m.