C# Class NSoft.NFramework.Numerics.Distributions.Discrete.Binomial

Implements the binomial distribution. For details about this distribution, see Wikipedia - Binomial distribution.

The distribution is parameterized by a probability (between 0.0 and 1.0).

The distribution will use the System.Random by default. Users can 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: IDiscreteDistribution
Show file Open project: debop/NFramework

Public Methods

Method Description
Binomial ( double p, int n, Func randomFactory = null ) : System
CumulativeDistribution ( double x ) : double

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

Probability ( int k ) : double

분포의 확률

ProbabilityLn ( int k ) : double

분포의 Log 확률

Sample ( ) : int

분포의 데이타를 반환합니다.

Sample ( Random rnd, double p, int n ) : int
Samples ( ) : IEnumerable

분포의 무작위 데이타를 열거합니다.

Samples ( Random rnd, double p, int n ) : IEnumerable
ToString ( ) : string

Private Methods

Method Description
AssertParameters ( double p, int n ) : void
DoSamples ( Random rnd, double p, int n ) : IEnumerable
SetParameters ( double p, int n ) : void

Method Details

Binomial() public method

public Binomial ( double p, int n, Func randomFactory = null ) : System
p double
n int
randomFactory Func
return System

CumulativeDistribution() public method

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

Probability() public method

분포의 확률
public Probability ( int k ) : double
k int 시도 횟수
return double

ProbabilityLn() public method

분포의 Log 확률
public ProbabilityLn ( int k ) : double
k int
return double

Sample() public method

분포의 데이타를 반환합니다.
public Sample ( ) : int
return int

Sample() public static method

public static Sample ( Random rnd, double p, int n ) : int
rnd System.Random
p double
n int
return int

Samples() public method

분포의 무작위 데이타를 열거합니다.
public Samples ( ) : IEnumerable
return IEnumerable

Samples() public static method

public static Samples ( Random rnd, double p, int n ) : IEnumerable
rnd System.Random
p double
n int
return IEnumerable

ToString() public method

public ToString ( ) : string
return string