WeightedStatistic

Collects a basic weighted statistical summary. If the observation or the weight is infinite or NaN, then the observation is not recorded and the number of missing observations is incremented. If the observed weight is negative or 0.0, then the observation is not recorded and the number of missing observations is incremented.

Author

rossetti

Constructors

Link copied to clipboard
constructor(name: String? = null)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
open override val count: Double

Gets the count of the number of the observations.

Link copied to clipboard
open override val csvStatistic: String
Link copied to clipboard
open override val csvStatisticHeader: String

The header string for the CVS representation

Link copied to clipboard
open override val emitter: Emitter<Pair<Double, Double>>
Link copied to clipboard
open override val id: Int
Link copied to clipboard
open override var label: String?
Link copied to clipboard
open override var lastValue: Double
Link copied to clipboard
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 val name: String
Link copied to clipboard
open override val numberMissing: Double

When a data point having the value of (Double.NaN, Double.POSITIVE_INFINITY, Double.NEGATIVE_INFINITY) are presented it is excluded from the summary statistics and the number of missing points is noted. If the weight is infinite or less than or equal to zero, then the data point should not be recorded. This method reports the number of missing points that occurred during the collection.

Link copied to clipboard

Returns an array with the statistics defined by index = statistic

Link copied to clipboard

s0 = "Count"; s1 = "Average"; s2 = "Minimum"; s3 = "Maximum"; s4 = "Weighted Sum"; s5 = "Sum of Weights"; s6 = "Weighted sum of squares"; s7 = "Last Value"; s8 = "Last Weight"; s9 = "Unweighted Sum"; s10 = "Unweighted Average";

Link copied to clipboard
open override val sumOfWeights: Double

Gets the sum of the observed weights.

Link copied to clipboard
Link copied to clipboard
open override val unWeightedSum: Double
Link copied to clipboard
open override var value: Double
Link copied to clipboard
open override val weight: Double

The last weight collected

Link copied to clipboard
open override val weightedAverage: Double

Gets the weighted average of the collected observations.

Link copied to clipboard
open override val weightedSum: Double

Gets the weighted sum of observations observed.

Link copied to clipboard
open override val weightedSumOfSquares: Double

Gets the weighted sum of squares for observations observed.

Functions

Link copied to clipboard
open override fun attachObserver(observer: ObserverIfc<Pair<Double, Double>>)

Allows the adding (attaching) of an observer to the observable

Link copied to clipboard
Link copied to clipboard
open fun collect(obs: Boolean)

Collects on the boolean value true = 1.0, false = 0.0

open fun collect(observations: BooleanArray)
open fun collect(observations: DoubleArray)
open fun collect(observations: IntArray)
open fun collect(observations: LongArray)
open fun collect(observations: DoubleArray, weights: DoubleArray)

Collects on the values in the supplied array.

open fun collect(fn: () -> Double)

Collect on the double value return by the function

open fun collect(obs: Int)

Collects on the Int value

open fun collect(obs: Long)

Collects on the Long value

open fun collect(observations: Collection<Double>)

Collects on all the values in the supplied collection.

open fun collect(v: GetValueIfc)

Collects on the values returned by the supplied GetValueIfc

open override fun collect(obs: Double)

Collect on the supplied value

open override fun collect(obs: Double, weight: Double)
Link copied to clipboard
open operator override fun compareTo(other: WeightedStatistic): Int

Returns a negative integer, zero, or a positive integer if this object is less than, equal to, or greater than the specified object.

Link copied to clipboard
fun count(): Double
Link copied to clipboard
open override fun countObservers(): Int

Returns how many observers are currently attached to the observable

Link copied to clipboard
open override fun detachAllObservers()

Detaches all the observers from the observable

Link copied to clipboard
open override fun detachObserver(observer: ObserverIfc<Pair<Double, Double>>)

Allows the deletion (removing) of an observer from the observable

Link copied to clipboard

Creates an instance of Statistic that is a copy of this Statistic All internal state is the same except for the id of the returned Statistic

Link copied to clipboard
open override fun isAttached(observer: ObserverIfc<Pair<Double, Double>>): Boolean

Returns true if the observer is already attached

Link copied to clipboard
fun max(): Double
Link copied to clipboard
fun min(): Double
Link copied to clipboard
Link copied to clipboard
fun <T> Observable<T>.observe(block: (T?) -> Unit)
Link copied to clipboard
open override fun reset()

Resets the collector as if no observations had been collected.

Link copied to clipboard
fun statistics(statistics: DoubleArray)

Fills up the supplied array with the statistics defined by index = statistic

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

Returns a String representation of the WeightedStatistic

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard