Open Roger-luo opened 6 years ago
I understand your discrete parameter space is represented by an n-length vector (not matrix)? Do you have a proposal kernel for this, and if yes, in what form does it come, Is it a Markov transition matrix or a distribution conditional on the current state? Is the proposal symmetric or asymmetric?
@scidom OK, this is a more detailed and more precise description:
The parameter space is an array (with arbitrary dimension) contains {0, 1} (sometimes {-1, 1} or {-0.5, 0.5}). Each metropolis step will flip some of them randomly (means flip the spin at n random positions)
a spin may looks like an array with tags
mutable struct Spin{T, N}
up::T
down::T
data::Array{T, N}
end
the initialization is totally random, which can be done by this Julia command rand(shape, [up, down])
. But the flip operation is different (which will be the proposal state in metropolis hasting).
Generally, the next state will be generated based on previous state in metropolis, which means flip n spins in the array.
But how to flip it may different depends on the problem. And may have the following ways (So different type may need to be defined)
Hi guys, I would like to sample from a lattice configuration (some Array contains only 0 and 1), each sample looks like [0, 1, 0, 1, 1]. and I have a distribution function for it.
How can I tweak your sampler to accomplish this task? Is there any guidance I could read? Do I need to define a new variate type in Distributions.jl too?