Class Sampler
Inheritance
Inherited Members
Namespace: System.Dynamic.ExpandoObject
Assembly: Arithmetica.dll
Syntax
public class Sampler
Methods
Bernoulli(ArithArray, Single, Nullable<Int32>)
Samples are drawn from a binomial distribution with specified parameters, n trials and p probability of success where n an integer >= 0 and p is in the interval [0,1]. (n may be input as a float, but it is truncated to an integer in use)
Declaration
public static void Bernoulli(ArithArray x, float p, int? seed = default(int? ))
Parameters
ArithArray
x
The output array. |
System.Single
p
The p. |
System.Nullable<System.Int32>
seed
The seed. |
Cauchy(ArithArray, Single, Single, Nullable<Int32>)
Draw samples from a standard Cauchy distribution. The Cauchy distribution arises in the solution to the driven harmonic oscillator problem, and also describes spectral line broadening. It also describes the distribution of values at which a line tilted at a random angle will cut the x axis. When studying hypothesis tests that assume normality, seeing how the tests perform on data from a Cauchy distribution is a good indicator of their sensitivity to a heavy-tailed distribution, since the Cauchy looks very much like a Gaussian distribution, but with heavier tails.
Declaration
public static void Cauchy(ArithArray x, float median, float sigma, int? seed = default(int? ))
Parameters
ArithArray
x
The output array. |
System.Single
median
The median value. |
System.Single
sigma
The sigma. |
System.Nullable<System.Int32>
seed
The seed. |
Exponential(ArithArray, Single, Nullable<Int32>)
Draw samples from an exponential distribution. The exponential distribution is a continuous analogue of the geometric distribution.
Declaration
public static void Exponential(ArithArray x, float lambda, int? seed = default(int? ))
Parameters
ArithArray
x
The output array. |
System.Single
lambda
The lambda value. |
System.Nullable<System.Int32>
seed
The seed. |
Geometric(ArithArray, Single, Nullable<Int32>)
Draw samples from the geometric distribution. Bernoulli trials are experiments with one of two outcomes: success or failure(an example of such an experiment is flipping a coin). The geometric distribution models the number of trials that must be run in order to achieve success.It is therefore supported on the positive integers, k = 1, 2, ....
Declaration
public static void Geometric(ArithArray x, float p, int? seed = default(int? ))
Parameters
ArithArray
x
The output array. |
System.Single
p
The probability value. |
System.Nullable<System.Int32>
seed
The seed. |
LogNormal(ArithArray, Single, Single, Nullable<Int32>)
Draw samples from a log-normal distribution with specified mean, standard deviation, and array shape.
Note that the mean and standard deviation are not the values for the distribution itself, but of the underlying normal distribution it is derived from.
Declaration
public static void LogNormal(ArithArray x, float mean, float std, int? seed = default(int? ))
Parameters
ArithArray
x
The output array. |
System.Single
mean
The mean value. |
System.Single
std
The standard deviation value. |
System.Nullable<System.Int32>
seed
The seed. |
Normal(ArithArray, Single, Single, Nullable<Int32>)
Draw random samples from a normal (Gaussian) distribution.
The probability density function of the normal distribution, first derived by De Moivre and 200 years later by both Gauss and Laplace independently[2], is often called the bell curve because of its characteristic shape.
The normal distributions occurs often in nature. For example, it describes the commonly occurring distribution of samples influenced by a large number of tiny, random disturbances, each with its own unique distribution.
Declaration
public static void Normal(ArithArray x, float mean, float std, int? seed = default(int? ))
Parameters
ArithArray
x
The output array. |
System.Single
mean
The mean value. |
System.Single
std
The standard deviation value. |
System.Nullable<System.Int32>
seed
The seed. |
Uniform(ArithArray, Single, Single, Nullable<Int32>)
Samples are uniformly distributed over the half-open interval [min, max) (includes min, but excludes max). In other words, any value within the given interval is equally likely to be drawn by uniform.
Declaration
public static void Uniform(ArithArray x, float min, float max, int? seed = default(int? ))
Parameters
ArithArray
x
The output. |
System.Single
min
The minimum value. |
System.Single
max
The maximum value. |
System.Nullable<System.Int32>
seed
The seed. |