org.omegahat.Simulation.MCMC.Examples
Class SimpleMetropolisSampler
java.lang.Object
|
+--org.omegahat.Simulation.MCMC.NotifyingMCMCObject
|
+--org.omegahat.Simulation.MCMC.BaseMarkovChain
|
+--org.omegahat.Simulation.MCMC.Examples.SimpleMetropolisSampler
- All Implemented Interfaces:
- MarkovChain, NotifyingObject, java.lang.Runnable
- public class SimpleMetropolisSampler
- extends BaseMarkovChain
A simple Markov Chain example. It simply generates
its next state from N(0,1) regardless of the current state.
Methods inherited from class java.lang.Object |
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait |
sigma
protected double sigma
rho
protected double rho
delta
protected double delta
prng
protected PRNG prng
norm
protected Normal norm
state
protected SimpleMetropolisSampler.BivariateDoubleState state
SimpleMetropolisSampler
public SimpleMetropolisSampler(PRNG prng,
double sigma,
double rho,
double delta)
square
protected double square(double x)
bivariateDensity
protected double bivariateDensity(double[] bvstate)
acceptanceProb
protected double acceptanceProb(double[] current,
double[] proposed)
generate
public MCMCState generate(MCMCState state)
- Description copied from class:
BaseMarkovChain
- Generate the next state from the current one
- Overrides:
generate
in class BaseMarkovChain
main
public static void main(java.lang.String[] argv)