| spcobinreg | R Documentation |
Fit Bayesian spatial cobin regression model under canonical link (cobit link) with Markov chain Monte Carlo (MCMC).
y(s_{i}) \mid x(s_{i}), u(s_i) \stackrel{ind}{\sim} cobin(x(s_{i})^T\beta + u(s_i), \lambda^{-1}), \quad u(\cdot)\sim GP
for i=1,\dots,n. See dcobin for details on cobin distribution. It currently only supports mean zero GP with exponential covariance
cov(u(s_i), u(s_j)) = \sigma_u^2\exp(-\phi_u d(s_i,s_j))
where \phi_u corresponds to inverse range parameter.
spcobinreg(
formula,
data,
link = "cobit",
coords,
NNGP = FALSE,
contrasts = NULL,
priors = list(beta_intercept_scale = 10, beta_scale = 2.5, beta_df = Inf),
nngp.control = list(n.neighbors = 15, ord = order(coords[, 1])),
nburn = 1000,
nsave = 1000,
nthin = 1
)
formula |
an object of class "formula" or a two-sided linear formula object describing both the fixed-effects and random-effects part of the model; see "lmer" |
data |
data frame, list or environment (or object coercible by as.data.frame to a data frame) containing the variables in the model. |
link |
character, link function (default "cobit"). Only supports canonical link function "cobit" that is compatible with Kolmogorov-Gamma augmentation. |
coords |
a n x 2 matrix of Euclidean coordinates |
NNGP |
logical, if TRUE, use NNGP prior for the spatial random effects; see spNNGP |
contrasts |
an optional list. See the contrasts.arg of model.matrix.default. |
priors |
a list of prior hyperparameters. See Details |
nngp.control |
a list of control parameters for NNGP prior (only when NNGP = TRUE). This should be a named list of n.neighbors and ord, with default of 15 and first coordiate-based ordering. See spNNGP for details. |
nburn |
number of burn-in MCMC iterations. |
nsave |
number of posterior samples. Total MCMC iteration is nburn + nsave*nthin |
nthin |
thin-in rate. Total MCMC iteration is nburn + nsave*nthin |
The prior setting can be controlled with "priors" argument. Prior for regression coefficients are independent normal or t prior centered at 0. "priors" is a named list of:
beta_intercept_scale, Default 100, the scale of the intercept prior
beta_scale, Default 100, the scale of nonintercept fixed-effect coefficients
beta_df, Default Inf, degree of freedom of t prior. If beta_df=Inf, it corresponds to normal prior
lambda_grid, Default 1:70, candidate for lambda (integer)
lambda_logprior, Default p(\lambda)\propto \lambda \Gamma(\lambda+1)/\Gamma(\lambda+5), log-prior of lambda. Default choice arises from beta negative binomial distribution; (\lambda-1)\mid \psi \sim negbin(2,\psi), \psi\sim Beta(2,2).
logprior_sigma.sq, Default half-Cauchy on the sd(u) =\sigma_u, log prior of var(u)=\sigma_u^2
phi_lb, lower bound of uniform prior of \phi_u (inverse range parameter of spatial random effect). Can be same as phi_ub
phi_ub, lower bound of uniform prior of \phi_u (inverse range parameter of spatial random effect). Can be same as phi_lb
Returns list of
post_save |
a matrix of posterior samples (coda::mcmc) with nsave rows |
post_u_save |
a matrix of posterior samples (coda::mcmc) of random effects, with nsave rows |
loglik_save |
a nsave x n matrix of pointwise log-likelihood values, can be used for WAIC calculation. |
priors |
list of hyperprior information |
nsave |
number of MCMC samples |
t_mcmc |
wall-clock time for running MCMC |
t_premcmc |
wall-clock time for preprocessing before MCMC |
y |
response vector |
X |
fixed effect design matrix |
coords |
a n x 2 matrix of Euclidean coordinates |
if NNGP = TRUE, also returns
nngp.control |
a list of control parameters for NNGP prior |
spNNGPfit |
an "NNGP" class with empty samples, placeholder for prediction |
# Please see https://github.com/changwoo-lee/cobin-reproduce
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.