run_sequential_gibbs: Run a sequential Gibbs sampler to sample spatial data given a...

Description Usage Arguments

View source: R/RcppExports.R

Description

Run a sequential Gibbs sampler to sample spatial data given a lattice and neighborhood structure.

Usage

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

Arguments

neighbors

A matrix N*N by (max // neighbors) + 1, where the first column is the location id of each location in the lattice. This could be the result from get_neighbors(). If NULL, will be calculated within the function.

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 gloabl environment as this parameter. The input "data" is a list containing 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. 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.