C# 클래스 numl.Math.Probability.Sampling

SimpleRNG is a simple random number generator based on George Marsaglia's MWC (multiply with carry) generator. Although it is very simple, it passes Marsaglia's DIEHARD series of random number generator tests. Written by John D. Cook http://www.johndcook.com.
파일 보기 프로젝트 열기: sethjuarez/numl 1 사용 예제들

공개 메소드들

메소드 설명
GetBeta ( double a, double b ) : double

Gets a beta.

GetCauchy ( double median, double scale ) : double

Gets a cauchy.

GetChiSquare ( double degreesOfFreedom ) : double

Gets chi square.

GetExponential ( ) : double

Exponential random sample with mean 1.

GetExponential ( double mean ) : double

Exponential random sample with specified mean.

GetGamma ( double shape, double scale ) : double

Gets a gamma.

GetInverseGamma ( double shape, double scale ) : double

Gets inverse gamma.

GetLaplace ( double mean, double scale ) : double

The Laplace distribution is also known as the double exponential distribution.

GetLogNormal ( double mu, double sigma ) : double

Gets log normal.

GetNormal ( ) : double

Normal (Gaussian) random sample with mean 0 and standard deviation 1.

GetNormal ( double mean, double standardDeviation ) : double

Normal (Gaussian) random sample with specified mean and standard deviation.

GetPower ( double a, double min = 1 ) : double

Gets a power.

GetStudentT ( double degreesOfFreedom ) : double

Gets student.

GetUniform ( ) : double

Produce a uniform random sample from the open interval (0, 1). The method will not return either end point.

GetUniform ( double min = 0d, double max = 1.0d ) : double

Produce a uniform random sample from the open interval (min, max inclusive). The method can return either end point

GetUniform ( int max ) : int

Produce a uniform random sample from the open interval (0, max). The method will not return either end point.

GetUniform ( int min, int max ) : int

Produce a uniform random sample from the open interval (min, max). The method can return either end point.

GetWeibull ( double shape, double scale ) : double

Gets a weibull.

SetSeedFromSystemTime ( ) : void

Creates random number generator seed.

SetSeedFromTime ( System.DateTime dt ) : void

Set random seed from a specified time

비공개 메소드들

메소드 설명
GetUint ( ) : uint

This is the heart of the generator. It uses George Marsaglia's MWC algorithm to produce an unsigned integer. See http://www.bobwheeler.com/statistics/Password/MarsagliaPost.txt.

Sampling ( ) : System

Static constructor.

SetSeed ( uint u ) : void

Sets a seed.

SetSeed ( uint u, uint v ) : void

The random generator seed can be set three ways: 1) specifying two non-zero unsigned integers 2) specifying one non-zero unsigned integer and taking a default value for the second 3) setting the seed from the system time.

메소드 상세

GetBeta() 공개 정적인 메소드

Gets a beta.
Thrown when one or more arguments are outside the /// required range.
public static GetBeta ( double a, double b ) : double
a double The double to process.
b double The double to process.
리턴 double

GetCauchy() 공개 정적인 메소드

Gets a cauchy.
Thrown when one or more arguments have unsupported or /// illegal values.
public static GetCauchy ( double median, double scale ) : double
median double The median.
scale double The scale.
리턴 double

GetChiSquare() 공개 정적인 메소드

Gets chi square.
public static GetChiSquare ( double degreesOfFreedom ) : double
degreesOfFreedom double The degrees of freedom.
리턴 double

GetExponential() 공개 정적인 메소드

Exponential random sample with mean 1.
public static GetExponential ( ) : double
리턴 double

GetExponential() 공개 정적인 메소드

Exponential random sample with specified mean.
Thrown when one or more arguments are outside the /// required range.
public static GetExponential ( double mean ) : double
mean double mean parameter.
리턴 double

GetGamma() 공개 정적인 메소드

Gets a gamma.
Thrown when one or more arguments are outside the /// required range.
public static GetGamma ( double shape, double scale ) : double
shape double The shape.
scale double The scale.
리턴 double

GetInverseGamma() 공개 정적인 메소드

Gets inverse gamma.
public static GetInverseGamma ( double shape, double scale ) : double
shape double The shape.
scale double The scale.
리턴 double

GetLaplace() 공개 정적인 메소드

The Laplace distribution is also known as the double exponential distribution.
public static GetLaplace ( double mean, double scale ) : double
mean double Mean.
scale double The scale.
리턴 double

GetLogNormal() 공개 정적인 메소드

Gets log normal.
public static GetLogNormal ( double mu, double sigma ) : double
mu double The mu.
sigma double The sigma.
리턴 double

GetNormal() 공개 정적인 메소드

Normal (Gaussian) random sample with mean 0 and standard deviation 1.
public static GetNormal ( ) : double
리턴 double

GetNormal() 공개 정적인 메소드

Normal (Gaussian) random sample with specified mean and standard deviation.
Thrown when one or more arguments are outside the /// required range.
public static GetNormal ( double mean, double standardDeviation ) : double
mean double Mean.
standardDeviation double Standard deviation.
리턴 double

GetPower() 공개 정적인 메소드

Gets a power.
public static GetPower ( double a, double min = 1 ) : double
a double The double to process.
min double (Optional) Min (exclusive)
리턴 double

GetStudentT() 공개 정적인 메소드

Gets student.
Thrown when one or more arguments have unsupported or /// illegal values.
public static GetStudentT ( double degreesOfFreedom ) : double
degreesOfFreedom double The degrees of freedom.
리턴 double

GetUniform() 공개 정적인 메소드

Produce a uniform random sample from the open interval (0, 1). The method will not return either end point.
public static GetUniform ( ) : double
리턴 double

GetUniform() 공개 정적인 메소드

Produce a uniform random sample from the open interval (min, max inclusive). The method can return either end point
public static GetUniform ( double min = 0d, double max = 1.0d ) : double
min double
max double
리턴 double

GetUniform() 공개 정적인 메소드

Produce a uniform random sample from the open interval (0, max). The method will not return either end point.
public static GetUniform ( int max ) : int
max int Max (Exclusive)
리턴 int

GetUniform() 공개 정적인 메소드

Produce a uniform random sample from the open interval (min, max). The method can return either end point.
public static GetUniform ( int min, int max ) : int
min int Min (exclusive)
max int Max (exclusive)
리턴 int

GetWeibull() 공개 정적인 메소드

Gets a weibull.
Thrown when one or more arguments are outside the /// required range.
public static GetWeibull ( double shape, double scale ) : double
shape double The shape.
scale double The scale.
리턴 double

SetSeedFromSystemTime() 공개 정적인 메소드

Creates random number generator seed.
public static SetSeedFromSystemTime ( ) : void
리턴 void

SetSeedFromTime() 공개 정적인 메소드

Set random seed from a specified time
public static SetSeedFromTime ( System.DateTime dt ) : void
dt System.DateTime date time
리턴 void