TNSurv: Survival function of truncated normal distribution

View source: R/trunc_dist.R

TNSurvR Documentation

Survival function of truncated normal distribution

Description

This function returns the upper tail probability of a truncated normal distribution at quantile q.

Usage

TNSurv(q, mean, sd, E, approx = FALSE)

Arguments

q

the quantile.

mean

the mean parameter

sd

the standard deviation

E

the truncation set, an "Intervals" object or a matrix where rows represents a union of disjoint intervals.

approx

should the approximation algorithm be used? Default is FALSE, where the approximation is not used in the first place. But when the result is wacky, the approximation will be used.

Details

Let X be a normal random variable with mean and sd. Truncating X to the set E is equivalent to conditioning on {X \in E}. So this function returns P(X \ge q | X \in E).

Value

This function returns the value of the survival function evaluated at quantile q.

References

Bryc, Wlodzimierz. "A uniform approximation to the right normal tail integral." Applied mathematics and computation 127.2 (2002): 365-374.


lucylgao/clusterpval documentation built on July 4, 2023, 4:40 p.m.