From 1a8c5cc42a3dc8b049ae19b30a66959e62bb6b66 Mon Sep 17 00:00:00 2001 From: Christoph Ruegg Date: Sat, 24 Aug 2013 01:51:19 +0200 Subject: [PATCH] Distributions: inline docs, range information --- src/Numerics/Distributions/Bernoulli.cs | 18 +- src/Numerics/Distributions/Beta.cs | 160 +++++------------- src/Numerics/Distributions/Binomial.cs | 131 ++++---------- src/Numerics/Distributions/Cauchy.cs | 18 +- src/Numerics/Distributions/Chi.cs | 16 +- src/Numerics/Distributions/ChiSquared.cs | 18 +- .../Distributions/ContinuousUniform.cs | 28 +-- .../Distributions/ConwayMaxwellPoisson.cs | 32 ++-- src/Numerics/Distributions/DiscreteUniform.cs | 28 +-- src/Numerics/Distributions/Erlang.cs | 62 ++++--- src/Numerics/Distributions/Exponential.cs | 16 +- src/Numerics/Distributions/FisherSnedecor.cs | 32 ++-- src/Numerics/Distributions/Gamma.cs | 40 ++--- src/Numerics/Distributions/Geometric.cs | 30 ++-- src/Numerics/Distributions/InverseGamma.cs | 32 ++-- src/Numerics/Distributions/Laplace.cs | 30 ++-- .../Distributions/NegativeBinomial.cs | 32 ++-- src/Numerics/Distributions/Pareto.cs | 32 ++-- src/Numerics/Distributions/Poisson.cs | 20 +-- src/Numerics/Distributions/Rayleigh.cs | 16 +- src/Numerics/Distributions/Stable.cs | 48 +++--- src/Numerics/Distributions/StudentT.cs | 32 ++-- src/Numerics/Distributions/Weibull.cs | 32 ++-- 23 files changed, 374 insertions(+), 529 deletions(-) diff --git a/src/Numerics/Distributions/Bernoulli.cs b/src/Numerics/Distributions/Bernoulli.cs index 27e1aac6..4ed6a44c 100644 --- a/src/Numerics/Distributions/Bernoulli.cs +++ b/src/Numerics/Distributions/Bernoulli.cs @@ -54,7 +54,7 @@ namespace MathNet.Numerics.Distributions /// /// Initializes a new instance of the Bernoulli class. /// - /// The probability of generating one. + /// The probability (p) of generating one. Range: 0 ≤ p ≤ 1. /// If the Bernoulli parameter is not in the range [0,1]. public Bernoulli(double p) { @@ -65,7 +65,7 @@ namespace MathNet.Numerics.Distributions /// /// Initializes a new instance of the Bernoulli class. /// - /// The probability of generating one. + /// The probability (p) of generating one. Range: 0 ≤ p ≤ 1. /// The random number generator which is used to draw random samples. /// If the Bernoulli parameter is not in the range [0,1]. public Bernoulli(double p, System.Random randomSource) @@ -80,13 +80,13 @@ namespace MathNet.Numerics.Distributions /// a string representation of the distribution. public override string ToString() { - return "Bernoulli(P = " + _p + ")"; + return "Bernoulli(p = " + _p + ")"; } /// /// Checks whether the parameters of the distribution are valid. /// - /// The probability of generating a one. + /// The probability (p) of generating one. Range: 0 ≤ p ≤ 1. /// true when the parameters are valid, false otherwise. static bool IsValidParameterSet(double p) { @@ -96,7 +96,7 @@ namespace MathNet.Numerics.Distributions /// /// Sets the parameters of the distribution after checking their validity. /// - /// The probability of generating a one. + /// The probability (p) of generating one. Range: 0 ≤ p ≤ 1. /// When the parameters are out of range. void SetParameters(double p) { @@ -109,7 +109,7 @@ namespace MathNet.Numerics.Distributions } /// - /// Gets or sets the probability of generating a one. + /// Gets or sets the probability of generating a one. Range: 0 ≤ p ≤ 1. /// public double P { @@ -257,7 +257,7 @@ namespace MathNet.Numerics.Distributions /// Generates one sample from the Bernoulli distribution. /// /// The random source to use. - /// The probability of generating a one. + /// The probability (p) of generating one. Range: 0 ≤ p ≤ 1. /// A random sample from the Bernoulli distribution. static int SampleUnchecked(System.Random rnd, double p) { @@ -294,7 +294,7 @@ namespace MathNet.Numerics.Distributions /// Samples a Bernoulli distributed random variable. /// /// The random number generator to use. - /// The probability of generating a 1. + /// The probability (p) of generating one. Range: 0 ≤ p ≤ 1. /// A sample from the Bernoulli distribution. public static int Sample(System.Random rnd, double p) { @@ -310,7 +310,7 @@ namespace MathNet.Numerics.Distributions /// Samples a sequence of Bernoulli distributed random variables. /// /// The random number generator to use. - /// The probability of generating a 1. + /// The probability (p) of generating one. Range: 0 ≤ p ≤ 1. /// a sequence of samples from the distribution. public static IEnumerable Samples(System.Random rnd, double p) { diff --git a/src/Numerics/Distributions/Beta.cs b/src/Numerics/Distributions/Beta.cs index 62820dc6..130b79df 100644 --- a/src/Numerics/Distributions/Beta.cs +++ b/src/Numerics/Distributions/Beta.cs @@ -61,8 +61,8 @@ namespace MathNet.Numerics.Distributions /// /// Initializes a new instance of the Beta class. /// - /// The α shape parameter of the Beta distribution. - /// The β shape parameter of the Beta distribution. + /// The α shape parameter of the Beta distribution. Range: α ≥ 0. + /// The β shape parameter of the Beta distribution. Range: β ≥ 0. /// If any of the Beta parameters are negative. public Beta(double a, double b) { @@ -73,8 +73,8 @@ namespace MathNet.Numerics.Distributions /// /// Initializes a new instance of the Beta class. /// - /// The α shape parameter of the Beta distribution. - /// The β shape parameter of the Beta distribution. + /// The α shape parameter of the Beta distribution. Range: α ≥ 0. + /// The β shape parameter of the Beta distribution. Range: β ≥ 0. /// The random number generator which is used to draw random samples. /// If any of the Beta parameters are negative. public Beta(double a, double b, System.Random randomSource) @@ -95,8 +95,8 @@ namespace MathNet.Numerics.Distributions /// /// Checks whether the parameters of the distribution are valid. /// - /// The α shape parameter of the Beta distribution. - /// The β shape parameter of the Beta distribution. + /// The α shape parameter of the Beta distribution. Range: α ≥ 0. + /// The β shape parameter of the Beta distribution. Range: β ≥ 0. /// true when the parameters are valid, false otherwise. static bool IsValidParameterSet(double a, double b) { @@ -106,8 +106,8 @@ namespace MathNet.Numerics.Distributions /// /// Sets the parameters of the distribution after checking their validity. /// - /// The α shape parameter of the Beta distribution. - /// The β shape parameter of the Beta distribution. + /// The α shape parameter of the Beta distribution. Range: α ≥ 0. + /// The β shape parameter of the Beta distribution. Range: β ≥ 0. /// When the parameters are out of range. void SetParameters(double a, double b) { @@ -121,7 +121,7 @@ namespace MathNet.Numerics.Distributions } /// - /// Gets or sets the α shape parameter of the Beta distribution. + /// Gets or sets the α shape parameter of the Beta distribution. Range: α ≥ 0. /// public double A { @@ -130,7 +130,7 @@ namespace MathNet.Numerics.Distributions } /// - /// Gets or sets the β shape parameter of the Beta distribution. + /// Gets or sets the β shape parameter of the Beta distribution. Range: β ≥ 0. /// public double B { @@ -154,20 +154,9 @@ namespace MathNet.Numerics.Distributions { get { - if (_shapeA == 0.0 && _shapeB == 0.0) - { - return 0.5; - } - - if (_shapeA == 0.0) - { - return 0.0; - } - - if (_shapeB == 0.0) - { - return 1.0; - } + if (_shapeA == 0.0 && _shapeB == 0.0) return 0.5; + if (_shapeA == 0.0) return 0.0; + if (_shapeB == 0.0) return 1.0; if (Double.IsPositiveInfinity(_shapeA) && Double.IsPositiveInfinity(_shapeB)) { @@ -255,20 +244,9 @@ namespace MathNet.Numerics.Distributions return 2.0; } - if (_shapeA == 0.0 && _shapeB == 0.0) - { - return 0.0; - } - - if (_shapeA == 0.0) - { - return 2.0; - } - - if (_shapeB == 0.0) - { - return -2.0; - } + if (_shapeA == 0.0 && _shapeB == 0.0) return 0.0; + if (_shapeA == 0.0) return 2.0; + if (_shapeB == 0.0) return -2.0; return 2.0*(_shapeB - _shapeA)*Math.Sqrt(_shapeA + _shapeB + 1.0) /((_shapeA + _shapeB + 2.0)*Math.Sqrt(_shapeA*_shapeB)); @@ -282,20 +260,9 @@ namespace MathNet.Numerics.Distributions { get { - if (_shapeA == 0.0 && _shapeB == 0.0) - { - return 0.5; - } - - if (_shapeA == 0.0) - { - return 0.0; - } - - if (_shapeB == 0.0) - { - return 1.0; - } + if (_shapeA == 0.0 && _shapeB == 0.0) return 0.5; + if (_shapeA == 0.0) return 0.0; + if (_shapeB == 0.0) return 1.0; if (Double.IsPositiveInfinity(_shapeA) && Double.IsPositiveInfinity(_shapeB)) { @@ -312,10 +279,7 @@ namespace MathNet.Numerics.Distributions return 0.0; } - if (_shapeA == 1.0 && _shapeB == 1.0) - { - return 0.5; - } + if (_shapeA == 1.0 && _shapeB == 1.0) return 0.5; return (_shapeA - 1)/(_shapeA + _shapeB - 2); } @@ -352,10 +316,7 @@ namespace MathNet.Numerics.Distributions /// the density at . public double Density(double x) { - if (x < 0.0 || x > 1.0) - { - return 0.0; - } + if (x < 0.0 || x > 1.0) return 0.0; if (Double.IsPositiveInfinity(_shapeA) && Double.IsPositiveInfinity(_shapeB)) { @@ -382,20 +343,9 @@ namespace MathNet.Numerics.Distributions return 0.0; } - if (_shapeA == 0.0) - { - return x == 0.0 ? Double.PositiveInfinity : 0.0; - } - - if (_shapeB == 0.0) - { - return x == 1.0 ? Double.PositiveInfinity : 0.0; - } - - if (_shapeA == 1.0 && _shapeB == 1.0) - { - return 1.0; - } + if (_shapeA == 0.0) return x == 0.0 ? Double.PositiveInfinity : 0.0; + if (_shapeB == 0.0) return x == 1.0 ? Double.PositiveInfinity : 0.0; + if (_shapeA == 1.0 && _shapeB == 1.0) return 1.0; var b = SpecialFunctions.Gamma(_shapeA + _shapeB)/(SpecialFunctions.Gamma(_shapeA)*SpecialFunctions.Gamma(_shapeB)); return b*Math.Pow(x, _shapeA - 1.0)*Math.Pow(1.0 - x, _shapeB - 1.0); @@ -408,10 +358,7 @@ namespace MathNet.Numerics.Distributions /// the log density at . public double DensityLn(double x) { - if (x < 0.0 || x > 1.0) - { - return Double.NegativeInfinity; - } + if (x < 0.0 || x > 1.0) return Double.NegativeInfinity; if (Double.IsPositiveInfinity(_shapeA) && Double.IsPositiveInfinity(_shapeB)) { @@ -438,20 +385,9 @@ namespace MathNet.Numerics.Distributions return Double.NegativeInfinity; } - if (_shapeA == 0.0) - { - return x == 0.0 ? Double.PositiveInfinity : Double.NegativeInfinity; - } - - if (_shapeB == 0.0) - { - return x == 1.0 ? Double.PositiveInfinity : Double.NegativeInfinity; - } - - if (_shapeA == 1.0 && _shapeB == 1.0) - { - return 0.0; - } + if (_shapeA == 0.0) return x == 0.0 ? Double.PositiveInfinity : Double.NegativeInfinity; + if (_shapeB == 0.0) return x == 1.0 ? Double.PositiveInfinity : Double.NegativeInfinity; + if (_shapeA == 1.0 && _shapeB == 1.0) return 0.0; var a = SpecialFunctions.GammaLn(_shapeA + _shapeB) - SpecialFunctions.GammaLn(_shapeA) - SpecialFunctions.GammaLn(_shapeB); var b = x == 0.0 ? (_shapeA == 1.0 ? 0.0 : Double.NegativeInfinity) : (_shapeA - 1.0)*Math.Log(x); @@ -467,15 +403,8 @@ namespace MathNet.Numerics.Distributions /// the cumulative distribution at location . public double CumulativeDistribution(double x) { - if (x < 0.0) - { - return 0.0; - } - - if (x >= 1.0) - { - return 1.0; - } + if (x < 0.0) return 0.0; + if (x >= 1.0) return 1.0; if (Double.IsPositiveInfinity(_shapeA) && Double.IsPositiveInfinity(_shapeB)) { @@ -502,20 +431,9 @@ namespace MathNet.Numerics.Distributions return 1.0; } - if (_shapeA == 0.0) - { - return 1.0; - } - - if (_shapeB == 0.0) - { - return x >= 1.0 ? 1.0 : 0.0; - } - - if (_shapeA == 1.0 && _shapeB == 1.0) - { - return x; - } + if (_shapeA == 0.0) return 1.0; + if (_shapeB == 0.0) return x >= 1.0 ? 1.0 : 0.0; + if (_shapeA == 1.0 && _shapeB == 1.0) return x; return SpecialFunctions.BetaRegularized(_shapeA, _shapeB, x); } @@ -524,8 +442,8 @@ namespace MathNet.Numerics.Distributions /// Samples Beta distributed random variables by sampling two Gamma variables and normalizing. /// /// The random number generator to use. - /// The α shape parameter of the Beta distribution. - /// The β shape parameter of the Beta distribution. + /// The α shape parameter of the Beta distribution. Range: α ≥ 0. + /// The β shape parameter of the Beta distribution. Range: β ≥ 0. /// a random number from the Beta distribution. static double SampleUnchecked(System.Random rnd, double a, double b) { @@ -559,8 +477,8 @@ namespace MathNet.Numerics.Distributions /// Generates a sample from the distribution. /// /// The random number generator to use. - /// The α shape parameter of the Beta distribution. - /// The β shape parameter of the Beta distribution. + /// The α shape parameter of the Beta distribution. Range: α ≥ 0. + /// The β shape parameter of the Beta distribution. Range: β ≥ 0. /// a sample from the distribution. public static double Sample(System.Random rnd, double a, double b) { @@ -576,8 +494,8 @@ namespace MathNet.Numerics.Distributions /// Generates a sequence of samples from the distribution. /// /// The random number generator to use. - /// The α shape parameter of the Beta distribution. - /// The β shape parameter of the Beta distribution. + /// The α shape parameter of the Beta distribution. Range: α ≥ 0. + /// The β shape parameter of the Beta distribution. Range: β ≥ 0. /// a sequence of samples from the distribution. public static IEnumerable Samples(System.Random rnd, double a, double b) { diff --git a/src/Numerics/Distributions/Binomial.cs b/src/Numerics/Distributions/Binomial.cs index 03f3f494..279e36d6 100644 --- a/src/Numerics/Distributions/Binomial.cs +++ b/src/Numerics/Distributions/Binomial.cs @@ -55,8 +55,8 @@ namespace MathNet.Numerics.Distributions /// /// Initializes a new instance of the Binomial class. /// - /// The success probability in each trial. - /// The number of trials. + /// The success probability (p) in each trial. Range: 0 ≤ p ≤ 1. + /// The number of trials (n). Range: n ≥ 0. /// If is not in the interval [0.0,1.0]. /// If is negative. public Binomial(double p, int n) @@ -68,8 +68,8 @@ namespace MathNet.Numerics.Distributions /// /// Initializes a new instance of the Binomial class. /// - /// The success probability in each trial. - /// The number of trials. + /// The success probability (p) in each trial. Range: 0 ≤ p ≤ 1. + /// The number of trials (n). Range: n ≥ 0. /// The random number generator which is used to draw random samples. /// If is not in the interval [0.0,1.0]. /// If is negative. @@ -85,14 +85,14 @@ namespace MathNet.Numerics.Distributions /// a string representation of the distribution. public override string ToString() { - return "Binomial(Success Probability = " + _p + ", Number of Trials = " + _trials + ")"; + return "Binomial(p = " + _p + ", n = " + _trials + ")"; } /// /// Checks whether the parameters of the distribution are valid. /// - /// The success probability of a trial. - /// The number of trials. + /// The success probability (p) in each trial. Range: 0 ≤ p ≤ 1. + /// The number of trials (n). Range: n ≥ 0. /// false is not in the interval [0.0,1.0] or is negative, true otherwise. static bool IsValidParameterSet(double p, int n) { @@ -102,8 +102,8 @@ namespace MathNet.Numerics.Distributions /// /// Sets the parameters of the distribution after checking their validity. /// - /// The success probability of a trial. - /// The number of trials. + /// The success probability (p) in each trial. Range: 0 ≤ p ≤ 1. + /// The number of trials (n). Range: n ≥ 0. /// If is not in the interval [0.0,1.0]. /// If is negative. void SetParameters(double p, int n) @@ -118,7 +118,7 @@ namespace MathNet.Numerics.Distributions } /// - /// Gets or sets the success probability in each trial. + /// Gets or sets the success probability in each trial. Range: 0 ≤ p ≤ 1. /// public double P { @@ -127,7 +127,7 @@ namespace MathNet.Numerics.Distributions } /// - /// Gets or sets the number of trials. + /// Gets or sets the number of trials. Range: n ≥ 0. /// public int N { @@ -175,10 +175,7 @@ namespace MathNet.Numerics.Distributions { get { - if (_p == 0.0 || _p == 1.0) - { - return 0.0; - } + if (_p == 0.0 || _p == 1.0) return 0.0; var e = 0.0; for (var i = 0; i <= _trials; i++) @@ -222,15 +219,8 @@ namespace MathNet.Numerics.Distributions { get { - if (_p == 1.0) - { - return _trials; - } - - if (_p == 0.0) - { - return 0; - } + if (_p == 1.0) return _trials; + if (_p == 0.0) return 0; return (int) Math.Floor((_trials + 1)*_p); } @@ -251,35 +241,12 @@ namespace MathNet.Numerics.Distributions /// the probability mass at location . public double Probability(int k) { - if (k < 0) - { - return 0.0; - } - - if (k > _trials) - { - return 0.0; - } - - if (_p == 0.0 && k == 0) - { - return 1.0; - } - - if (_p == 0.0) - { - return 0.0; - } - - if (_p == 1.0 && k == _trials) - { - return 1.0; - } - - if (_p == 1.0) - { - return 0.0; - } + if (k < 0) return 0.0; + if (k > _trials) return 0.0; + if (_p == 0.0 && k == 0) return 1.0; + if (_p == 0.0) return 0.0; + if (_p == 1.0 && k == _trials) return 1.0; + if (_p == 1.0) return 0.0; return SpecialFunctions.Binomial(_trials, k)*Math.Pow(_p, k)*Math.Pow(1.0 - _p, _trials - k); } @@ -291,35 +258,12 @@ namespace MathNet.Numerics.Distributions /// the log probability mass at location . public double ProbabilityLn(int k) { - if (k < 0) - { - return Double.NegativeInfinity; - } - - if (k > _trials) - { - return Double.NegativeInfinity; - } - - if (_p == 0.0 && k == 0) - { - return 0.0; - } - - if (_p == 0.0) - { - return Double.NegativeInfinity; - } - - if (_p == 1.0 && k == _trials) - { - return 0.0; - } - - if (_p == 1.0) - { - return Double.NegativeInfinity; - } + if (k < 0) return Double.NegativeInfinity; + if (k > _trials) return Double.NegativeInfinity; + if (_p == 0.0 && k == 0) return 0.0; + if (_p == 0.0) return Double.NegativeInfinity; + if (_p == 1.0 && k == _trials) return 0.0; + if (_p == 1.0) return Double.NegativeInfinity; return SpecialFunctions.BinomialLn(_trials, k) + (k*Math.Log(_p)) + ((_trials - k)*Math.Log(1.0 - _p)); } @@ -331,15 +275,8 @@ namespace MathNet.Numerics.Distributions /// the cumulative distribution at location . public double CumulativeDistribution(double x) { - if (x < 0.0) - { - return 0.0; - } - - if (x > _trials) - { - return 1.0; - } + if (x < 0.0) return 0.0; + if (x > _trials) return 1.0; var cdf = 0.0; for (var i = 0; i <= (int) Math.Floor(x); i++) @@ -354,8 +291,8 @@ namespace MathNet.Numerics.Distributions /// Generates a sample from the Binomial distribution without doing parameter checking. /// /// The random number generator to use. - /// The success probability of a trial; must be in the interval [0.0, 1.0]. - /// The number of trials; must be positive. + /// The success probability (p) in each trial. Range: 0 ≤ p ≤ 1. + /// The number of trials (n). Range: n ≥ 0. /// The number of successful trials. static int SampleUnchecked(System.Random rnd, double p, int n) { @@ -393,8 +330,8 @@ namespace MathNet.Numerics.Distributions /// Samples a binomially distributed random variable. /// /// The random number generator to use. - /// The success probability of a trial; must be in the interval [0.0, 1.0]. - /// The number of trials; must be positive. + /// The success probability (p) in each trial. Range: 0 ≤ p ≤ 1. + /// The number of trials (n). Range: n ≥ 0. /// The number of successes in trials. public static int Sample(System.Random rnd, double p, int n) { @@ -410,8 +347,8 @@ namespace MathNet.Numerics.Distributions /// Samples a sequence of binomially distributed random variable. /// /// The random number generator to use. - /// The success probability of a trial; must be in the interval [0.0, 1.0]. - /// The number of trials; must be positive. + /// The success probability (p) in each trial. Range: 0 ≤ p ≤ 1. + /// The number of trials (n). Range: n ≥ 0. /// a sequence of successes in trials. public static IEnumerable Samples(System.Random rnd, double p, int n) { diff --git a/src/Numerics/Distributions/Cauchy.cs b/src/Numerics/Distributions/Cauchy.cs index bccd6f88..d0e016dd 100644 --- a/src/Numerics/Distributions/Cauchy.cs +++ b/src/Numerics/Distributions/Cauchy.cs @@ -58,8 +58,7 @@ namespace MathNet.Numerics.Distributions /// Initializes a new instance of the class. /// /// The location (x0) of the distribution. - /// The scale (γ) of the distribution. - /// If is negative. + /// The scale (γ) of the distribution. Range: γ > 0. public Cauchy(double location, double scale) { _random = new System.Random(); @@ -70,9 +69,8 @@ namespace MathNet.Numerics.Distributions /// Initializes a new instance of the class. /// /// The location (x0) of the distribution. - /// The scale (γ) of the distribution. + /// The scale (γ) of the distribution. Range: γ > 0. /// The random number generator which is used to draw random samples. - /// If is negative. public Cauchy(double location, double scale, System.Random randomSource) { _random = randomSource ?? new System.Random(); @@ -92,7 +90,7 @@ namespace MathNet.Numerics.Distributions /// Checks whether the parameters of the distribution are valid. /// /// The location (x0) of the distribution. - /// The scale (γ) of the distribution. Must be greater than 0. + /// The scale (γ) of the distribution. Range: γ > 0. /// True when the parameters are valid, false otherwise. static bool IsValidParameterSet(double location, double scale) { @@ -103,7 +101,7 @@ namespace MathNet.Numerics.Distributions /// Sets the parameters of the distribution after checking their validity. /// /// The location (x0) of the distribution. - /// The scale (γ) of the distribution. Must be greater than 0. + /// The scale (γ) of the distribution. Range: γ > 0. /// When the parameters are out of range. void SetParameters(double location, double scale) { @@ -126,7 +124,7 @@ namespace MathNet.Numerics.Distributions } /// - /// Gets or sets the scale (γ) of the distribution. + /// Gets or sets the scale (γ) of the distribution. Range: γ > 0. /// public double Scale { @@ -250,7 +248,7 @@ namespace MathNet.Numerics.Distributions /// /// The random number generator to use. /// The location (x0) of the distribution. - /// The scale (γ) of the distribution. + /// The scale (γ) of the distribution. Range: γ > 0. /// a random number from the distribution. static double SampleUnchecked(System.Random rnd, double location, double scale) { @@ -284,7 +282,7 @@ namespace MathNet.Numerics.Distributions /// /// The random number generator to use. /// The location (x0) of the distribution. - /// The scale (γ) of the distribution. + /// The scale (γ) of the distribution. Range: γ > 0. /// a sample from the distribution. public static double Sample(System.Random rnd, double location, double scale) { @@ -301,7 +299,7 @@ namespace MathNet.Numerics.Distributions /// /// The random number generator to use. /// The location (x0) of the distribution. - /// The scale (γ) of the distribution. + /// The scale (γ) of the distribution. Range: γ > 0. /// a sequence of samples from the distribution. public static IEnumerable Samples(System.Random rnd, double location, double scale) { diff --git a/src/Numerics/Distributions/Chi.cs b/src/Numerics/Distributions/Chi.cs index 3e82b5ba..d9e98f0d 100644 --- a/src/Numerics/Distributions/Chi.cs +++ b/src/Numerics/Distributions/Chi.cs @@ -55,7 +55,7 @@ namespace MathNet.Numerics.Distributions /// /// Initializes a new instance of the class. /// - /// The degrees of freedom (k) of the distribution. + /// The degrees of freedom (k) of the distribution. Range: k > 0. public Chi(double freedom) { _random = new System.Random(); @@ -65,7 +65,7 @@ namespace MathNet.Numerics.Distributions /// /// Initializes a new instance of the class. /// - /// The degrees of freedom (k) of the distribution. + /// The degrees of freedom (k) of the distribution. Range: k > 0. /// The random number generator which is used to draw random samples. public Chi(double freedom, System.Random randomSource) { @@ -85,7 +85,7 @@ namespace MathNet.Numerics.Distributions /// /// Checks whether the parameters of the distribution are valid. /// - /// The degrees of freedom for the Chi distribution. + /// The degrees of freedom (k) of the distribution. Range: k > 0. /// true when the parameters are valid, false otherwise. static bool IsValidParameterSet(double freedom) { @@ -95,7 +95,7 @@ namespace MathNet.Numerics.Distributions /// /// Sets the parameters of the distribution after checking their validity. /// - /// The degrees of freedom for the Chi distribution. + /// The degrees of freedom (k) of the distribution. Range: k > 0. /// When the parameters are out of range. void SetParameters(double freedom) { @@ -108,7 +108,7 @@ namespace MathNet.Numerics.Distributions } /// - /// Gets or sets the degrees of freedom (k) of the Chi distribution. + /// Gets or sets the degrees of freedom (k) of the Chi distribution. Range: k > 0. /// public double DegreesOfFreedom { @@ -243,7 +243,7 @@ namespace MathNet.Numerics.Distributions /// Samples the distribution. /// /// The random number generator to use. - /// The degrees of freedom (k) of the distribution. + /// The degrees of freedom (k) of the distribution. Range: k > 0. /// a random number from the distribution. static double SampleUnchecked(System.Random rnd, int freedom) { @@ -282,7 +282,7 @@ namespace MathNet.Numerics.Distributions /// Generates a sample from the distribution. /// /// The random number generator to use. - /// The degrees of freedom (k) of the distribution. + /// The degrees of freedom (k) of the distribution. Range: k > 0. /// a sample from the distribution. public static double Sample(System.Random rnd, int freedom) { @@ -298,7 +298,7 @@ namespace MathNet.Numerics.Distributions /// Generates a sequence of samples from the distribution. /// /// The random number generator to use. - /// The degrees of freedom (k) of the distribution. + /// The degrees of freedom (k) of the distribution. Range: k > 0. /// a sequence of samples from the distribution. public static IEnumerable Samples(System.Random rnd, int freedom) { diff --git a/src/Numerics/Distributions/ChiSquared.cs b/src/Numerics/Distributions/ChiSquared.cs index b792af99..718937a1 100644 --- a/src/Numerics/Distributions/ChiSquared.cs +++ b/src/Numerics/Distributions/ChiSquared.cs @@ -53,7 +53,7 @@ namespace MathNet.Numerics.Distributions /// /// Initializes a new instance of the class. /// - /// The degrees of freedom (k) of the distribution. + /// The degrees of freedom (k) of the distribution. Range: k > 0. public ChiSquared(double freedom) { _random = new System.Random(); @@ -63,7 +63,7 @@ namespace MathNet.Numerics.Distributions /// /// Initializes a new instance of the class. /// - /// The degrees of freedom (k) of the distribution. + /// The degrees of freedom (k) of the distribution. Range: k > 0. /// The random number generator which is used to draw random samples. public ChiSquared(double freedom, System.Random randomSource) { @@ -83,17 +83,17 @@ namespace MathNet.Numerics.Distributions /// /// Checks whether the parameters of the distribution are valid. /// - /// The degrees of freedom (k) of the distribution. + /// The degrees of freedom (k) of the distribution. Range: k > 0. /// true when the parameters are valid, false otherwise. static bool IsValidParameterSet(double freedom) { - return freedom > 0 && !Double.IsNaN(freedom); + return freedom > 0; } /// /// Sets the parameters of the distribution after checking their validity. /// - /// The degrees of freedom (k) of the distribution. + /// The degrees of freedom (k) of the distribution. Range: k > 0. /// When the parameters are out of range. void SetParameters(double freedom) { @@ -106,7 +106,7 @@ namespace MathNet.Numerics.Distributions } /// - /// Gets or sets the degrees of freedom (k) of the Chi-Squared distribution. + /// Gets or sets the degrees of freedom (k) of the Chi-Squared distribution. Range: k > 0. /// public double DegreesOfFreedom { @@ -229,7 +229,7 @@ namespace MathNet.Numerics.Distributions /// Samples the distribution. /// /// The random number generator to use. - /// The degrees of freedom (k) of the distribution. + /// The degrees of freedom (k) of the distribution. Range: k > 0. /// a random number from the distribution. static double SampleUnchecked(System.Random rnd, double freedom) { @@ -275,7 +275,7 @@ namespace MathNet.Numerics.Distributions /// Generates a sample from the ChiSquare distribution. /// /// The random number generator to use. - /// The degrees of freedom (k) of the distribution. + /// The degrees of freedom (k) of the distribution. Range: k > 0. /// a sample from the distribution. public static double Sample(System.Random rnd, double freedom) { @@ -291,7 +291,7 @@ namespace MathNet.Numerics.Distributions /// Generates a sequence of samples from the distribution. /// /// The random number generator to use. - /// The degrees of freedom (k) of the distribution. + /// The degrees of freedom (k) of the distribution. Range: k > 0. /// a sample from the distribution. public static IEnumerable Samples(System.Random rnd, double freedom) { diff --git a/src/Numerics/Distributions/ContinuousUniform.cs b/src/Numerics/Distributions/ContinuousUniform.cs index 4dc046d7..0a729854 100644 --- a/src/Numerics/Distributions/ContinuousUniform.cs +++ b/src/Numerics/Distributions/ContinuousUniform.cs @@ -61,8 +61,8 @@ namespace MathNet.Numerics.Distributions /// /// Initializes a new instance of the ContinuousUniform class with given lower and upper bounds. /// - /// Lower bound. - /// Upper bound; must be at least as large as . + /// Lower bound. Range: lower ≤ upper. + /// Upper bound. Range: lower ≤ upper. /// If the upper bound is smaller than the lower bound. public ContinuousUniform(double lower, double upper) { @@ -73,8 +73,8 @@ namespace MathNet.Numerics.Distributions /// /// Initializes a new instance of the ContinuousUniform class with given lower and upper bounds. /// - /// Lower bound. - /// Upper bound; must be at least as large as lower. + /// Lower bound. Range: lower ≤ upper. + /// Upper bound. Range: lower ≤ upper. /// The random number generator which is used to draw random samples. /// If the upper bound is smaller than the lower bound. public ContinuousUniform(double lower, double upper, System.Random randomSource) @@ -95,8 +95,8 @@ namespace MathNet.Numerics.Distributions /// /// Checks whether the parameters of the distribution are valid. /// - /// Lower bound. - /// Upper bound; must be at least as large as . + /// Lower bound. Range: lower ≤ upper. + /// Upper bound. Range: lower ≤ upper. /// true when the parameters are valid, false otherwise. static bool IsValidParameterSet(double lower, double upper) { @@ -106,8 +106,8 @@ namespace MathNet.Numerics.Distributions /// /// Sets the parameters of the distribution after checking their validity. /// - /// Lower bound. - /// Upper bound; must be at least as large as . + /// Lower bound. Range: lower ≤ upper. + /// Upper bound. Range: lower ≤ upper. /// When the parameters are out of range. void SetParameters(double lower, double upper) { @@ -276,8 +276,8 @@ namespace MathNet.Numerics.Distributions /// Generates one sample from the ContinuousUniform distribution without parameter checking. /// /// The random number generator to use. - /// The lower bound of the uniform random variable. - /// The upper bound of the uniform random variable. + /// Lower bound. Range: lower ≤ upper. + /// Upper bound. Range: lower ≤ upper. /// a uniformly distributed random number. static double SampleUnchecked(System.Random rnd, double lower, double upper) { @@ -309,8 +309,8 @@ namespace MathNet.Numerics.Distributions /// Generates a sample from the ContinuousUniform distribution. /// /// The random number generator to use. - /// The lower bound of the uniform random variable. - /// The upper bound of the uniform random variable. + /// Lower bound. Range: lower ≤ upper. + /// Upper bound. Range: lower ≤ upper. /// a uniformly distributed sample. public static double Sample(System.Random rnd, double lower, double upper) { @@ -326,8 +326,8 @@ namespace MathNet.Numerics.Distributions /// Generates a sequence of samples from the ContinuousUniform distribution. /// /// The random number generator to use. - /// The lower bound of the uniform random variable. - /// The upper bound of the uniform random variable. + /// Lower bound. Range: lower ≤ upper. + /// Upper bound. Range: lower ≤ upper. /// a sequence of uniformly distributed samples. public static IEnumerable Samples(System.Random rnd, double lower, double upper) { diff --git a/src/Numerics/Distributions/ConwayMaxwellPoisson.cs b/src/Numerics/Distributions/ConwayMaxwellPoisson.cs index 19bcf8ad..17c45e3a 100644 --- a/src/Numerics/Distributions/ConwayMaxwellPoisson.cs +++ b/src/Numerics/Distributions/ConwayMaxwellPoisson.cs @@ -82,8 +82,8 @@ namespace MathNet.Numerics.Distributions /// /// Initializes a new instance of the class. /// - /// The lambda (λ) parameter. - /// The rate of decay (ν) parameter. + /// The lambda (λ) parameter. Range: λ > 0. + /// The rate of decay (ν) parameter. Range: ν ≥ 0. public ConwayMaxwellPoisson(double lambda, double nu) { _random = new System.Random(); @@ -93,8 +93,8 @@ namespace MathNet.Numerics.Distributions /// /// Initializes a new instance of the class. /// - /// The lambda (λ) parameter. - /// The rate of decay (ν) parameter. + /// The lambda (λ) parameter. Range: λ > 0. + /// The rate of decay (ν) parameter. Range: ν ≥ 0. /// The random number generator which is used to draw random samples. public ConwayMaxwellPoisson(double lambda, double nu, System.Random randomSource) { @@ -114,8 +114,8 @@ namespace MathNet.Numerics.Distributions /// /// Checks whether the parameters of the distribution are valid. /// - /// The lambda (λ) parameter. - /// The rate of decay (ν) parameter. + /// The lambda (λ) parameter. Range: λ > 0. + /// The rate of decay (ν) parameter. Range: ν ≥ 0. /// true when the parameters are valid, false otherwise. static bool IsValidParameterSet(double lambda, double nu) { @@ -125,8 +125,8 @@ namespace MathNet.Numerics.Distributions /// /// Sets the parameters of the distribution after checking their validity. /// - /// The lambda (λ) parameter. - /// The rate of decay (ν) parameter. + /// The lambda (λ) parameter. Range: λ > 0. + /// The rate of decay (ν) parameter. Range: ν ≥ 0. /// When the parameters are out of range. void SetParameters(double lambda, double nu) { @@ -140,7 +140,7 @@ namespace MathNet.Numerics.Distributions } /// - /// Gets or sets the lambda (λ) parameter. + /// Gets or sets the lambda (λ) parameter. Range: λ > 0. /// public double Lambda { @@ -149,7 +149,7 @@ namespace MathNet.Numerics.Distributions } /// - /// Gets or sets the rate of decay (ν) parameter. + /// Gets or sets the rate of decay (ν) parameter. Range: ν ≥ 0. /// public double Nu { @@ -443,8 +443,8 @@ namespace MathNet.Numerics.Distributions /// Returns one trials from the distribution. /// /// The random number generator to use. - /// The lambda (λ) parameter. - /// The rate of decay (ν) parameter. + /// The lambda (λ) parameter. Range: λ > 0. + /// The rate of decay (ν) parameter. Range: ν ≥ 0. /// The z parameter. /// /// One sample from the distribution implied by , , and . @@ -493,8 +493,8 @@ namespace MathNet.Numerics.Distributions /// Samples a random variable. /// /// The random number generator to use. - /// The lambda (λ) parameter. - /// The rate of decay (ν) parameter. + /// The lambda (λ) parameter. Range: λ > 0. + /// The rate of decay (ν) parameter. Range: ν ≥ 0. public static int Sample(System.Random rnd, double lambda, double nu) { if (Control.CheckDistributionParameters && !IsValidParameterSet(lambda, nu)) @@ -510,8 +510,8 @@ namespace MathNet.Numerics.Distributions /// Samples a sequence of this random variable. /// /// The random number generator to use. - /// The lambda (λ) parameter. - /// The rate of decay (ν) parameter. + /// The lambda (λ) parameter. Range: λ > 0. + /// The rate of decay (ν) parameter. Range: ν ≥ 0. public static IEnumerable Samples(System.Random rnd, double lambda, double nu) { if (Control.CheckDistributionParameters && !IsValidParameterSet(lambda, nu)) diff --git a/src/Numerics/Distributions/DiscreteUniform.cs b/src/Numerics/Distributions/DiscreteUniform.cs index 94f5de18..23312582 100644 --- a/src/Numerics/Distributions/DiscreteUniform.cs +++ b/src/Numerics/Distributions/DiscreteUniform.cs @@ -55,8 +55,8 @@ namespace MathNet.Numerics.Distributions /// /// Initializes a new instance of the DiscreteUniform class. /// - /// Lower bound. - /// Upper bound; must be at least as large as . + /// Lower bound. Range: lower ≤ upper. + /// Upper bound. Range: lower ≤ upper. public DiscreteUniform(int lower, int upper) { _random = new System.Random(); @@ -66,8 +66,8 @@ namespace MathNet.Numerics.Distributions /// /// Initializes a new instance of the DiscreteUniform class. /// - /// Lower bound. - /// Upper bound; must be at least as large as . + /// Lower bound. Range: lower ≤ upper. + /// Upper bound. Range: lower ≤ upper. /// The random number generator which is used to draw random samples. public DiscreteUniform(int lower, int upper, System.Random randomSource) { @@ -89,8 +89,8 @@ namespace MathNet.Numerics.Distributions /// /// Checks whether the parameters of the distribution are valid. /// - /// Lower bound. - /// Upper bound; must be at least as large as . + /// Lower bound. Range: lower ≤ upper. + /// Upper bound. Range: lower ≤ upper. /// true when the parameters are valid, false otherwise. static bool IsValidParameterSet(int lower, int upper) { @@ -100,8 +100,8 @@ namespace MathNet.Numerics.Distributions /// /// Sets the parameters of the distribution after checking their validity. /// - /// Lower bound. - /// Upper bound; must be at least as large as . + /// Lower bound. Range: lower ≤ upper. + /// Upper bound. Range: lower ≤ upper. /// When the parameters are out of range. void SetParameters(int lower, int upper) { @@ -267,8 +267,8 @@ namespace MathNet.Numerics.Distributions /// Generates one sample from the discrete uniform distribution. This method does not do any parameter checking. /// /// The random source to use. - /// The lower bound of the uniform random variable. - /// The upper bound of the uniform random variable. + /// Lower bound. Range: lower ≤ upper. + /// Upper bound. Range: lower ≤ upper. /// A random sample from the discrete uniform distribution. static int SampleUnchecked(System.Random rnd, int lower, int upper) { @@ -300,8 +300,8 @@ namespace MathNet.Numerics.Distributions /// Samples a uniformly distributed random variable. /// /// The random number generator to use. - /// The lower bound of the uniform random variable. - /// The upper bound of the uniform random variable. + /// Lower bound. Range: lower ≤ upper. + /// Upper bound. Range: lower ≤ upper. /// A sample from the discrete uniform distribution. public static int Sample(System.Random rnd, int lower, int upper) { @@ -317,8 +317,8 @@ namespace MathNet.Numerics.Distributions /// Samples a sequence of uniformly distributed random variables. /// /// The random number generator to use. - /// The lower bound of the uniform random variable. - /// The upper bound of the uniform random variable. + /// Lower bound. Range: lower ≤ upper. + /// Upper bound. Range: lower ≤ upper. /// a sequence of samples from the discrete uniform distribution. public static IEnumerable Samples(System.Random rnd, int lower, int upper) { diff --git a/src/Numerics/Distributions/Erlang.cs b/src/Numerics/Distributions/Erlang.cs index 0798664c..eed883b9 100644 --- a/src/Numerics/Distributions/Erlang.cs +++ b/src/Numerics/Distributions/Erlang.cs @@ -55,8 +55,8 @@ namespace MathNet.Numerics.Distributions /// /// Initializes a new instance of the class. /// - /// The shape (k) of the Erlang distribution. - /// The rate or inverse scale (λ) of the Erlang distribution. + /// The shape (k) of the Erlang distribution. Range: k ≥ 0. + /// The rate or inverse scale (λ) of the Erlang distribution. Range: λ ≥ 0. public Erlang(int shape, double rate) { _random = new System.Random(); @@ -66,8 +66,8 @@ namespace MathNet.Numerics.Distributions /// /// Initializes a new instance of the class. /// - /// The shape (k) of the Erlang distribution. - /// The rate or inverse scale (λ) of the Erlang distribution. + /// The shape (k) of the Erlang distribution. Range: k ≥ 0. + /// The rate or inverse scale (λ) of the Erlang distribution. Range: λ ≥ 0. /// The random number generator which is used to draw random samples. public Erlang(int shape, double rate, System.Random randomSource) { @@ -79,9 +79,8 @@ namespace MathNet.Numerics.Distributions /// Constructs a Erlang distribution from a shape and scale parameter. The distribution will /// be initialized with the default random number generator. /// - /// The shape (k) of the Erlang distribution. - /// The scale (mu) of the Erlang distribution. - /// a normal distribution. + /// The shape (k) of the Erlang distribution. Range: k ≥ 0. + /// The scale (μ) of the Erlang distribution. Range: μ ≥ 0. public static Erlang WithShapeScale(int shape, double scale) { return new Erlang(shape, 1.0/scale); @@ -91,9 +90,8 @@ namespace MathNet.Numerics.Distributions /// Constructs a Erlang distribution from a shape and inverse scale parameter. The distribution will /// be initialized with the default random number generator. /// - /// The shape (k) of the Erlang distribution. - /// The rate or inverse scale (λ) of the Erlang distribution. - /// a normal distribution. + /// The shape (k) of the Erlang distribution. Range: k ≥ 0. + /// The rate or inverse scale (λ) of the Erlang distribution. Range: λ ≥ 0. public static Erlang WithShapeRate(int shape, double rate) { return new Erlang(shape, rate); @@ -111,8 +109,8 @@ namespace MathNet.Numerics.Distributions /// /// Checks whether the parameters of the distribution are valid. /// - /// The shape (k) of the Erlang distribution. - /// The rate or inverse scale (λ) of the Erlang distribution. + /// The shape (k) of the Erlang distribution. Range: k ≥ 0. + /// The rate or inverse scale (λ) of the Erlang distribution. Range: λ ≥ 0. /// true when the parameters are valid, false otherwise. static bool IsValidParameterSet(double shape, double rate) { @@ -122,8 +120,8 @@ namespace MathNet.Numerics.Distributions /// /// Sets the parameters of the distribution after checking their validity. /// - /// The shape (k) of the Erlang distribution. - /// The rate or inverse scale (λ) of the Erlang distribution. + /// The shape (k) of the Erlang distribution. Range: k ≥ 0. + /// The rate or inverse scale (λ) of the Erlang distribution. Range: λ ≥ 0. /// When the parameters are out of range. void SetParameters(double shape, double rate) { @@ -137,7 +135,7 @@ namespace MathNet.Numerics.Distributions } /// - /// Gets or sets the shape (k) of the Erlang distribution. + /// Gets or sets the shape (k) of the Erlang distribution. Range: k ≥ 0. /// public int Shape { @@ -146,7 +144,7 @@ namespace MathNet.Numerics.Distributions } /// - /// Gets or sets the rate or inverse scale (λ) of the Erlang distribution. + /// Gets or sets the rate or inverse scale (λ) of the Erlang distribution. Range: λ ≥ 0. /// public double Rate { @@ -412,12 +410,12 @@ namespace MathNet.Numerics.Distributions /// This method performs no parameter checks. /// /// The random number generator to use. - /// The shape of the Gamma distribution. - /// The inverse scale of the Gamma distribution. + /// The shape (k) of the Erlang distribution. Range: k ≥ 0. + /// The rate or inverse scale (λ) of the Erlang distribution. Range: λ ≥ 0. /// A sample from a Erlang distributed random variable. - static double SampleUnchecked(System.Random rnd, double shape, double invScale) + static double SampleUnchecked(System.Random rnd, double shape, double rate) { - if (Double.IsPositiveInfinity(invScale)) + if (Double.IsPositiveInfinity(rate)) { return shape; } @@ -449,12 +447,12 @@ namespace MathNet.Numerics.Distributions x = x*x; if (u < 1.0 - (0.0331*x*x)) { - return alphafix*d*v/invScale; + return alphafix*d*v/rate; } if (Math.Log(u) < (0.5*x) + (d*(1.0 - v + Math.Log(v)))) { - return alphafix*d*v/invScale; + return alphafix*d*v/rate; } } } @@ -484,36 +482,36 @@ namespace MathNet.Numerics.Distributions /// Generates a sample from the distribution. /// /// The random number generator to use. - /// The shape of the Gamma distribution. - /// The inverse scale of the Gamma distribution. + /// The shape (k) of the Erlang distribution. Range: k ≥ 0. + /// The rate or inverse scale (λ) of the Erlang distribution. Range: λ ≥ 0. /// a sample from the distribution. - public static double Sample(System.Random rnd, double shape, double invScale) + public static double Sample(System.Random rnd, double shape, double rate) { - if (Control.CheckDistributionParameters && !IsValidParameterSet(shape, invScale)) + if (Control.CheckDistributionParameters && !IsValidParameterSet(shape, rate)) { throw new ArgumentOutOfRangeException(Resources.InvalidDistributionParameters); } - return SampleUnchecked(rnd, shape, invScale); + return SampleUnchecked(rnd, shape, rate); } /// /// Generates a sequence of samples from the distribution. /// /// The random number generator to use. - /// The shape of the Gamma distribution. - /// The inverse scale of the Gamma distribution. + /// The shape (k) of the Erlang distribution. Range: k ≥ 0. + /// The rate or inverse scale (λ) of the Erlang distribution. Range: λ ≥ 0. /// a sequence of samples from the distribution. - public static IEnumerable Samples(System.Random rnd, double shape, double invScale) + public static IEnumerable Samples(System.Random rnd, double shape, double rate) { - if (Control.CheckDistributionParameters && !IsValidParameterSet(shape, invScale)) + if (Control.CheckDistributionParameters && !IsValidParameterSet(shape, rate)) { throw new ArgumentOutOfRangeException(Resources.InvalidDistributionParameters); } while (true) { - yield return SampleUnchecked(rnd, shape, invScale); + yield return SampleUnchecked(rnd, shape, rate); } } } diff --git a/src/Numerics/Distributions/Exponential.cs b/src/Numerics/Distributions/Exponential.cs index 1ea2171e..5280144d 100644 --- a/src/Numerics/Distributions/Exponential.cs +++ b/src/Numerics/Distributions/Exponential.cs @@ -53,7 +53,7 @@ namespace MathNet.Numerics.Distributions /// /// Initializes a new instance of the class. /// - /// The rate (λ) parameter of the Exponential distribution. + /// The rate (λ) parameter of the distribution. Range: λ ≥ 0. public Exponential(double rate) { _random = new System.Random(); @@ -63,7 +63,7 @@ namespace MathNet.Numerics.Distributions /// /// Initializes a new instance of the class. /// - /// The rate (λ) parameter of the Exponential distribution. + /// The rate (λ) parameter of the distribution. Range: λ ≥ 0. /// The random number generator which is used to draw random samples. public Exponential(double rate, System.Random randomSource) { @@ -83,7 +83,7 @@ namespace MathNet.Numerics.Distributions /// /// Checks whether the parameters of the distribution are valid. /// - /// The rate (λ) parameter of the Exponential distribution. + /// The rate (λ) parameter of the distribution. Range: λ ≥ 0. /// true when the parameters are valid, false otherwise. static bool IsValidParameterSet(double rate) { @@ -93,7 +93,7 @@ namespace MathNet.Numerics.Distributions /// /// Sets the parameters of the distribution after checking their validity. /// - /// The rate (λ) parameter of the Exponential distribution. + /// The rate (λ) parameter of the distribution. Range: λ ≥ 0. /// When the parameters are out of range. void SetParameters(double rate) { @@ -106,7 +106,7 @@ namespace MathNet.Numerics.Distributions } /// - /// Gets or sets the rate (λ) parameter of the distribution. + /// Gets or sets the rate (λ) parameter of the distribution. Range: λ ≥ 0. /// public double Rate { @@ -239,7 +239,7 @@ namespace MathNet.Numerics.Distributions /// Samples the distribution. /// /// The random number generator to use. - /// The rate (λ) parameter of the Exponential distribution. + /// The rate (λ) parameter of the distribution. Range: λ ≥ 0. /// a random number from the distribution. static double SampleUnchecked(System.Random rnd, double rate) { @@ -277,7 +277,7 @@ namespace MathNet.Numerics.Distributions /// Draws a random sample from the distribution. /// /// The random number generator to use. - /// The rate (λ) parameter of the Exponential distribution. + /// The rate (λ) parameter of the distribution. Range: λ ≥ 0. /// A random number from this distribution. public static double Sample(System.Random rnd, double rate) { @@ -293,7 +293,7 @@ namespace MathNet.Numerics.Distributions /// Generates a sequence of samples from the Exponential distribution. /// /// The random number generator to use. - /// The rate (λ) parameter of the Exponential distribution. + /// The rate (λ) parameter of the distribution. Range: λ ≥ 0. /// a sequence of samples from the distribution. public static IEnumerable Samples(System.Random rnd, double rate) { diff --git a/src/Numerics/Distributions/FisherSnedecor.cs b/src/Numerics/Distributions/FisherSnedecor.cs index a40c210c..3d1e8627 100644 --- a/src/Numerics/Distributions/FisherSnedecor.cs +++ b/src/Numerics/Distributions/FisherSnedecor.cs @@ -54,8 +54,8 @@ namespace MathNet.Numerics.Distributions /// /// Initializes a new instance of the class. /// - /// The first degree of freedom (d1) of the distribution. - /// The second degree of freedom (d2) of the distribution. + /// The first degree of freedom (d1) of the distribution. Range: d1 > 0. + /// The second degree of freedom (d2) of the distribution. Range: d2 > 0. public FisherSnedecor(double d1, double d2) { _random = new System.Random(); @@ -65,8 +65,8 @@ namespace MathNet.Numerics.Distributions /// /// Initializes a new instance of the class. /// - /// The first degree of freedom (d1) of the distribution. - /// The second degree of freedom (d2) of the distribution. + /// The first degree of freedom (d1) of the distribution. Range: d1 > 0. + /// The second degree of freedom (d2) of the distribution. Range: d2 > 0. /// The random number generator which is used to draw random samples. public FisherSnedecor(double d1, double d2, System.Random randomSource) { @@ -86,8 +86,8 @@ namespace MathNet.Numerics.Distributions /// /// Checks whether the parameters of the distribution are valid. /// - /// The first degree of freedom (d1) of the distribution. - /// The second degree of freedom (d2) of the distribution. + /// The first degree of freedom (d1) of the distribution. Range: d1 > 0. + /// The second degree of freedom (d2) of the distribution. Range: d2 > 0. /// true when the parameters are valid, false otherwise. static bool IsValidParameterSet(double d1, double d2) { @@ -97,8 +97,8 @@ namespace MathNet.Numerics.Distributions /// /// Sets the parameters of the distribution after checking their validity. /// - /// The first degree of freedom (d1) of the distribution. - /// The second degree of freedom (d2) of the distribution. + /// The first degree of freedom (d1) of the distribution. Range: d1 > 0. + /// The second degree of freedom (d2) of the distribution. Range: d2 > 0. /// When the parameters are out of range. void SetParameters(double d1, double d2) { @@ -112,7 +112,7 @@ namespace MathNet.Numerics.Distributions } /// - /// Gets or sets the first parameter - degree of freedom. + /// Gets or sets the first degree of freedom (d1) of the distribution. Range: d1 > 0. /// public double DegreesOfFreedom1 { @@ -121,7 +121,7 @@ namespace MathNet.Numerics.Distributions } /// - /// Gets or sets the second parameter - degree of freedom. + /// Gets or sets the second degree of freedom (d2) of the distribution. Range: d2 > 0. /// public double DegreesOfFreedom2 { @@ -276,8 +276,8 @@ namespace MathNet.Numerics.Distributions /// Generates one sample from the FisherSnedecor distribution without parameter checking. /// /// The random number generator to use. - /// The first degree of freedom (d1) of the distribution. - /// The second degree of freedom (d2) of the distribution. + /// The first degree of freedom (d1) of the distribution. Range: d1 > 0. + /// The second degree of freedom (d2) of the distribution. Range: d2 > 0. /// a FisherSnedecor distributed random number. static double SampleUnchecked(System.Random rnd, double d1, double d2) { @@ -309,8 +309,8 @@ namespace MathNet.Numerics.Distributions /// Generates a sample from the distribution. /// /// The random number generator to use. - /// The first degree of freedom (d1) of the distribution. - /// The second degree of freedom (d2) of the distribution. + /// The first degree of freedom (d1) of the distribution. Range: d1 > 0. + /// The second degree of freedom (d2) of the distribution. Range: d2 > 0. /// a sample from the distribution. public static double Sample(System.Random rnd, double d1, double d2) { @@ -326,8 +326,8 @@ namespace MathNet.Numerics.Distributions /// Generates a sequence of samples from the distribution. /// /// The random number generator to use. - /// The first degree of freedom (d1) of the distribution. - /// The second degree of freedom (d2) of the distribution. + /// The first degree of freedom (d1) of the distribution. Range: d1 > 0. + /// The second degree of freedom (d2) of the distribution. Range: d2 > 0. /// a sequence of samples from the distribution. public static IEnumerable Samples(System.Random rnd, double d1, double d2) { diff --git a/src/Numerics/Distributions/Gamma.cs b/src/Numerics/Distributions/Gamma.cs index e1a6364e..552d893b 100644 --- a/src/Numerics/Distributions/Gamma.cs +++ b/src/Numerics/Distributions/Gamma.cs @@ -62,8 +62,8 @@ namespace MathNet.Numerics.Distributions /// /// Initializes a new instance of the Gamma class. /// - /// The shape (k, α) of the Gamma distribution. - /// The rate or inverse scale (β) of the Gamma distribution. + /// The shape (k, α) of the Gamma distribution. Range: α ≥ 0. + /// The rate or inverse scale (β) of the Gamma distribution. Range: β ≥ 0. public Gamma(double shape, double rate) { _random = new System.Random(); @@ -73,8 +73,8 @@ namespace MathNet.Numerics.Distributions /// /// Initializes a new instance of the Gamma class. /// - /// The shape (k, α) of the Gamma distribution. - /// The rate or inverse scale (β) of the Gamma distribution. + /// The shape (k, α) of the Gamma distribution. Range: α ≥ 0. + /// The rate or inverse scale (β) of the Gamma distribution. Range: β ≥ 0. /// The random number generator which is used to draw random samples. public Gamma(double shape, double rate, System.Random randomSource) { @@ -86,8 +86,8 @@ namespace MathNet.Numerics.Distributions /// Constructs a Gamma distribution from a shape and scale parameter. The distribution will /// be initialized with the default random number generator. /// - /// The shape (k) of the Gamma distribution. - /// The scale (θ) of the Gamma distribution. + /// The shape (k) of the Gamma distribution. Range: k ≥ 0. + /// The scale (θ) of the Gamma distribution. Range: θ ≥ 0 public static Gamma WithShapeScale(double shape, double scale) { return new Gamma(shape, 1.0/scale); @@ -97,8 +97,8 @@ namespace MathNet.Numerics.Distributions /// Constructs a Gamma distribution from a shape and inverse scale parameter. The distribution will /// be initialized with the default random number generator. /// - /// The shape (α) of the Gamma distribution. - /// The rate or inverse scale (β) of the Gamma distribution. + /// The shape (k, α) of the Gamma distribution. Range: α ≥ 0. + /// The rate or inverse scale (β) of the Gamma distribution. Range: β ≥ 0. public static Gamma WithShapeRate(double shape, double rate) { return new Gamma(shape, rate); @@ -116,8 +116,8 @@ namespace MathNet.Numerics.Distributions /// /// Checks whether the parameters of the distribution are valid. /// - /// The shape (k, α) of the Gamma distribution. - /// The rate or inverse scale (β) of the Gamma distribution. + /// The shape (k, α) of the Gamma distribution. Range: α ≥ 0. + /// The rate or inverse scale (β) of the Gamma distribution. Range: β ≥ 0. /// true when the parameters are valid, false otherwise. static bool IsValidParameterSet(double shape, double rate) { @@ -127,8 +127,8 @@ namespace MathNet.Numerics.Distributions /// /// Sets the parameters of the distribution after checking their validity. /// - /// The shape (k, α) of the Gamma distribution. - /// The rate or inverse scale (β) of the Gamma distribution. + /// The shape (k, α) of the Gamma distribution. Range: α ≥ 0. + /// The rate or inverse scale (β) of the Gamma distribution. Range: β ≥ 0. /// When the parameters are out of range. void SetParameters(double shape, double rate) { @@ -142,7 +142,7 @@ namespace MathNet.Numerics.Distributions } /// - /// Gets or sets the shape (k, α) of the Gamma distribution. + /// Gets or sets the shape (k, α) of the Gamma distribution. Range: α ≥ 0. /// public double Shape { @@ -151,7 +151,7 @@ namespace MathNet.Numerics.Distributions } /// - /// Gets or sets the rate or inverse scale (β) of the Gamma distribution. + /// Gets or sets the rate or inverse scale (β) of the Gamma distribution. Range: β ≥ 0. /// public double Rate { @@ -412,8 +412,8 @@ namespace MathNet.Numerics.Distributions /// This method performs no parameter checks. /// /// The random number generator to use. - /// The shape (k, α) of the Gamma distribution. - /// The rate or inverse scale (β) of the Gamma distribution. + /// The shape (k, α) of the Gamma distribution. Range: α ≥ 0. + /// The rate or inverse scale (β) of the Gamma distribution. Range: β ≥ 0. /// A sample from a Gamma distributed random variable. internal static double SampleUnchecked(System.Random rnd, double shape, double rate) { @@ -484,8 +484,8 @@ namespace MathNet.Numerics.Distributions /// Generates a sample from the Gamma distribution. /// /// The random number generator to use. - /// The shape (k, α) of the Gamma distribution. - /// The rate or inverse scale (β) of the Gamma distribution. + /// The shape (k, α) of the Gamma distribution. Range: α ≥ 0. + /// The rate or inverse scale (β) of the Gamma distribution. Range: β ≥ 0. /// a sample from the distribution. public static double Sample(System.Random rnd, double shape, double rate) { @@ -501,8 +501,8 @@ namespace MathNet.Numerics.Distributions /// Generates a sequence of samples from the Gamma distribution. /// /// The random number generator to use. - /// The shape (k, α) of the Gamma distribution. - /// The rate or inverse scale (β) of the Gamma distribution. + /// The shape (k, α) of the Gamma distribution. Range: α ≥ 0. + /// The rate or inverse scale (β) of the Gamma distribution. Range: β ≥ 0. /// a sequence of samples from the distribution. public static IEnumerable Samples(System.Random rnd, double shape, double rate) { diff --git a/src/Numerics/Distributions/Geometric.cs b/src/Numerics/Distributions/Geometric.cs index f3b3fbfa..8713d4ec 100644 --- a/src/Numerics/Distributions/Geometric.cs +++ b/src/Numerics/Distributions/Geometric.cs @@ -38,7 +38,7 @@ namespace MathNet.Numerics.Distributions /// Discrete Univariate Geometric distribution. /// The Geometric distribution is a distribution over positive integers parameterized by one positive real number. /// This implementation of the Geometric distribution will never generate 0's. - /// Wikipedia - geometric distribution. + /// Wikipedia - geometric distribution. /// /// The distribution will use the by default. /// Users can set the random number generator by using the property. @@ -54,8 +54,7 @@ namespace MathNet.Numerics.Distributions /// /// Initializes a new instance of the Geometric class. /// - /// The probability of generating one. - /// If the Geometric parameter is not in the range [0,1]. + /// The probability (p) of generating one. Range: 0 ≤ p ≤ 1. public Geometric(double p) { _random = new System.Random(); @@ -65,9 +64,8 @@ namespace MathNet.Numerics.Distributions /// /// Initializes a new instance of the Geometric class. /// - /// The probability of generating one. + /// The probability (p) of generating one. Range: 0 ≤ p ≤ 1. /// The random number generator which is used to draw random samples. - /// If the Geometric parameter is not in the range [0,1]. public Geometric(double p, System.Random randomSource) { _random = randomSource ?? new System.Random(); @@ -77,18 +75,16 @@ namespace MathNet.Numerics.Distributions /// /// Returns a that represents this instance. /// - /// - /// A that represents this instance. - /// + /// A that represents this instance. public override string ToString() { - return "Geometric(P = " + _p + ")"; + return "Geometric(p = " + _p + ")"; } /// /// Checks whether the parameters of the distribution are valid. /// - /// The probability of generating a one. + /// The probability (p) of generating one. Range: 0 ≤ p ≤ 1. /// true when the parameters are valid, false otherwise. static bool IsValidParameterSet(double p) { @@ -98,7 +94,7 @@ namespace MathNet.Numerics.Distributions /// /// Sets the parameters of the distribution after checking their validity. /// - /// The probability of generating a one. + /// The probability (p) of generating one. Range: 0 ≤ p ≤ 1. /// When the parameters are out of range. void SetParameters(double p) { @@ -111,7 +107,7 @@ namespace MathNet.Numerics.Distributions } /// - /// Gets or sets the probability of generating a one. + /// Gets or sets the probability of generating a one. Range: 0 ≤ p ≤ 1. /// public double P { @@ -245,10 +241,8 @@ namespace MathNet.Numerics.Distributions /// Returns one sample from the distribution. /// /// The random number generator to use. - /// The p parameter - /// - /// One sample from the distribution implied by . - /// + /// The probability (p) of generating one. Range: 0 ≤ p ≤ 1. + /// One sample from the distribution implied by . static int SampleUnchecked(System.Random rnd, double p) { return p == 1.0 ? 1 : (int) Math.Ceiling(-Math.Log(1.0 - rnd.NextDouble(), 1.0 - p)); @@ -279,7 +273,7 @@ namespace MathNet.Numerics.Distributions /// Samples a random variable. /// /// The random number generator to use. - /// The p parameter + /// The probability (p) of generating one. Range: 0 ≤ p ≤ 1. public static int Sample(System.Random rnd, double p) { if (Control.CheckDistributionParameters && !IsValidParameterSet(p)) @@ -294,7 +288,7 @@ namespace MathNet.Numerics.Distributions /// Samples a sequence of this random variable. /// /// The random number generator to use. - /// The p parameter + /// The probability (p) of generating one. Range: 0 ≤ p ≤ 1. public static IEnumerable Samples(System.Random rnd, double p) { if (Control.CheckDistributionParameters && !IsValidParameterSet(p)) diff --git a/src/Numerics/Distributions/InverseGamma.cs b/src/Numerics/Distributions/InverseGamma.cs index 55b5eb39..35bbc784 100644 --- a/src/Numerics/Distributions/InverseGamma.cs +++ b/src/Numerics/Distributions/InverseGamma.cs @@ -55,8 +55,8 @@ namespace MathNet.Numerics.Distributions /// /// Initializes a new instance of the class. /// - /// The shape (α) of the inverse Gamma distribution. - /// The scale (β) of the inverse Gamma distribution. + /// The shape (α) of the distribution. Range: α > 0. + /// The scale (β) of the distribution. Range: β > 0. public InverseGamma(double shape, double scale) { _random = new System.Random(); @@ -66,8 +66,8 @@ namespace MathNet.Numerics.Distributions /// /// Initializes a new instance of the class. /// - /// The shape (α) of the inverse Gamma distribution. - /// The scale (β) of the inverse Gamma distribution. + /// The shape (α) of the distribution. Range: α > 0. + /// The scale (β) of the distribution. Range: β > 0. /// The random number generator which is used to draw random samples. public InverseGamma(double shape, double scale, System.Random randomSource) { @@ -87,8 +87,8 @@ namespace MathNet.Numerics.Distributions /// /// Checks whether the parameters of the distribution are valid. /// - /// The shape (α) of the inverse Gamma distribution. - /// The scale (β) of the inverse Gamma distribution. + /// The shape (α) of the distribution. Range: α > 0. + /// The scale (β) of the distribution. Range: β > 0. /// true when the parameters are valid, false otherwise. static bool IsValidParameterSet(double shape, double scale) { @@ -98,8 +98,8 @@ namespace MathNet.Numerics.Distributions /// /// Sets the parameters of the distribution after checking their validity. /// - /// The shape (α) of the inverse Gamma distribution. - /// The scale (β) of the inverse Gamma distribution. + /// The shape (α) of the distribution. Range: α > 0. + /// The scale (β) of the distribution. Range: β > 0. /// When the parameters are out of range. void SetParameters(double shape, double scale) { @@ -113,7 +113,7 @@ namespace MathNet.Numerics.Distributions } /// - /// Gets or sets the shape (α) parameter. + /// Gets or sets the shape (α) parameter. Range: α > 0. /// public double Shape { @@ -122,7 +122,7 @@ namespace MathNet.Numerics.Distributions } /// - /// Gets or sets The scale (β) parameter. + /// Gets or sets The scale (β) parameter. Range: β > 0. /// public double Scale { @@ -275,8 +275,8 @@ namespace MathNet.Numerics.Distributions /// Samples the distribution. /// /// The random number generator to use. - /// The shape (α) of the inverse Gamma distribution. - /// The scale (β) of the inverse Gamma distribution. + /// The shape (α) of the distribution. Range: α > 0. + /// The scale (β) of the distribution. Range: β > 0. /// a random number from the distribution. static double SampleUnchecked(System.Random rnd, double shape, double scale) { @@ -308,8 +308,8 @@ namespace MathNet.Numerics.Distributions /// Generates a sample from the distribution. /// /// The random number generator to use. - /// The shape (α) of the inverse Gamma distribution. - /// The scale (β) of the inverse Gamma distribution. + /// The shape (α) of the distribution. Range: α > 0. + /// The scale (β) of the distribution. Range: β > 0. /// a sample from the distribution. public static double Sample(System.Random rnd, double shape, double scale) { @@ -325,8 +325,8 @@ namespace MathNet.Numerics.Distributions /// Generates a sequence of samples from the distribution. /// /// The random number generator to use. - /// The shape (α) of the inverse Gamma distribution. - /// The scale (β) of the inverse Gamma distribution. + /// The shape (α) of the distribution. Range: α > 0. + /// The scale (β) of the distribution. Range: β > 0. /// a sequence of samples from the distribution. public static IEnumerable Samples(System.Random rnd, double shape, double scale) { diff --git a/src/Numerics/Distributions/Laplace.cs b/src/Numerics/Distributions/Laplace.cs index d5a2833e..172cb65e 100644 --- a/src/Numerics/Distributions/Laplace.cs +++ b/src/Numerics/Distributions/Laplace.cs @@ -64,8 +64,8 @@ namespace MathNet.Numerics.Distributions /// /// Initializes a new instance of the class. /// - /// The location for the Laplace distribution. - /// The scale for the Laplace distribution. + /// The location (μ) of the distribution. + /// The scale (b) of the distribution. Range: b > 0. /// If is negative. public Laplace(double location, double scale) { @@ -76,8 +76,8 @@ namespace MathNet.Numerics.Distributions /// /// Initializes a new instance of the class. /// - /// The location for the Laplace distribution. - /// The scale for the Laplace distribution. + /// The location (μ) of the distribution. + /// The scale (b) of the distribution. Range: b > 0. /// The random number generator which is used to draw random samples. /// If is negative. public Laplace(double location, double scale, System.Random randomSource) @@ -98,8 +98,8 @@ namespace MathNet.Numerics.Distributions /// /// Checks whether the parameters of the distribution are valid. /// - /// The location (μ) of the Laplace distribution. - /// The scale (b) of the Laplace distribution. + /// The location (μ) of the distribution. + /// The scale (b) of the distribution. Range: b > 0. /// true when the parameters are valid, false otherwise. static bool IsValidParameterSet(double location, double scale) { @@ -109,8 +109,8 @@ namespace MathNet.Numerics.Distributions /// /// Sets the parameters of the distribution after checking their validity. /// - /// The location (μ) of the Laplace distribution. - /// The scale (b) of the Laplace distribution. + /// The location (μ) of the distribution. + /// The scale (b) of the distribution. Range: b > 0. /// When the parameters are out of range. void SetParameters(double location, double scale) { @@ -133,7 +133,7 @@ namespace MathNet.Numerics.Distributions } /// - /// Gets or sets the scale (b) of the Laplace distribution. + /// Gets or sets the scale (b) of the Laplace distribution. Range: b > 0. /// public double Scale { @@ -256,8 +256,8 @@ namespace MathNet.Numerics.Distributions /// Samples the distribution. /// /// The random number generator to use. - /// The location (μ) of the Laplace distribution. - /// The scale (b) of the Laplace distribution. + /// The location (μ) of the distribution. + /// The scale (b) of the distribution. Range: b > 0. /// a random number from the distribution. static double SampleUnchecked(System.Random rnd, double location, double scale) { @@ -290,8 +290,8 @@ namespace MathNet.Numerics.Distributions /// Generates a sample from the distribution. /// /// The random number generator to use. - /// The location (μ) of the Laplace distribution. - /// The scale (b) of the Laplace distribution. + /// The location (μ) of the distribution. + /// The scale (b) of the distribution. Range: b > 0. /// a sample from the distribution. public static double Sample(System.Random rnd, double location, double scale) { @@ -307,8 +307,8 @@ namespace MathNet.Numerics.Distributions /// Generates a sequence of samples from the distribution. /// /// The random number generator to use. - /// The location (μ) of the Laplace distribution. - /// The scale (b) of the Laplace distribution. + /// The location (μ) of the distribution. + /// The scale (b) of the distribution. Range: b > 0. /// a sequence of samples from the distribution. public static IEnumerable Samples(System.Random rnd, double location, double scale) { diff --git a/src/Numerics/Distributions/NegativeBinomial.cs b/src/Numerics/Distributions/NegativeBinomial.cs index 62907812..a0368ce5 100644 --- a/src/Numerics/Distributions/NegativeBinomial.cs +++ b/src/Numerics/Distributions/NegativeBinomial.cs @@ -56,8 +56,8 @@ namespace MathNet.Numerics.Distributions /// /// Initializes a new instance of the class. /// - /// The number of failures until the experiment stopped. - /// The probability of a trial resulting in success. + /// The number of failures (r) until the experiment stopped. Range: r ≥ 0. + /// The probability (p) of a trial resulting in success. Range: 0 ≤ p ≤ 1. public NegativeBinomial(double r, double p) { _random = new System.Random(); @@ -67,8 +67,8 @@ namespace MathNet.Numerics.Distributions /// /// Initializes a new instance of the class. /// - /// The number of failures until the experiment stopped. - /// The probability of a trial resulting in success. + /// The number of failures (r) until the experiment stopped. Range: r ≥ 0. + /// The probability (p) of a trial resulting in success. Range: 0 ≤ p ≤ 1. /// The random number generator which is used to draw random samples. public NegativeBinomial(double r, double p, System.Random randomSource) { @@ -90,8 +90,8 @@ namespace MathNet.Numerics.Distributions /// /// Checks whether the parameters of the distribution are valid. /// - /// The number of failures until the experiment stopped. - /// The probability of a trial resulting in success. + /// The number of failures (r) until the experiment stopped. Range: r ≥ 0. + /// The probability (p) of a trial resulting in success. Range: 0 ≤ p ≤ 1. /// true when the parameters are valid, false otherwise. static bool IsValidParameterSet(double r, double p) { @@ -101,8 +101,8 @@ namespace MathNet.Numerics.Distributions /// /// Sets the parameters of the distribution after checking their validity. /// - /// The number of failures until the experiment stopped. - /// The probability of a trial resulting in success. + /// The number of failures (r) until the experiment stopped. Range: r ≥ 0. + /// The probability (p) of a trial resulting in success. Range: 0 ≤ p ≤ 1. /// When the parameters are out of range. void SetParameters(double r, double p) { @@ -116,7 +116,7 @@ namespace MathNet.Numerics.Distributions } /// - /// Gets or sets the number of trials. + /// Gets or sets the number of trials. Range: r ≥ 0. /// public double R { @@ -125,7 +125,7 @@ namespace MathNet.Numerics.Distributions } /// - /// Gets or sets the probability of success. + /// Gets or sets the probability of success. Range: 0 ≤ p ≤ 1. /// public double P { @@ -257,8 +257,8 @@ namespace MathNet.Numerics.Distributions /// Samples a negative binomial distributed random variable. /// /// The random number generator to use. - /// The number of failures until the experiment stopped. - /// The probability of a trial resulting in success. + /// The number of failures (r) until the experiment stopped. Range: r ≥ 0. + /// The probability (p) of a trial resulting in success. Range: 0 ≤ p ≤ 1. /// a sample from the distribution. static int SampleUnchecked(System.Random rnd, double r, double p) { @@ -299,8 +299,8 @@ namespace MathNet.Numerics.Distributions /// Samples a random variable. /// /// The random number generator to use. - /// The number of failures until the experiment stopped. - /// The probability of a trial resulting in success. + /// The number of failures (r) until the experiment stopped. Range: r ≥ 0. + /// The probability (p) of a trial resulting in success. Range: 0 ≤ p ≤ 1. public static int Sample(System.Random rnd, double r, double p) { if (Control.CheckDistributionParameters && !IsValidParameterSet(r, p)) @@ -315,8 +315,8 @@ namespace MathNet.Numerics.Distributions /// Samples a sequence of this random variable. /// /// The random number generator to use. - /// The number of failures until the experiment stopped. - /// The probability of a trial resulting in success. + /// The number of failures (r) until the experiment stopped. Range: r ≥ 0. + /// The probability (p) of a trial resulting in success. Range: 0 ≤ p ≤ 1. public static IEnumerable Samples(System.Random rnd, double r, double p) { if (Control.CheckDistributionParameters && !IsValidParameterSet(r, p)) diff --git a/src/Numerics/Distributions/Pareto.cs b/src/Numerics/Distributions/Pareto.cs index 5f46ce74..2caf58d5 100644 --- a/src/Numerics/Distributions/Pareto.cs +++ b/src/Numerics/Distributions/Pareto.cs @@ -56,8 +56,8 @@ namespace MathNet.Numerics.Distributions /// /// Initializes a new instance of the class. /// - /// The scale (xm) of the distribution. - /// The shape (α) of the distribution. + /// The scale (xm) of the distribution. Range: xm > 0. + /// The shape (α) of the distribution. Range: α > 0. /// If or are negative. public Pareto(double scale, double shape) { @@ -68,8 +68,8 @@ namespace MathNet.Numerics.Distributions /// /// Initializes a new instance of the class. /// - /// The scale (xm) of the distribution. - /// The shape (α) of the distribution. + /// The scale (xm) of the distribution. Range: xm > 0. + /// The shape (α) of the distribution. Range: α > 0. /// The random number generator which is used to draw random samples. /// If or are negative. public Pareto(double scale, double shape, System.Random randomSource) @@ -90,8 +90,8 @@ namespace MathNet.Numerics.Distributions /// /// Checks whether the parameters of the distribution are valid. /// - /// The scale (xm) of the distribution. - /// The shape (α) of the distribution. + /// The scale (xm) of the distribution. Range: xm > 0. + /// The shape (α) of the distribution. Range: α > 0. /// true when the parameters are valid, false otherwise. static bool IsValidParameterSet(double scale, double shape) { @@ -101,8 +101,8 @@ namespace MathNet.Numerics.Distributions /// /// Sets the parameters of the distribution after checking their validity. /// - /// The scale (xm) of the distribution. - /// The shape (α) of the distribution. + /// The scale (xm) of the distribution. Range: xm > 0. + /// The shape (α) of the distribution. Range: α > 0. /// When the parameters are out of range. void SetParameters(double scale, double shape) { @@ -116,7 +116,7 @@ namespace MathNet.Numerics.Distributions } /// - /// Gets or sets the scale (xm) of the distribution. + /// Gets or sets the scale (xm) of the distribution. Range: xm > 0. /// public double Scale { @@ -125,7 +125,7 @@ namespace MathNet.Numerics.Distributions } /// - /// Gets or sets the shape (α) of the distribution. + /// Gets or sets the shape (α) of the distribution. Range: α > 0. /// public double Shape { @@ -264,8 +264,8 @@ namespace MathNet.Numerics.Distributions /// Generates a sample from the Pareto distribution without doing parameter checking. /// /// The random number generator to use. - /// The scale (xm) of the distribution. - /// The shape (α) of the distribution. + /// The scale (xm) of the distribution. Range: xm > 0. + /// The shape (α) of the distribution. Range: α > 0. /// a random number from the Pareto distribution. static double SampleUnchecked(System.Random rnd, double scale, double shape) { @@ -297,8 +297,8 @@ namespace MathNet.Numerics.Distributions /// Generates a sample from the distribution. /// /// The random number generator to use. - /// The scale (xm) of the distribution. - /// The shape (α) of the distribution. + /// The scale (xm) of the distribution. Range: xm > 0. + /// The shape (α) of the distribution. Range: α > 0. /// a sample from the distribution. public static double Sample(System.Random rnd, double scale, double shape) { @@ -314,8 +314,8 @@ namespace MathNet.Numerics.Distributions /// Generates a sequence of samples from the distribution. /// /// The random number generator to use. - /// The scale (xm) of the distribution. - /// The shape (α) of the distribution. + /// The scale (xm) of the distribution. Range: xm > 0. + /// The shape (α) of the distribution. Range: α > 0. /// a sequence of samples from the distribution. public static IEnumerable Samples(System.Random rnd, double scale, double shape) { diff --git a/src/Numerics/Distributions/Poisson.cs b/src/Numerics/Distributions/Poisson.cs index 0a675430..87d80219 100644 --- a/src/Numerics/Distributions/Poisson.cs +++ b/src/Numerics/Distributions/Poisson.cs @@ -51,7 +51,7 @@ namespace MathNet.Numerics.Distributions /// /// Initializes a new instance of the class. /// - /// The Poisson distribution parameter λ. + /// The lambda (λ) parameter of the Poisson distribution. Range: λ > 0. /// If is equal or less then 0.0. public Poisson(double lambda) { @@ -62,7 +62,7 @@ namespace MathNet.Numerics.Distributions /// /// Initializes a new instance of the class. /// - /// The Poisson distribution parameter λ. + /// The lambda (λ) parameter of the Poisson distribution. Range: λ > 0. /// The random number generator which is used to draw random samples. /// If is equal or less then 0.0. public Poisson(double lambda, System.Random randomSource) @@ -85,7 +85,7 @@ namespace MathNet.Numerics.Distributions /// /// Checks whether the parameters of the distribution are valid. /// - /// The mean (λ) of the distribution. + /// The lambda (λ) parameter of the Poisson distribution. Range: λ > 0. /// true when the parameters are valid, false otherwise. static bool IsValidParameterSet(double lambda) { @@ -95,7 +95,7 @@ namespace MathNet.Numerics.Distributions /// /// Sets the parameters of the distribution after checking their validity. /// - /// The mean (λ) of the distribution. + /// The lambda (λ) parameter of the Poisson distribution. Range: λ > 0. /// When the parameters are out of range. void SetParameters(double lambda) { @@ -108,7 +108,7 @@ namespace MathNet.Numerics.Distributions } /// - /// Gets or sets the Poisson distribution parameter λ. + /// Gets or sets the Poisson distribution parameter λ. Range: λ > 0. /// public double Lambda { @@ -233,7 +233,7 @@ namespace MathNet.Numerics.Distributions /// Generates one sample from the Poisson distribution. /// /// The random source to use. - /// The Poisson distribution parameter λ. + /// The lambda (λ) parameter of the Poisson distribution. Range: λ > 0. /// A random sample from the Poisson distribution. static int SampleUnchecked(System.Random rnd, double lambda) { @@ -244,7 +244,7 @@ namespace MathNet.Numerics.Distributions /// Generates one sample from the Poisson distribution by Knuth's method. /// /// The random source to use. - /// The Poisson distribution parameter λ. + /// The lambda (λ) parameter of the Poisson distribution. Range: λ > 0. /// A random sample from the Poisson distribution. static int DoSampleShort(System.Random rnd, double lambda) { @@ -262,7 +262,7 @@ namespace MathNet.Numerics.Distributions /// Generates one sample from the Poisson distribution by "Rejection method PA". /// /// The random source to use. - /// The Poisson distribution parameter λ. + /// The lambda (λ) parameter of the Poisson distribution. Range: λ > 0. /// A random sample from the Poisson distribution. /// "Rejection method PA" from "The Computer Generation of Poisson Random Variables" by A. C. Atkinson, /// Journal of the Royal Statistical Society Series C (Applied Statistics) Vol. 28, No. 1. (1979) @@ -321,7 +321,7 @@ namespace MathNet.Numerics.Distributions /// Samples a Poisson distributed random variable. /// /// The random number generator to use. - /// The Poisson distribution parameter λ. + /// The lambda (λ) parameter of the Poisson distribution. Range: λ > 0. /// A sample from the Poisson distribution. public static int Sample(System.Random rnd, double lambda) { @@ -337,7 +337,7 @@ namespace MathNet.Numerics.Distributions /// Samples a sequence of Poisson distributed random variables. /// /// The random number generator to use. - /// The Poisson distribution parameter λ. + /// The lambda (λ) parameter of the Poisson distribution. Range: λ > 0. /// a sequence of samples from the distribution. public static IEnumerable Samples(System.Random rnd, double lambda) { diff --git a/src/Numerics/Distributions/Rayleigh.cs b/src/Numerics/Distributions/Rayleigh.cs index 834ee329..dd85730a 100644 --- a/src/Numerics/Distributions/Rayleigh.cs +++ b/src/Numerics/Distributions/Rayleigh.cs @@ -56,7 +56,7 @@ namespace MathNet.Numerics.Distributions /// /// Initializes a new instance of the class. /// - /// The scale (σ) of the distribution. + /// The scale (σ) of the distribution. Range: σ > 0. /// If is negative. public Rayleigh(double scale) { @@ -67,7 +67,7 @@ namespace MathNet.Numerics.Distributions /// /// Initializes a new instance of the class. /// - /// The scale (σ) of the distribution. + /// The scale (σ) of the distribution. Range: σ > 0. /// The random number generator which is used to draw random samples. /// If is negative. public Rayleigh(double scale, System.Random randomSource) @@ -88,7 +88,7 @@ namespace MathNet.Numerics.Distributions /// /// Checks whether the parameters of the distribution are valid. /// - /// The scale (σ) of the distribution. + /// The scale (σ) of the distribution. Range: σ > 0. /// true when the parameters are valid, false otherwise. static bool IsValidParameterSet(double scale) { @@ -98,7 +98,7 @@ namespace MathNet.Numerics.Distributions /// /// Sets the parameters of the distribution after checking their validity. /// - /// The scale (σ) of the distribution. + /// The scale (σ) of the distribution. Range: σ > 0. /// When the parameters are out of range. void SetParameters(double scale) { @@ -111,7 +111,7 @@ namespace MathNet.Numerics.Distributions } /// - /// Gets or sets the scale (σ) of the distribution. + /// Gets or sets the scale (σ) of the distribution. Range: σ > 0. /// public double Scale { @@ -234,7 +234,7 @@ namespace MathNet.Numerics.Distributions /// Generates a sample from the Rayleigh distribution without doing parameter checking. /// /// The random number generator to use. - /// The scale (σ) of the distribution. + /// The scale (σ) of the distribution. Range: σ > 0. /// a random number from the Rayleigh distribution. static double SampleUnchecked(System.Random rnd, double scale) { @@ -266,7 +266,7 @@ namespace MathNet.Numerics.Distributions /// Generates a sample from the distribution. /// /// The random number generator to use. - /// The scale (σ) of the distribution. + /// The scale (σ) of the distribution. Range: σ > 0. /// a sample from the distribution. public static double Sample(System.Random rnd, double scale) { @@ -282,7 +282,7 @@ namespace MathNet.Numerics.Distributions /// Generates a sequence of samples from the distribution. /// /// The random number generator to use. - /// The scale (σ) of the distribution. + /// The scale (σ) of the distribution. Range: σ > 0. /// a sequence of samples from the distribution. public static IEnumerable Samples(System.Random rnd, double scale) { diff --git a/src/Numerics/Distributions/Stable.cs b/src/Numerics/Distributions/Stable.cs index b422d641..096e04b3 100644 --- a/src/Numerics/Distributions/Stable.cs +++ b/src/Numerics/Distributions/Stable.cs @@ -59,9 +59,9 @@ namespace MathNet.Numerics.Distributions /// /// Initializes a new instance of the class. /// - /// The stability (α) of the distribution. - /// The skewness (β) of the distribution. - /// The scale (c) of the distribution. + /// The stability (α) of the distribution. Range: 2 ≥ α > 0. + /// The skewness (β) of the distribution. Range: 1 ≥ β ≥ -1. + /// The scale (c) of the distribution. Range: c > 0. /// The location (μ) of the distribution. public Stable(double alpha, double beta, double scale, double location) { @@ -72,9 +72,9 @@ namespace MathNet.Numerics.Distributions /// /// Initializes a new instance of the class. /// - /// The stability (α) of the distribution. - /// The skewness (β) of the distribution. - /// The scale (c) of the distribution. + /// The stability (α) of the distribution. Range: 2 ≥ α > 0. + /// The skewness (β) of the distribution. Range: 1 ≥ β ≥ -1. + /// The scale (c) of the distribution. Range: c > 0. /// The location (μ) of the distribution. /// The random number generator which is used to draw random samples. public Stable(double alpha, double beta, double scale, double location, System.Random randomSource) @@ -95,9 +95,9 @@ namespace MathNet.Numerics.Distributions /// /// Checks whether the parameters of the distribution are valid. /// - /// The stability (α) of the distribution. - /// The skewness (β) of the distribution. - /// The scale (c) of the distribution. + /// The stability (α) of the distribution. Range: 2 ≥ α > 0. + /// The skewness (β) of the distribution. Range: 1 ≥ β ≥ -1. + /// The scale (c) of the distribution. Range: c > 0. /// The location (μ) of the distribution. /// true when the parameters are valid, false otherwise. static bool IsValidParameterSet(double alpha, double beta, double scale, double location) @@ -108,9 +108,9 @@ namespace MathNet.Numerics.Distributions /// /// Sets the parameters of the distribution after checking their validity. /// - /// The stability (α) of the distribution. - /// The skewness (β) of the distribution. - /// The scale (c) of the distribution. + /// The stability (α) of the distribution. Range: 2 ≥ α > 0. + /// The skewness (β) of the distribution. Range: 1 ≥ β ≥ -1. + /// The scale (c) of the distribution. Range: c > 0. /// The location (μ) of the distribution. /// When the parameters are out of range. void SetParameters(double alpha, double beta, double scale, double location) @@ -127,7 +127,7 @@ namespace MathNet.Numerics.Distributions } /// - /// Gets or sets the stability (α) of the distribution. + /// Gets or sets the stability (α) of the distribution. Range: 2 ≥ α > 0. /// public double Alpha { @@ -136,7 +136,7 @@ namespace MathNet.Numerics.Distributions } /// - /// Gets or sets The skewness (β) of the distribution. + /// Gets or sets The skewness (β) of the distribution. Range: 1 ≥ β ≥ -1. /// public double Beta { @@ -145,7 +145,7 @@ namespace MathNet.Numerics.Distributions } /// - /// Gets or sets the scale (c) of the distribution. + /// Gets or sets the scale (c) of the distribution. Range: c > 0. /// public double Scale { @@ -399,9 +399,9 @@ namespace MathNet.Numerics.Distributions /// Samples the distribution. /// /// The random number generator to use. - /// The stability (α) of the distribution. - /// The skewness (β) of the distribution. - /// The scale (c) of the distribution. + /// The stability (α) of the distribution. Range: 2 ≥ α > 0. + /// The skewness (β) of the distribution. Range: 1 ≥ β ≥ -1. + /// The scale (c) of the distribution. Range: c > 0. /// The location (μ) of the distribution. /// a random number from the distribution. static double SampleUnchecked(System.Random rnd, double alpha, double beta, double scale, double location) @@ -457,9 +457,9 @@ namespace MathNet.Numerics.Distributions /// Generates a sample from the distribution. /// /// The random number generator to use. - /// The stability (α) of the distribution. - /// The skewness (β) of the distribution. - /// The scale (c) of the distribution. + /// The stability (α) of the distribution. Range: 2 ≥ α > 0. + /// The skewness (β) of the distribution. Range: 1 ≥ β ≥ -1. + /// The scale (c) of the distribution. Range: c > 0. /// The location (μ) of the distribution. /// a sample from the distribution. public static double Sample(System.Random rnd, double alpha, double beta, double scale, double location) @@ -476,9 +476,9 @@ namespace MathNet.Numerics.Distributions /// Generates a sequence of samples from the distribution. /// /// The random number generator to use. - /// The stability (α) of the distribution. - /// The skewness (β) of the distribution. - /// The scale (c) of the distribution. + /// The stability (α) of the distribution. Range: 2 ≥ α > 0. + /// The skewness (β) of the distribution. Range: 1 ≥ β ≥ -1. + /// The scale (c) of the distribution. Range: c > 0. /// The location (μ) of the distribution. /// a sequence of samples from the distribution. public static IEnumerable Samples(System.Random rnd, double alpha, double beta, double scale, double location) diff --git a/src/Numerics/Distributions/StudentT.cs b/src/Numerics/Distributions/StudentT.cs index 0823a476..b60c086b 100644 --- a/src/Numerics/Distributions/StudentT.cs +++ b/src/Numerics/Distributions/StudentT.cs @@ -79,8 +79,8 @@ namespace MathNet.Numerics.Distributions /// be initialized with the default random number generator. /// /// The location (μ) of the distribution. - /// The scale (σ) of the distribution. - /// The degrees of freedom (ν) for the distribution. + /// The scale (σ) of the distribution. Range: σ > 0. + /// The degrees of freedom (ν) for the distribution. Range: ν > 0. public StudentT(double location, double scale, double freedom) { _random = new System.Random(); @@ -93,8 +93,8 @@ namespace MathNet.Numerics.Distributions /// be initialized with the default random number generator. /// /// The location (μ) of the distribution. - /// The scale (σ) of the distribution. - /// The degrees of freedom (ν) for the distribution. + /// The scale (σ) of the distribution. Range: σ > 0. + /// The degrees of freedom (ν) for the distribution. Range: ν > 0. /// The random number generator which is used to draw random samples. public StudentT(double location, double scale, double freedom, System.Random randomSource) { @@ -115,8 +115,8 @@ namespace MathNet.Numerics.Distributions /// Checks whether the parameters of the distribution are valid. /// /// The location (μ) of the distribution. - /// The scale (σ) of the distribution. - /// The degrees of freedom (ν) for the distribution. + /// The scale (σ) of the distribution. Range: σ > 0. + /// The degrees of freedom (ν) for the distribution. Range: ν > 0. /// true when the parameters are valid, false otherwise. static bool IsValidParameterSet(double location, double scale, double freedom) { @@ -127,8 +127,8 @@ namespace MathNet.Numerics.Distributions /// Sets the parameters of the distribution after checking their validity. /// /// The location (μ) of the distribution. - /// The scale (σ) of the distribution. - /// The degrees of freedom (ν) for the distribution. + /// The scale (σ) of the distribution. Range: σ > 0. + /// The degrees of freedom (ν) for the distribution. Range: ν > 0. /// When the parameters are out of range. void SetParameters(double location, double scale, double freedom) { @@ -152,7 +152,7 @@ namespace MathNet.Numerics.Distributions } /// - /// Gets or sets the scale (σ) of the Student t-distribution. + /// Gets or sets the scale (σ) of the Student t-distribution. Range: σ > 0. /// public double Scale { @@ -161,7 +161,7 @@ namespace MathNet.Numerics.Distributions } /// - /// Gets or sets the degrees of freedom (ν) of the Student t-distribution. + /// Gets or sets the degrees of freedom (ν) of the Student t-distribution. Range: ν > 0. /// public double DegreesOfFreedom { @@ -353,8 +353,8 @@ namespace MathNet.Numerics.Distributions /// in L. Devroye's "Non-Uniform Random Variate Generation" /// The random number generator to use. /// The location (μ) of the distribution. - /// The scale (σ) of the distribution. - /// The degrees of freedom (ν) for the distribution. + /// The scale (σ) of the distribution. Range: σ > 0. + /// The degrees of freedom (ν) for the distribution. Range: ν > 0. /// a random number from the standard student-t distribution. static double SampleUnchecked(System.Random rnd, double location, double scale, double freedom) { @@ -388,8 +388,8 @@ namespace MathNet.Numerics.Distributions /// /// The random number generator to use. /// The location (μ) of the distribution. - /// The scale (σ) of the distribution. - /// The degrees of freedom (ν) for the distribution. + /// The scale (σ) of the distribution. Range: σ > 0. + /// The degrees of freedom (ν) for the distribution. Range: ν > 0. /// a sample from the distribution. public static double Sample(System.Random rnd, double location, double scale, double freedom) { @@ -406,8 +406,8 @@ namespace MathNet.Numerics.Distributions /// /// The random number generator to use. /// The location (μ) of the distribution. - /// The scale (σ) of the distribution. - /// The degrees of freedom (ν) for the distribution. + /// The scale (σ) of the distribution. Range: σ > 0. + /// The degrees of freedom (ν) for the distribution. Range: ν > 0. /// a sequence of samples from the distribution. public static IEnumerable Samples(System.Random rnd, double location, double scale, double freedom) { diff --git a/src/Numerics/Distributions/Weibull.cs b/src/Numerics/Distributions/Weibull.cs index aeacd3b2..e11a3aab 100644 --- a/src/Numerics/Distributions/Weibull.cs +++ b/src/Numerics/Distributions/Weibull.cs @@ -65,8 +65,8 @@ namespace MathNet.Numerics.Distributions /// /// Initializes a new instance of the Weibull class. /// - /// The shape (k) of the Weibull distribution. - /// The scale (λ) of the Weibull distribution. + /// The shape (k) of the Weibull distribution. Range: k > 0. + /// The scale (λ) of the Weibull distribution. Range: λ > 0. public Weibull(double shape, double scale) { _random = new System.Random(); @@ -76,8 +76,8 @@ namespace MathNet.Numerics.Distributions /// /// Initializes a new instance of the Weibull class. /// - /// The shape (k) of the Weibull distribution. - /// The scale (λ) of the Weibull distribution. + /// The shape (k) of the Weibull distribution. Range: k > 0. + /// The scale (λ) of the Weibull distribution. Range: λ > 0. /// The random number generator which is used to draw random samples. public Weibull(double shape, double scale, System.Random randomSource) { @@ -97,8 +97,8 @@ namespace MathNet.Numerics.Distributions /// /// Checks whether the parameters of the distribution are valid. /// - /// The shape (k) of the Weibull distribution. - /// The scale (λ) of the Weibull distribution. + /// The shape (k) of the Weibull distribution. Range: k > 0. + /// The scale (λ) of the Weibull distribution. Range: λ > 0. /// true when the parameters positive valid floating point numbers, false otherwise. static bool IsValidParameterSet(double shape, double scale) { @@ -108,8 +108,8 @@ namespace MathNet.Numerics.Distributions /// /// Sets the parameters of the distribution after checking their validity. /// - /// The shape (k) of the Weibull distribution. - /// The scale (λ) of the Weibull distribution. + /// The shape (k) of the Weibull distribution. Range: k > 0. + /// The scale (λ) of the Weibull distribution. Range: λ > 0. /// When the parameters are out of range. void SetParameters(double shape, double scale) { @@ -124,7 +124,7 @@ namespace MathNet.Numerics.Distributions } /// - /// Gets or sets the shape (k) of the Weibull distribution. + /// Gets or sets the shape (k) of the Weibull distribution. Range: k > 0. /// public double Shape { @@ -133,7 +133,7 @@ namespace MathNet.Numerics.Distributions } /// - /// Gets or sets the scale (λ) of the Weibull distribution. + /// Gets or sets the scale (λ) of the Weibull distribution. Range: λ > 0. /// public double Scale { @@ -297,8 +297,8 @@ namespace MathNet.Numerics.Distributions /// any parameter checks. /// /// The random number generator to use. - /// The shape (k) of the Weibull distribution. - /// The scale (λ) of the Weibull distribution. + /// The shape (k) of the Weibull distribution. Range: k > 0. + /// The scale (λ) of the Weibull distribution. Range: λ > 0. /// A sample from a Weibull distributed random variable. static double SampleUnchecked(System.Random rnd, double shape, double scale) { @@ -331,8 +331,8 @@ namespace MathNet.Numerics.Distributions /// Generates a sample from the Weibull distribution. /// /// The random number generator to use. - /// The shape (k) of the Weibull distribution. - /// The scale (λ) of the Weibull distribution. + /// The shape (k) of the Weibull distribution. Range: k > 0. + /// The scale (λ) of the Weibull distribution. Range: λ > 0. /// a sample from the distribution. public static double Sample(System.Random rnd, double shape, double scale) { @@ -348,8 +348,8 @@ namespace MathNet.Numerics.Distributions /// Generates a sequence of samples from the Weibull distribution. /// /// The random number generator to use. - /// The shape (k) of the Weibull distribution. - /// The scale (λ) of the Weibull distribution. + /// The shape (k) of the Weibull distribution. Range: k > 0. + /// The scale (λ) of the Weibull distribution. Range: λ > 0. /// a sequence of samples from the distribution. public static IEnumerable Samples(System.Random rnd, double shape, double scale) {