FastRng/FastRng/Distributions/BetaA2B2.cs

17 lines
438 B
C#
Raw Normal View History

2020-10-31 22:49:37 +00:00
using System;
2023-07-06 08:08:46 +00:00
namespace FastRng.Distributions
2020-10-31 22:49:37 +00:00
{
public sealed class BetaA2B2 : Distribution
{
private const float ALPHA = 2f;
private const float BETA = 2f;
private const float CONSTANT = 4f;
public BetaA2B2(IRandom rng) : base(rng)
{
}
2020-11-08 15:23:05 +00:00
private protected override float ShapeFunction(float x) => CONSTANT * MathF.Pow(x, ALPHA - 1f) * MathF.Pow(1f - x, BETA - 1f);
2020-10-31 22:49:37 +00:00
}
}