sample method

  1. @override
double sample({
  1. Random? random,
})
override

Returns a single sample of a random value within the distribution.

Implementation

@override
double sample({Random? random}) {
  const normal = NormalDistribution.standard();
  final gamma = GammaDistribution.shape(0.5 * dof);
  return normal.sample(random: random) *
      sqrt(dof / (2 * gamma.sample(random: random)));
}