public abstract class AbstractMetropolis extends Object implements RandomVectorGenerator
| Constructor and Description |
|---|
AbstractMetropolis(Vector initialState,
RandomNumberGenerator rng)
Constructs a new instance with the given parameters.
|
| Modifier and Type | Method and Description |
|---|---|
double |
acceptanceRate()
Gets the acceptance rate, i.e.
|
protected abstract boolean |
isProposalAccepted(Vector currentState,
Vector proposedState)
Decides whether the given proposed state should be accepted, or whether the system should
remain in it's current state.
|
protected abstract Vector |
nextProposedState(Vector currentState)
Proposes a next state for the system.
|
double[] |
nextVector()
Get the next random vector.
|
void |
seed(long... seeds)
Seed the random number/vector/scenario generator to produce repeatable experiments.
|
public AbstractMetropolis(Vector initialState, RandomNumberGenerator rng)
initialState - the initial state of the algorithmrng - a random number generatorpublic void seed(long... seeds)
Seedablepublic double[] nextVector()
RandomVectorGeneratornextVector in interface RandomVectorGeneratorprotected abstract Vector nextProposedState(Vector currentState)
currentState - the current state of the systemprotected abstract boolean isProposalAccepted(Vector currentState, Vector proposedState)
currentState - the current state of the systemproposedState - the proposed next state of the systempublic final double acceptanceRate()
Copyright © 2010-2020 NM FinTech Ltd.. All Rights Reserved.