Metalog3PRV

class Metalog3PRV @JvmOverloads constructor(val a1: Double = 0.0, val a2: Double = 1.0, val a3: Double = 0.0, val lowerBound: Double = Double.NEGATIVE_INFINITY, val upperBound: Double = Double.POSITIVE_INFINITY, streamNum: Int = 0, streamProvider: RNStreamProviderIfc = KSLRandom.DefaultRNStreamProvider, name: String? = null) : ParameterizedRV(source)

A three-term metalog random variable.

The third coefficient controls skewness, positive skewing right and negative skewing left.

Because the metalog quantile function is closed form, each variate costs one evaluation of it, with no root finding and no rejection. Which member of the family this represents follows from which bounds are finite rather than from a separate setting.

The coefficients are validated once here and are immutable thereafter, so generation performs no feasibility checking at all. That is safe because the parameters of a random variable are never mutated in place: a parameter change in a running model is applied by constructing a fresh instance, which revalidates. It is also necessary, since an invalid coefficient vector does not fail during generation but instead silently produces values that are not a sample from any distribution.

Parameters

a1

the location, which is the median in fitting space

a2

the scale, which must be strictly positive

a3

the skewness coefficient

lowerBound

the lower bound, or negative infinity when unbounded below

upperBound

the upper bound, or positive infinity when unbounded above

streamNum

the random number stream number, defaults to 0, which means the next stream

streamProvider

the provider of random number streams

name

an optional name

Constructors

Link copied to clipboard
constructor(a1: Double = 0.0, a2: Double = 1.0, a3: Double = 0.0, lowerBound: Double = Double.NEGATIVE_INFINITY, upperBound: Double = Double.POSITIVE_INFINITY, streamNum: Int = 0, streamProvider: RNStreamProviderIfc = KSLRandom.DefaultRNStreamProvider, name: String? = null)

Properties

Link copied to clipboard
val a1: Double
Link copied to clipboard
val a2: Double
Link copied to clipboard
val a3: Double
Link copied to clipboard

Which member of the metalog family this random variable draws from, derived from its bounds.

Link copied to clipboard
Link copied to clipboard
open override val parameters: RVParameters
Link copied to clipboard

Functions

Link copied to clipboard

A defensive copy of the coefficients, in the order in which they multiply the basis terms.

Link copied to clipboard
protected open override fun generate(): Double
Link copied to clipboard
open override fun instance(streamNum: Int, rnStreamProvider: RNStreamProviderIfc): Metalog3PRV
Link copied to clipboard
open override fun toString(): String