Learn R Programming

decisionSupport (version 1.114)

rtnorm90ci: 90%-confidence interval based truncated normal random number generation.

Description

rtnorm90ci generates truncated normal random numbers based on the 90% confidence interval calculating the distribution parameter numerically from the 90%-confidence interval or via a fit on the 90%-confidence interval. The fit might include the median or not.

rposnorm90ci generates positive normal random numbers based on the 90% confidence interval. It is a wrapper function for rtnorm90ci.

rtnorm_0_1_90ci generates normal random numbers truncated to \([0,1]\) based on the 90% confidence interval. It is a wrapper function for rtnorm90ci.

Usage

rtnorm90ci(
  n,
  ci,
  median = mean(ci),
  lowerTrunc = -Inf,
  upperTrunc = Inf,
  method = "numeric",
  relativeTolerance = 0.05,
  ...
)

rposnorm90ci( n, lower, median = mean(c(lower, upper)), upper, method = "numeric", relativeTolerance = 0.05, ... )

rtnorm_0_1_90ci( n, lower, median = mean(c(lower, upper)), upper, method = "numeric", relativeTolerance = 0.05, ... )

Arguments

n

Number of generated observations.

ci

numeric 2-dimensional vector; lower, i.e ci[[1]], and upper bound, i.e ci[[2]], of the 90%-confidence interval.

median

if NULL: truncated normal is fitted only to lower and upper value of the confidence interval; if numeric: truncated normal is fitted on the confidence interval and the median simultaneously. For details cf. below. This option is only relevant if method="fit".

lowerTrunc

numeric; lower truncation point of the distribution (>= -Inf).

upperTrunc

numeric; upper truncation point of the distribution (<= Inf).

method

method used to determine the parameters of the truncated normal; possible methods are "numeric" (the default) and "fit".

relativeTolerance

numeric; the relative tolerance level of deviation of the generated confidence interval from the specified interval. If this deviation is greater than relativeTolerance a warning is given.

...

further parameters to be passed to paramtnormci_numeric or paramtnormci_fit, respectively.

lower

numeric; lower bound of the 90% confidence interval.

upper

numeric; upper bound of the 90% confidence interval.

Details

method="numeric" is implemented by paramtnormci_numeric and method="fit" by paramtnormci_fit.

Positive normal random number generation: a positive normal distribution is a truncated normal distribution with lower truncation point equal to zero and upper truncation is infinity. rposnorm90ci implements this as a wrapper function for rtnorm90ci(n, c(lower,upper), median, lowerTrunc=0, upperTrunc=Inf, method, relativeTolerance,...).

0-1-(truncated) normal random number generation: a 0-1-normal distribution is a truncated normal distribution with lower truncation point equal to zero and upper truncation equal to 1. rtnorm_0_1_90ci implements this as a wrapper function for rtnorm90ci(n, c(lower,upper), median, lowerTrunc=0, upperTrunc=1, method, relativeTolerance,...).

See Also

For the implementation of method="numeric": paramtnormci_numeric; for the implementation of method="fit": paramtnormci_fit.