tnormale: Random deviate from a truncated normal distribution

Description Usage Arguments Value Author(s) Examples

Description

Generate a random deviate value from a normal distribution. The returned value is included inside a specified range ]minValue,maxValue[ specified by user. The mean and variance of the normal distribution is also specified by user.

Usage

1
tnormale(mu, sigma, minValue, maxValue)

Arguments

mu

a numeric value, the mean of the normal distribution.

sigma

a non-negative numeric, the variance of the normal distribution.

minValue

a numeric value, the inferior boundary of the range in which the output value must be located. The returned value has to be superior to minValue.

maxValue

a numeric value, the superior boundary of the range in which the output value must be located. The returned value has to be inferior to maxValue.

Value

a numeric which is superior to minValue and inferior to maxValue.

Author(s)

Rawane Samb

Examples

1
2
3
4
5
6
## Set seed to replicate results
set.seed(3333)

## Return a value, between 1000 and 3000, generated froma a normal
## distribution with a mean of 2000 and a variance of 30.
RJMCMC:::tnormale(2000, 30, 1000, 30000)

ArnaudDroitLab/RJMCMC documentation built on May 5, 2019, 7:06 a.m.