C# Class NSoft.NFramework.Numerics.Distributions.Continuous.Gamma

Implements the univariate Gamma distribution. For details about this distribution, see Wikipedia - Gamma distribution.

The Gamma distribution is parametrized by a shape and inverse scale parameter. When we want to specify a Gamma distribution which is a point distribution we set the shape parameter to be the location of the point distribution and the inverse scale as positive infinity. The distribution with shape and inverse scale both zero is undefined.

Random number generation for the Gamma distribution is based on the algorithm in: "A Simple Method for Generating Gamma Variables" - Marsaglia & Tsang ACM Transactions on Mathematical Software, Vol. 26, No. 3, September 2000, Pages 363?72.

The distribution will use the System.Random by default. Users can get/set the random number generator by using the RandomSource property.

The statistics classes will check all the incoming parameters whether they are in the allowed range. This might involve heavy computation. Optionally, by setting Control.CheckDistributionParameters to false, all parameter checks can be turned off.

Inheritance: IContinuousDistribution
Afficher le fichier Open project: debop/NFramework

Méthodes publiques

Méthode Description
CumulativeDistribution ( double x ) : double

확률 분포 계산을 위한 누적분포함수

Density ( double x ) : double

분포의 확률 밀도

Density ( double shape, double invScale, double x ) : double

감마분포의 확률밀도를 계산합니다.

DensityLn ( double x ) : double

분포의 로그 확률 밀도

DensityLn ( double shape, double invScale, double x ) : double

감마분포의 로그 확률밀도를 계산합니다.

Gamma ( double shape, double invScale, Func randomFactory = null ) : System
Sample ( ) : double

분포의 무작위 값을 제공합니다.

Sample ( Random rnd, double shape, double invScale ) : double

감마 분포의 샘플 데이타를 생성합니다.

Samples ( ) : IEnumerable

현 분포의 무작위 값을 열거합니다.

Samples ( Random rnd, double shape, double invScale ) : IEnumerable

감마 분포의 샘플 데이타를 생성합니다.

ToString ( ) : string
WithShapeInvScale ( double shape, double invScale ) : Gamma

Constructs a Gamma distribution from a shape and inverse scale parameter. The distribution will be initialized with the default System.Random random number generator.

WithShapeScale ( double shape, double scale ) : Gamma

Constructs a Gamma distribution from a shape and scale parameter. The distribution will be initialized with the default System.Random random number generator.

Private Methods

Méthode Description
AssertParameters ( double shape, double invScale ) : void
SampleGamma ( Random rnd, double shape, double invScale ) : double

Sampling implementation based on: "A Simple Method for Generating Gamma Variables" - Marsaglia & Tsang ACM Transactions on Mathematical Software, Vol. 26, No. 3, September 2000, Pages 363?72.

This method performs no parameter checks.

SetParameters ( double shape, double invScale ) : void

Method Details

CumulativeDistribution() public méthode

확률 분포 계산을 위한 누적분포함수
public CumulativeDistribution ( double x ) : double
x double The location at which to compute the cumulative distribution function.
Résultat double

Density() public méthode

분포의 확률 밀도
public Density ( double x ) : double
x double
Résultat double

Density() public static méthode

감마분포의 확률밀도를 계산합니다.
public static Density ( double shape, double invScale, double x ) : double
shape double
invScale double
x double
Résultat double

DensityLn() public méthode

분포의 로그 확률 밀도
public DensityLn ( double x ) : double
x double
Résultat double

DensityLn() public static méthode

감마분포의 로그 확률밀도를 계산합니다.
public static DensityLn ( double shape, double invScale, double x ) : double
shape double
invScale double
x double
Résultat double

Gamma() public méthode

public Gamma ( double shape, double invScale, Func randomFactory = null ) : System
shape double
invScale double
randomFactory Func
Résultat System

Sample() public méthode

분포의 무작위 값을 제공합니다.
public Sample ( ) : double
Résultat double

Sample() public static méthode

감마 분포의 샘플 데이타를 생성합니다.
public static Sample ( Random rnd, double shape, double invScale ) : double
rnd System.Random
shape double
invScale double
Résultat double

Samples() public méthode

현 분포의 무작위 값을 열거합니다.
public Samples ( ) : IEnumerable
Résultat IEnumerable

Samples() public static méthode

감마 분포의 샘플 데이타를 생성합니다.
public static Samples ( Random rnd, double shape, double invScale ) : IEnumerable
rnd System.Random
shape double
invScale double
Résultat IEnumerable

ToString() public méthode

public ToString ( ) : string
Résultat string

WithShapeInvScale() public static méthode

Constructs a Gamma distribution from a shape and inverse scale parameter. The distribution will be initialized with the default System.Random random number generator.
public static WithShapeInvScale ( double shape, double invScale ) : Gamma
shape double The shape of the Gamma distribution.
invScale double The inverse scale of the Gamma distribution.
Résultat Gamma

WithShapeScale() public static méthode

Constructs a Gamma distribution from a shape and scale parameter. The distribution will be initialized with the default System.Random random number generator.
public static WithShapeScale ( double shape, double scale ) : Gamma
shape double The shape of the Gamma distribution.
scale double The scale of the Gamma distribution.
Résultat Gamma