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
파일 보기 프로젝트 열기: debop/NFramework

공개 메소드들

메소드 설명
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