org.omegahat.Simulation.MCMC.Examples
Class SimpleMetropolisHastingsSampler
java.lang.Object
|
+--org.omegahat.Simulation.MCMC.NotifyingMCMCObject
|
+--org.omegahat.Simulation.MCMC.BaseMarkovChain
|
+--org.omegahat.Simulation.MCMC.Examples.SimpleMetropolisHastingsSampler
- All Implemented Interfaces:
- MarkovChain, NotifyingObject, java.lang.Runnable
- public class SimpleMetropolisHastingsSampler
- 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 SimpleMetropolisHastingsSampler.BivariateDoubleState state
SimpleMetropolisHastingsSampler
public SimpleMetropolisHastingsSampler(PRNG prng,
double sigma,
double rho,
double delta)
square
protected double square(double x)
bivariateDensity
protected double bivariateDensity(double[] bvstate)
transitionDensity
protected double transitionDensity(double[] from,
double[] to)
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)