spatial_residuals: Get spatial residuals from data given a neighborhood...

Description Usage Arguments

View source: R/RcppExports.R

Description

Get spatial residuals from data given a neighborhood structure and MRF model.

Usage

1
2
3
4
5
6
7
8
spatial_residuals(
  data,
  neighbors,
  conditional_cdf,
  params,
  discrete = "",
  ncols = 0L
)

Arguments

data

A vector containing data values for each location in the lattice.

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().

conditional_cdf

A function that has two inputs:

  • data, and

  • params.

There are three built in cdfs:

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

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

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

If the user chooses to write their own cdf in R, they must pass the name of the cdf function 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 the inverse cdf at a value between 0 and 1 from the conditional distribution

params

A list of parameters to be passed to the conditional_density function

discrete

If you are dealing with a discrete distribution, the string name of the pmf function. Otherwise, leave as an empty string.

ncols

A integer of the number of columns in the original grid. Only necessary if dealing with "u" and "v" in cdf function.


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