Package-level declarations

Types

Link copied to clipboard
fun interface BlockingStatistic<in T, out R> : Statistic<T, R>

A statistic that is computed in a synchronous blocking mode

Link copied to clipboard
interface ComposableStatistic<in T, I, out R> : Statistic<T, R>

A statistic tha could be computed separately on different blocks of data and then composed

Link copied to clipboard
data class KMComparisonResult<T : Comparable<T>>(val n: Int, val m: Int, val value: T)

Resulting value of kolmogorov-smirnov two-sample statistic

Link copied to clipboard
class Mean<T>(group: Ring<T>, division: (sum: T, count: Int) -> T) : ComposableStatistic<T, Pair<T, Int>, T> , BlockingStatistic<T, T>

Arithmetic mean

Link copied to clipboard
class Median<T>(comparator: Comparator<T>) : BlockingStatistic<T, T>

Non-composable median

Link copied to clipboard
class RandomGeneratorProvider(val generator: RandomGenerator) : UniformRandomProvider

Implements UniformRandomProvider by delegating all operations to RandomGenerator.

Link copied to clipboard

Implements RandomGenerator by delegating all operations to RandomSource.

Link copied to clipboard

Rank statistics

Link copied to clipboard
fun interface Sampler<out T : Any>

Sampler that generates chains of values of type T.

Link copied to clipboard
fun interface Statistic<in T, out R>

A function, that transforms a buffer of random quantities to some resulting value

Link copied to clipboard
interface StatisticalAlgebra<T, out A : Algebra<T>, out BA : BufferAlgebra<T, A>> : Algebra<Buffer<T>>
Link copied to clipboard
data class ValueAndError(val value: Double, val dispersion: Double)

A combination of a random value and its dispersion.

Link copied to clipboard

An algebra for double value + its error combination. The multiplication assumes linear error propagation

Functions

Link copied to clipboard
fun RandomGenerator.asUniformRandomProvider(): UniformRandomProvider

Represent this RandomGenerator as commons-rng UniformRandomProvider preserving and mirroring its current state. Getting new value from one of those changes the state of another.

Link copied to clipboard
@JvmName(name = "genericChiSquaredExpression")
fun <T : Comparable<T>, I : Any, A : ExtendedField<I>, ExpressionAlgebra<T, I>> AutoDiffProcessor<T, I, A>.chiSquaredExpression(x: Buffer<T>, y: Buffer<T>, yErr: Buffer<T>, model: A.(I) -> I): DifferentiableExpression<T>

Generate a chi squared expression from given x-y-sigma data and inline model. Provides automatic differentiation.

Link copied to clipboard
fun <T : Comparable<T>> StatisticalAlgebra<T, *, *>.ecdf(buffer: Buffer<T>): (T) -> Double
Link copied to clipboard
fun <T, I, R> ComposableStatistic<T, I, R>.flow(flow: Flow<Buffer<T>>, dispatcher: CoroutineDispatcher = Dispatchers.Default): Flow<R>

Perform a streaming statistical analysis on a chunked data. The computation of inner representation is done in parallel if dispatcher allows it.

Link copied to clipboard
fun RandomGenerator.Companion.fromSource(source: RandomSource, seed: Long? = null): RandomSourceGenerator

Returns RandomSourceGenerator with given RandomSource and seed.

Link copied to clipboard
operator fun <T, R> BlockingStatistic<T, R>.invoke(data: Buffer<T>): R
suspend operator fun <T, R> Statistic<T, R>.invoke(data: Buffer<T>): R
Link copied to clipboard

Kolmogorov-Smirnov sample comparison test Implementation copied from https://commons.apache.org/proper/commons-math/javadocs/api-3.6.1/index.html?org/apache/commons/math3/stat/inference/KolmogorovSmirnovTest.html

Link copied to clipboard

Returns RandomSourceGenerator with RandomSource.MT algorithm and given seed.

Link copied to clipboard
suspend fun <T : Any> Sampler<T>.next(generator: RandomGenerator): T

Samples one value from this Sampler.

Link copied to clipboard
suspend fun Sampler<Double>.nextBuffer(generator: RandomGenerator, size: Int): Buffer<Double>

Samples a Buffer of values from this Sampler.

Link copied to clipboard
@JvmName(name = "sampleRealBuffer")
fun Sampler<Double>.sampleBuffer(generator: RandomGenerator, size: Int): Chain<Buffer<Double>>

Generates size real samples and chunks them into some buffers.

@JvmName(name = "sampleIntBuffer")
fun Sampler<Int>.sampleBuffer(generator: RandomGenerator, size: Int): Chain<Buffer<Int>>

Generates size integer samples and chunks them into some buffers.

fun <T : Any> Sampler<T>.sampleBuffer(generator: RandomGenerator, size: Int, bufferFactory: BufferFactory<T> = BufferFactory.boxing()): Chain<Buffer<T>>

Sample a bunch of values

Properties

Link copied to clipboard