pg_mvgp_univariate_mra: Bayesian Polya-gamma regression

View source: R/pg-mvgp-univariate-mra.R

pg_mvgp_univariate_mraR Documentation

Bayesian Polya-gamma regression

Description

this function runs the Bayesian multinomial regression using Polya-gamma data augmentation

Usage

pg_mvgp_univariate_mra(
  Y,
  X,
  Z0,
  locs,
  params,
  priors,
  M = 4,
  n_coarse_grid = 10,
  model = "iid error",
  n_cores = 1L,
  inits = NULL,
  config = NULL,
  verbose = FALSE,
  use_spam = TRUE,
  n_chain = 1
)

Arguments

Y

is a n x J matrix of compositional count data.

X

is a n x p matrix of fixed effects (like latitude, elevation, etc)

Z0

is a n x Q matrix of observed climate variables

locs

is a n x 2 matrix of observation locations.

params

is a list of parameter settings. The list params must contain the following values:

  • n_adapt: A positive integer number of adaptive MCMC iterations.

  • n_mcmc: A positive integer number of total MCMC iterations post adaptation.

  • n_thin: A positive integer number of MCMC iterations per saved sample.

  • n_message: A positive integer number of frequency of iterations to output a progress message. For example, n_message = 50 outputs progress messages every 50 iterations.

priors

is the list of prior settings.

M

The number of resolutions.

n_coarse_grid

The number of basis functions in one direction (e.g. n_coarse_grid = 10 results in a 10x10 course grid which is further extended by the number of additional padding basis functions given by n_padding.

model

is the form of the polya-gamma model. Currently, this option is not active the only model is the "iid error" model. This option allows for independent species-specific overdispersion variance terms.

n_cores

is the number of cores for parallel computation using openMP.

inits

is the list of initial values if the user wishes to specify initial values. If these values are not specified, then the initial values will be randomly sampled from the prior.

config

is the list of configuration values if the user wishes to specify initial values. If these values are not specified, then default a configuration will be used.

verbose

is a logicial input that determines whether to print more detailed messages.

use_spam

is a boolean flag to determine whether the output is a list of spam matrix objects (use_spam = TRUE) or a an n x n sparse Matrix of class "dgCMatrix" use_spam = FALSE (see spam and Matrix packages for details).

n_chain

is the MCMC chain id. The default is 1.


jtipton25/pgR documentation built on July 8, 2022, 12:44 a.m.