BSTNB {BSTZINB}R Documentation

Fit a Bayesian Spatiotemporal Negative Binomial model

Description

Generate posterior samples for the parameters in a Bayesian Spatiotemporal Negative Binomial Model

Usage

BSTNB(y,X,A,
            nchain=3,niter=100,nburn=20,nthin=1)

Arguments

y

vector of counts, must be non-negative

X

matrix of covariates, numeric

A

adjacency matrix, numeric

nchain

positive integer, number of MCMC chains to be run

niter

positive integer, number of iterations in each chain

nburn

non-negative integer, number of iterations to be discarded as burn-in samples

nthin

positive integer, thinning interval

Value

list of posterior samples of the parameters of the model

Examples

data(simdat)
y <- simdat$y
X <- cbind(simdat$V1,simdat$x)
data(county.adjacency)
data(USAcities)
IAcities <- subset(USAcities,state_id=="IA")
countyname <- unique(IAcities$county_name)
A <- get_adj_mat(county.adjacency,countyname,c("IA"))

res2 <- BSTNB(y, X, A, nchain=2, niter=100, nburn=20, nthin=1)



[Package BSTZINB version 1.0.1 Index]