Statistic

class Statistic @JvmOverloads constructor(name: String? = "Statistic_", values: DoubleArray? = null) : AbstractStatistic(source)

The Statistic class allows the collection of summary statistics on data via the collect() methods. The primary statistical summary is for the statistical moments. Creates a Statistic with the given name

Parameters

name

an optional String representing the name of the statistic

values

an optional array of values to collect on

Constructors

Link copied to clipboard
constructor(values: DoubleArray?)

Creates a Statistic based on the provided array

constructor(name: String? = "Statistic_", values: DoubleArray? = null)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
open override val average: Double

Gets the unweighted average of the observations.

Link copied to clipboard

Returns the 2nd statistical central moment

Link copied to clipboard

Returns the 3rd statistical central moment

Link copied to clipboard

Returns the 4th statistical central moment

Link copied to clipboard

The 0th moment is the count, the 1st central moment zero, the 2nd, 3rd, and 4th central moments

Link copied to clipboard
open override val count: Double

Gets the count for the number of the observations.

Link copied to clipboard
open override val deviationSumOfSquares: Double

Gets the sum of squares of the deviations from the average This is the numerator in the classic sample variance formula

Link copied to clipboard
open override val kurtosis: Double

Gets the kurtosis of the data

Link copied to clipboard
open override val lag1Correlation: Double

Gets the lag-1 generate correlation of the unweighted observations. Note: See Box, Jenkins, Reinsel, Time Series Analysis, 3rd edition, Prentice-Hall, pg 31

Link copied to clipboard
open override val lag1Covariance: Double

Gets the lag-1 generate covariance of the unweighted observations. Note: See Box, Jenkins, Reinsel, Time Series Analysis, 3rd edition, Prentice-Hall, pg 31

Link copied to clipboard
open override val max: Double

Gets the maximum of the observations.

Link copied to clipboard
open override val min: Double

Gets the minimum of the observations.

Link copied to clipboard
open override var negativeCount: Double

Counts the number of observations that were negative, strictly less than zero.

Link copied to clipboard

Returns the observation weighted sum of the data i.e. sum = sum + j*x where j is the observation number and x is jth observation

Link copied to clipboard

Returns the 2nd statistical raw moment (about zero)

Link copied to clipboard

Returns the 3rd statistical raw moment (about zero)

Link copied to clipboard

Returns the 4th statistical raw moment (about zero)

Link copied to clipboard
open override val skewness: Double

Gets the skewness of the data

Link copied to clipboard
open override val sum: Double

Gets the sum of the observations.

Link copied to clipboard

Returns the summary statistics values Name Count Average Std. Dev.

Link copied to clipboard

Returns the header for the summary statistics Name Count Average Std. Dev.

Link copied to clipboard
open override var value: Double
Link copied to clipboard
open override val variance: Double

Gets the sample variance of the observations.

Link copied to clipboard

Gets the Von Neumann Lag 1 test statistic for checking the hypothesis that the data are uncorrelated Note: See Handbook of Simulation, Jerry Banks editor, McGraw-Hill, pg 253.

Link copied to clipboard
open override var zeroCount: Double

Counts the number of observations that were exactly zero.

Functions

Link copied to clipboard
Link copied to clipboard

Checks if the supplied value falls within getAverage() +/- getHalfWidth()

Link copied to clipboard
open override fun collect(obs: Double)

Collect on the supplied value. Double.NaN, Double.NEGATIVE_INFINITY, and Double.POSITIVE_INFINITY values are counted as missing. Null values are not permitted.

Link copied to clipboard
open override fun copyOfAsStatistic(): Statistic

Return a copy of the information as an instance of a statistic

Link copied to clipboard

Creates an instance of Statistic that is a copy of the supplied Statistic All internal state is the same. The only exception is for the id of the returned Statistic.

Link copied to clipboard
open override fun reset()

Resets the collector as if no observations had been collected.

Link copied to clipboard
open override fun toString(): String

Returns a String representation of the Statistic