EstimatedResponse

@Serializable
data class EstimatedResponse(val name: String, val average: Double, val variance: Double, val count: Double) : EstimatedResponseIfc(source)

Represents an estimated response based on an independent sample. For the case of sample size 1 (count equals 1), the variance will be undefined (Double.NaN).

Parameters

name

the name of the response that was estimated

average

the sample average of the sample

variance

the sample variance of the sample

count

the number of observations in the sample

Constructors

Link copied to clipboard
constructor(name: String, average: Double, variance: Double, count: Double)
constructor(name: String, data: DoubleArray)

If the data is empty, the average will be NaN and thus an IllegalArgumentException will occur.

constructor(name: String, data: List<Double>)

If the data is empty, the average will be NaN and thus an IllegalArgumentException will occur.

Properties

Link copied to clipboard
open override val average: Double
Link copied to clipboard
open override val count: Double
Link copied to clipboard
open override var label: String?
Link copied to clipboard
open override val name: String
Link copied to clipboard
open override val variance: Double

Functions

Link copied to clipboard
Link copied to clipboard

Combine this estimate with another independent estimate

Link copied to clipboard

The variance of the sample made by pooling this estimate's observations with those of e, both from the same population: the sample variance (divisor n - 1) of all n = n1 + n2 observations, whatever the split, (n1 - 1) s1^2 + (n2 - 1) s2^2 + (n1 n2 / n)(x1 - x2)^2, all divided by n - 1, where an estimate of a single observation contributes no within-sample term. Each term is divided by n - 1 before it is formed, so a variance that fits in a Double is found without overflowing on the way; one too large for a Double is infinite.