DiscreteDistribution<T> Constructor

Definition

Namespace: Numerics.NET.Statistics.Distributions
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 9.0.2

Overload List

DiscreteDistribution<T>(Histogram<T>)

Constructs a new DiscreteDistribution<T> object.
C#
public DiscreteDistribution(
	Histogram<T> values
)

Parameters

values  Histogram<T>
A histogram containing the relative probabilities.

Exceptions

ArgumentNullException

values is null.

ArgumentException

values has zero length.

-or-

One or more of the relative probabilities is less than zero.

-or-

One or more of the relative probabilities is not a finite number.

-or-

All relative probabilities are zero.

DiscreteDistribution<T>(IList<T>, IList<Double>)

Constructs a new DiscreteDistribution<T> object.
C#
public DiscreteDistribution(
	IList<T> items,
	IList<double> probabilities
)

Parameters

items  IList<T>
 
probabilities  IList<Double>
 

Exceptions

ArgumentNullException

items is null.

-or-

probabilities is null.

DimensionMismatchException

The length of items is not equal to the length of probabilities.

ArgumentException

items and probabilities have zero length.

-or-

One or more of the relative probabilities is less than zero.

-or-

One or more of the relative probabilities is not a finite number.

-or-

All relative probabilities are zero.

See Also