Rev Language Reference


mvRandomIntegerWalk - Random walk on integers

A move that performs random walk on an integer variable. The displacement of the random walk is exactly one step, either positive or negative.

Usage

mvRandomIntegerWalk(Integer x, RealPos weight, Probability tuneTarget)

Arguments

x : Integer (<stochastic> pass by reference)
The variable on which this move operates.
weight : RealPos (pass by value)
The weight determines the relative frequency with which this move will be attempted. For details, see the description of the 'moveschedule' parameter on the documentation page for 'mcmc()'.
Default : 1
tuneTarget : Probability (pass by value)
The acceptance probability targeted by auto-tuning.
Default : 0.44

Example


p <- 0.8
x ~ dnGeom(p)

moves[1] = mvRandomIntegerWalk(x, weight=1.0)
monitors[1] = mvScreen(printgen=1000, x)

mymodel = model(p)
mymcmc = mcmc(mymodel, monitors, moves)
mymcmc.burnin(generations=20000,tuningInterval=100)
mymcmc.run(generations=200000)

See Also