2020-09-26 10:44:18 +00:00
|
|
|
using System;
|
|
|
|
using System.Threading;
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
namespace FastRng.Double.Distributions
|
|
|
|
{
|
2020-10-31 22:44:23 +00:00
|
|
|
public sealed class BetaA2B2 : Distribution
|
2020-09-26 10:44:18 +00:00
|
|
|
{
|
2020-09-30 18:21:46 +00:00
|
|
|
private const double ALPHA = 2;
|
|
|
|
private const double BETA = 2;
|
2020-10-19 17:48:16 +00:00
|
|
|
private const double CONSTANT = 4;
|
2020-09-26 10:44:18 +00:00
|
|
|
|
2020-11-07 14:12:56 +00:00
|
|
|
public BetaA2B2(IRandom rng) : base(rng)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2020-10-31 22:44:23 +00:00
|
|
|
protected override double ShapeFunction(double x) => CONSTANT * Math.Pow(x, ALPHA - 1) * Math.Pow(1 - x, BETA - 1);
|
2020-09-26 10:44:18 +00:00
|
|
|
}
|
|
|
|
}
|