Run a conclique-based Gibbs sampler to sample spatial data given a lattice and neighborhood structure.
1 2 3 4 5 6 7 8 | run_conclique_gibbs(
conclique_cover,
neighbors,
inits,
conditional_sampler,
params,
n_iter = 100L
)
|
conclique_cover |
A list of class "conclique_cover" encoding the locations in each conclique for the conclique cover |
neighbors |
A list of matrices encoding the neighbors for each point, where the first column of each matrix is the location id of each location in the lattice. This could be the result from get_neighbors(). Include multiple matrices within the list for more complicated neighborhood structures in your corresponding sampler, for example a (two) dependency parameter for N/S, E/W. |
inits |
Initial values for the lattice, formatted as a grid. |
conditional_sampler |
The string name of a function that has two inputs:
There are three built in samplers:
If the user chooses to write their own sampler in R, they must pass the name of the sampler that is available in the global environment as this parameter. The input "data" is a list containing at least two elements, sums and nums which contain the sum of the data in each neighborhood as well as the number of locations in the neighborhood for each point in the conclique. In addition, the data can contain two additional elements, u and v, which are vectors that contain the horizontal and vertical location of each point in space. The input "params" is a list of parameter values. This function returns a value sampled from the specified conditional distribution given the data and parameters passed. |
params |
A list of parameters to be passed to the conditional_sampler function |
n_iter |
Number of times to run the Gibbs sampler |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.