Represents a method that aggregates data in a variable.
Namespace: Extreme.Statistics
Assembly: Extreme.Numerics (Extreme.Numerics)
Syntax
| Visual Basic (Declaration) |
|---|
Public MustInherit Class Aggregator |
| C# |
|---|
public abstract class Aggregator |
| C++ |
|---|
public ref class Aggregator abstract |
Methods
| Icon | Type | Description |
|---|---|---|
| Apply(Variable, Int32, Int32) |
Applies the aggregator to a range of observations of a variable.
| |
| Apply(Variable, Int32[]()) |
Applies the aggregator to a variable and returns the result as a variable.
| |
| Equals(Object) | ||
| Finalize() | ||
| GetHashCode() | Serves as a hash function for a particular type. | |
| GetType() | Gets the Type of the current instance. | |
| MemberwiseClone() | Creates a shallow copy of the current Object. | |
| Nth(Int32) |
Gets an aggregator that returns the observation at the specified position.
| |
| ToString() | ||
| WeightedAverage(NumericalVariable) |
Returns an aggregator that uses observations from another variable to compute a weighted average.
|
Fields
| Icon | Type | Description |
|---|---|---|
| Average |
Gets an aggregator that returns the average of the observations.
| |
| Count |
Gets an aggregator that returns the number of observations.
| |
| First |
Gets an aggregator that returns the first observation.
| |
| Last |
Gets an aggregator that returns the last observation.
| |
| Maximum |
Gets an aggregator that returns the largest observation.
| |
| Minimum |
Gets an aggregator that returns the smallest observation.
| |
| StandardDeviation |
Gets an aggregator that returns the average of the observations.
| |
| Sum |
Gets an aggregator that returns the sum of the observations.
| |
| Variance |
Gets an aggregator that returns the average of the observations.
|
Constructors
| Icon | Type | Description |
|---|---|---|
| AggregatorNew(Type) |
Constructs a new aggregator.
| |
| AggregatorNew() |
Constructs a new aggregator.
|
Remarks
Use the Aggregator class to aggregate the observations in a Variable.
The Apply(Variable, Int32, Int32) method has two overloads. The first overload aggregates the observations
of a variable over a specified interval and returns the result. The second overload aggregates the observations
over intervals with the specified boundaries, and returns the results in a new variable.
A number of aggregators have been predefined. These are exposed as staticSharedstatic fields and methods of the Aggregator class. These include aggregators that return the first, last, smallest and largest observation in an interval, as well as sums, averages, and other summary statistics.
To define a custom aggregator, create a class that inherits from Aggregator and overrides the Apply(Variable, Int32, Int32) method. In the class constructor, you should call the base constructor with one argument: the type of variable returned by the aggregator.