sampleStateFrom

fun sampleStateFrom(distribution: DoubleArray): Int(source)

Draws a state from distribution using this chain's stream and makes it the current state, so that a path can begin from an initial distribution rather than from a fixed state. The property initialState is not changed, so a later call to reset still returns where it always did.

Return

the state drawn

Parameters

distribution

one probability per state, in state order, summing to one