MetropolisHastings1D

class MetropolisHastings1D(var initialX: Double, targetFun: FunctionIfc, proposalFun: ProposalFunction1DIfc, streamNumber: Int = 0, val streamProvider: RNStreamProviderIfc = KSLRandom.DefaultRNStreamProvider) : Observable<Double> , RandomIfc(source)

An implementation for a 1-Dimensional Metropolis Hasting process. The process is observable at each step

Parameters

initialX

the initial value to start generation process

targetFun

the target function

proposalFun

the proposal function

streamNumber

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

streamProvider

the provider of random number streams, defaults to KSLRandom.DefaultRNStreamProvider

Constructors

Link copied to clipboard
constructor(initialX: Double, targetFun: FunctionIfc, proposalFun: ProposalFunction1DIfc, streamNumber: Int = 0, streamProvider: RNStreamProviderIfc = KSLRandom.DefaultRNStreamProvider)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard

If true, the stream will automatically participate in having its stream advanced to the next sub-stream via stream managers

Link copied to clipboard
open override var antithetic: Boolean

Tells the stream to start producing antithetic variates

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override var resetStartStreamOption: Boolean

If true, the stream will automatically participate in having its stream reset to its start stream via stream managers

Link copied to clipboard
open override val streamNumber: Int
Link copied to clipboard

Functions

Link copied to clipboard
open override fun advanceToNextSubStream()

Positions the RNG at the beginning of its next substream

Link copied to clipboard
Link copied to clipboard

Resets statistics and sets the initial state the initial value or to the value found via the warmup period (if the warmup period was run).

Link copied to clipboard
open override fun instance(streamNum: Int, rnStreamProvider: RNStreamProviderIfc): MetropolisHastings1D
Link copied to clipboard
fun next(): Double

Moves the process one step

Link copied to clipboard
open override fun resetStartStream()

The resetStartStream method will position the RNG at the beginning of its stream. This is the same location in the stream as assigned when the RNG was created and initialized.

Link copied to clipboard
open override fun resetStartSubStream()

Resets the position of the RNG at the start of the current substream

Link copied to clipboard

Resets the automatically collected statistics

Link copied to clipboard
fun runAll(n: Int): Double
Link copied to clipboard
fun runWarmUpPeriod(warmUpAmount: Int)

Runs a warmup period and assigns the initial value of the process to the last value from the warmup process.

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

This method simply returns the value.