C# Класс 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.

Наследование: IContinuousDistribution
Показать файл Открыть проект

Открытые методы

Метод Описание
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.

Приватные методы

Метод Описание
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

Описание методов

CumulativeDistribution() публичный Метод

확률 분포 계산을 위한 누적분포함수
public CumulativeDistribution ( double x ) : double
x double The location at which to compute the cumulative distribution function.
Результат double

Density() публичный Метод

분포의 확률 밀도
public Density ( double x ) : double
x double
Результат double

Density() публичный статический Метод

감마분포의 확률밀도를 계산합니다.
public static Density ( double shape, double invScale, double x ) : double
shape double
invScale double
x double
Результат double

DensityLn() публичный Метод

분포의 로그 확률 밀도
public DensityLn ( double x ) : double
x double
Результат double

DensityLn() публичный статический Метод

감마분포의 로그 확률밀도를 계산합니다.
public static DensityLn ( double shape, double invScale, double x ) : double
shape double
invScale double
x double
Результат double

Gamma() публичный Метод

public Gamma ( double shape, double invScale, Func randomFactory = null ) : System
shape double
invScale double
randomFactory Func
Результат System

Sample() публичный Метод

분포의 무작위 값을 제공합니다.
public Sample ( ) : double
Результат double

Sample() публичный статический Метод

감마 분포의 샘플 데이타를 생성합니다.
public static Sample ( Random rnd, double shape, double invScale ) : double
rnd System.Random
shape double
invScale double
Результат double

Samples() публичный Метод

현 분포의 무작위 값을 열거합니다.
public Samples ( ) : IEnumerable
Результат IEnumerable

Samples() публичный статический Метод

감마 분포의 샘플 데이타를 생성합니다.
public static Samples ( Random rnd, double shape, double invScale ) : IEnumerable
rnd System.Random
shape double
invScale double
Результат IEnumerable

ToString() публичный Метод

public ToString ( ) : string
Результат string

WithShapeInvScale() публичный статический Метод

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.
Результат Gamma

WithShapeScale() публичный статический Метод

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.
Результат Gamma