run_conclique_gibbs: Run a conclique-based Gibbs sampler to sample spatial data...

Description Usage Arguments

View source: R/RcppExports.R

Description

Run a conclique-based Gibbs sampler to sample spatial data given a lattice and neighborhood structure.

Usage

1
2
3
4
5
6
7
8
run_conclique_gibbs(
  conclique_cover,
  neighbors,
  inits,
  conditional_sampler,
  params,
  n_iter = 100L
)

Arguments

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:

  • data, and

  • params.

There are three built in samplers:

  • "gaussian_single_param" - a Gaussian sampler with a single dependence parameter,

  • "binary_single_param" - a binary sampler with a single dependence parameter, and

  • "binary_two_param" - a binary sampler with two dependence parameters.

  • "binary_two_param_reg" - a binary sampler with two dependence parameters and regression on the horizontal coordinate.

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


andeek/conclique documentation built on Dec. 26, 2021, 3:12 a.m.