truncatedNormalSample function
Returns a random sample containing sampleSize
elements following a
truncated normal distribution with:
xMin
: minimum value,xMax
: maximum value,meanOfParent
: mean of parent normal distribution,stdDevOfParent
: standard deviation of parent normal distribution.
seed
: random generator seed (optional).
Implementation
List<double> truncatedNormalSample(
int sampleSize,
num xMin,
num xMax,
num meanOfParent,
num stdDevOfParent, {
int? seed,
}) =>
randomSample(
sampleSize,
xMin,
xMax,
truncatedNormalPdf(
meanOfParent,
xMin,
xMax,
meanOfParent,
stdDevOfParent,
),
(x) => truncatedNormalPdf(x, xMin, xMax, meanOfParent, stdDevOfParent),
seed: seed,
);