Histogram.CreateHistogram Method

Definition

Namespace: Extreme.DataAnalysis
Assembly: Extreme.Numerics (in Extreme.Numerics.dll) Version: 8.1.23

Overload List

CreateHistogram(ICategoricalVector) Returns a histogram of the counts for each value in a vector.
CreateHistogram<T>(CategoricalVector<T>) Returns a new histogram of the counts for each value in a vector.
CreateHistogram<T>(CategoricalVector<T>, Vector<Double>) Returns a new histogram of the counts for each value in a vector.
CreateHistogram<T>(IList<T>, IntervalIndex<T>) Returns a histogram of a vector using the specified bin arrangement.
CreateHistogram<T>(IList<T>, IntervalIndex<T>, IList<Double>) Returns a histogram of a vector using the specified bin arrangement.
CreateHistogram<T>(IList<T>, T, T, Int32, SpecialBins) Returns a histogram of a vector using the specified bin arrangement.
CreateHistogram<T>(Vector<T>, T, T, Int32, Vector<Double>) Returns a histogram of a vector using the specified bin arrangement.

CreateHistogram<T>(CategoricalVector<T>)

Returns a new histogram of the counts for each value in a vector.
C#
public static Histogram<T> CreateHistogram<T>(
	this CategoricalVector<T> samples
)

Parameters

samples  CategoricalVector<T>
A categorical vector.

Type Parameters

T

Return Value

Histogram<T>
A vector that contains a histogram of the total weight of each unique value in samples.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type CategoricalVector<T>. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

Exceptions

ArgumentNullException

samples is null.

CreateHistogram(ICategoricalVector)

Returns a histogram of the counts for each value in a vector.
C#
public static Vector<double> CreateHistogram(
	this ICategoricalVector samples
)

Parameters

samples  ICategoricalVector
A vector.

Return Value

Vector<Double>
A vector that contains a histogram of the values in samples.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type ICategoricalVector. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

Exceptions

ArgumentNullException

samples is null.

CreateHistogram<T>(CategoricalVector<T>, Vector<Double>)

Returns a new histogram of the counts for each value in a vector.
C#
public static Histogram<T> CreateHistogram<T>(
	this CategoricalVector<T> samples,
	Vector<double> weights
)

Parameters

samples  CategoricalVector<T>
A vector.
weights  Vector<Double>
A vector that supplies weights for the values in samples.

Type Parameters

T

Return Value

Histogram<T>
A vector that contains a histogram of the total weight of each unique value in samples, weighted by the weights.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type CategoricalVector<T>. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

Exceptions

ArgumentNullException

samples is null.

-or-

weights is null.

DimensionMismatchException

samples and weights do not have the same length.

CreateHistogram<T>(IList<T>, IntervalIndex<T>)

Returns a histogram of a vector using the specified bin arrangement.
C#
public static Histogram<Interval<T>> CreateHistogram<T>(
	this IList<T> samples,
	IntervalIndex<T> bins
)
where T : Object, IComparable<T>

Parameters

samples  IList<T>
A vector.
bins  IntervalIndex<T>
An interval index that specifies the bin boundaries.

Type Parameters

T
The type of the values.

Return Value

Histogram<Interval<T>>
A vector that contains a histogram of the total weight of the binned values in samples.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IList<T>. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

Exceptions

ArgumentNullException

samples is null.

-or-

bins is null.

CreateHistogram<T>(IList<T>, IntervalIndex<T>, IList<Double>)

Returns a histogram of a vector using the specified bin arrangement.
C#
public static Histogram<Interval<T>> CreateHistogram<T>(
	this IList<T> samples,
	IntervalIndex<T> bins,
	IList<double> weights
)
where T : Object, IComparable<T>

Parameters

samples  IList<T>
A vector.
bins  IntervalIndex<T>
An interval index that specifies the bin boundaries.
weights  IList<Double>
A vector that supplies weights for the values in samples.

Type Parameters

T
The type of the values.

Return Value

Histogram<Interval<T>>
A vector that contains a histogram of the total weight of the binned values in samples.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IList<T>. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

Exceptions

ArgumentNullException

samples is null.

-or-

bins is null.

-or-

weights is null.

DimensionMismatchException

samples and weights do not have the same length.

CreateHistogram<T>(IList<T>, T, T, Int32, SpecialBins)

Returns a histogram of a vector using the specified bin arrangement.
C#
public static Histogram<Interval<T>> CreateHistogram<T>(
	this IList<T> samples,
	T lowerBound,
	T upperBound,
	int numberOfBins,
	SpecialBins specialBins = SpecialBins.None
)
where T : Object, IComparable<T>

Parameters

samples  IList<T>
A vector.
lowerBound  T
The lower bound of the first histogram bin.
upperBound  T
The upper bound of the last histogram bin.
numberOfBins  Int32
The number of bins.
specialBins  SpecialBins  (Optional)
(Optional.) A SpecialBins value that specifies which special bins, if any, to include in the histogram.

Type Parameters

T
The type of the values.

Return Value

Histogram<Interval<T>>
A vector that contains a histogram of the total weight of the binned values in samples.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IList<T>. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

Exceptions

ArgumentNullException

samples is null.

CreateHistogram<T>(Vector<T>, T, T, Int32, Vector<Double>)

Returns a histogram of a vector using the specified bin arrangement.
C#
public static Histogram<Interval<T>> CreateHistogram<T>(
	this Vector<T> samples,
	T lowerBound,
	T upperBound,
	int numberOfBins,
	Vector<double> weights
)
where T : Object, IComparable<T>

Parameters

samples  Vector<T>
A vector.
lowerBound  T
The lower bound of the first histogram bin.
upperBound  T
The upper bound of the last histogram bin.
numberOfBins  Int32
The number of bins.
weights  Vector<Double>
A vector that supplies weights for the values in samples.

Type Parameters

T
The type of the values.

Return Value

Histogram<Interval<T>>
A vector that contains a histogram of the total weight of the binned values in samples weighted by weights.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Vector<T>. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

Exceptions

ArgumentNullException

samples is null.

-or-

weights is null.

DimensionMismatchException

samples and weights do not have the same length.

See Also