Skip to contents

The function stMsPGOcc fits multi-species multi-season spatial occupancy models with species correlations (i.e., a spatially-explicit joint species distribution model with imperfect detection). We use Polya-Gamma latent variables and a spatial factor modeling approach. Models are implemented using a Nearest Neighbor Gaussian Process.

Usage

stMsPGOcc(occ.formula, det.formula, data, inits, priors, tuning, 
          cov.model = 'exponential', NNGP = TRUE, 
          n.neighbors = 15, search.type = 'cb', 
          n.factors, n.batch, batch.length, 
          accept.rate = 0.43, n.omp.threads = 1, 
          verbose = TRUE, ar1 = FALSE, n.report = 100, 
          n.burn = round(.10 * n.batch * batch.length), n.thin = 1, 
          n.chains = 1, ...)

Arguments

occ.formula

a symbolic description of the model to be fit for the occurrence portion of the model using R's model syntax. Random intercepts are allowed using lme4 syntax (Bates et al. 2015). Only right-hand side of formula is specified. See example below.

det.formula

a symbolic description of the model to be fit for the detection portion of the model using R's model syntax. Only right-hand side of formula is specified. See example below. Random intercepts are allowed using lme4 syntax (Bates et al. 2015).

data

a list containing data necessary for model fitting. Valid tags are y, occ.covs, det.covs, coords, and grid.index. y is a four-dimensional array with first dimension equal to the number of species, second dimension equal to the number of sites, third dimension equal to the number of primary time periods, and fourth dimension equal to the maximum number of secondary replicates at a given site. occ.covs is a list of variables included in the occurrence portion of the model. Each list element is a different occurrence covariate, which can be site level or site/primary time period level. Site-level covariates are specified as a vector of length \(J\) while site/primary time period level covariates are specified as a matrix with rows corresponding to sites and columns correspond to primary time periods. Similarly, det.covs is a list of variables included in the detection portion of the model, with each list element corresponding to an individual variable. In addition to site-level and/or site/primary time period-level, detection covariates can also be observational-level. Observation-level covariates are specified as a three-dimensional array with first dimension corresponding to sites, second dimension corresponding to primary time period, and third dimension corresponding to replicate. coords is a matrix of the observation coordinates used to estimate the SVCs for each site. coords has two columns for the easting and northing coordinate, respectively. Typically, each site in the data set will have it's own coordinate, such that coords is a \(J \times 2\) matrix and grid.index should not be specified. If you desire to estimate SVCs at some larger spatial level, e.g., if points fall within grid cells and you want to estimate an SVC for each grid cell instead of each point, coords can be specified as the coordinate for each grid cell. In such a case, grid.index is an indexing vector of length J, where each value of grid.index indicates the corresponding row in coords that the given site corresponds to. Note that spOccupancy assumes coordinates are specified in a projected coordinate system.

inits

a list with each tag corresponding to a parameter name. Valid tags are alpha.comm, beta.comm, beta, alpha, tau.sq.beta, tau.sq.alpha, sigma.sq.psi, sigma.sq.p, z, phi, lambda, nu, sigma.sq.t, and rho. nu is only specified if cov.model = "matern", and sigma.sq.psi and sigma.sq.p are only specified if random effects are included in occ.formula or det.formula, respectively. sigma.sq.t and rho are only relevant when ar1 = TRUE. The value portion of each tag is the parameter's initial value. See priors description for definition of each parameter name. Additionally, the tag fix can be set to TRUE to fix the starting values across all chains. If fix is not specified (the default), starting values are varied randomly across chains.

priors

a list with each tag corresponding to a parameter name. Valid tags are beta.comm.normal, alpha.comm.normal, tau.sq.beta.ig, tau.sq.alpha.ig, sigma.sq.psi, sigma.sq.p, phi.unif, nu.unif, sigma.sq.t.ig, and rho.unif. Community-level occurrence (beta.comm) and detection (alpha.comm) regression coefficients are assumed to follow a normal distribution. The hyperparameters of the normal distribution are passed as a list of length two with the first and second elements corresponding to the mean and variance of the normal distribution, which are each specified as vectors of length equal to the number of coefficients to be estimated or of length one if priors are the same for all coefficients. If not specified, prior means are set to 0 and prior variances set to 2.73. By default, community-level variance parameters for occupancy (tau.sq.beta) and detection (tau.sq.alpha) are assumed to follow an inverse Gamma distribution. The hyperparameters of the inverse gamma distribution are passed as a list of length two with the first and second elements corresponding to the shape and scale parameters, which are each specified as vectors of length equal to the number of coefficients to be estimated or a single value if priors are the same for all parameters. If not specified, prior shape and scale parameters are set to 0.1. The spatial factor model fits n.factors independent spatial processes. The spatial decay phi and smoothness nu parameters for each latent factor are assumed to follow Uniform distributions. The hyperparameters of the Uniform are passed as a list with two elements, with both elements being vectors of length n.factors corresponding to the lower and upper support, respectively, or as a single value if the same value is assigned for all factor combinations. The priors for the factor loadings matrix lambda are fixed following the standard spatial factor model to ensure parameter identifiability (Christensen and Amemlya 2002). The upper triangular elements of the N x n.factors matrix are fixed at 0 and the diagonal elements are fixed at 1. The lower triangular elements are assigned a standard normal prior (i.e., mean 0 and variance 1). sigma.sq.psi and sigma.sq.p are the random effect variances for any occurrence or detection random effects, respectively, and are assumed to follow an inverse Gamma distribution. The hyperparameters of the inverse-Gamma distribution are passed as a list of length two with first and second elements corresponding to the shape and scale parameters, respectively, which are each specified as vectors of length equal to the number of random intercepts or of length one if priors are the same for all random effect variances. parameters are set to 0.1. sigma.sq.t and rho are the AR(1) variance and correlation parameters for the AR(1) zero-mean temporal random effects, respectively. sigma.sq.t is assumed to follow an inverse-Gamma distribution, where the hyperparameters are specified as a list of length two with the first and second elements corresponding to the shape and scale parameters, respectively, which can each be specified as vector equal to the number of species in the model or a single value if the same prior is used for all species. rho is assumed to follow a uniform distribution, where the hyperparameters are specified similarly as a list of length two with the first and second elements corresponding to the lower and upper bounds of the uniform prior, which can each be specified as vector equal to the number of species in the model or a single value if the same prior is used for all species.

tuning

a list with each tag corresponding to a parameter name. Valid tags are phi, nu, rho. The value portion of each tag defines the initial variance of the adaptive sampler. We assume the initial variance of the adaptive sampler is the same for each species, although the adaptive sampler will adjust the tuning variances separately for each species. See Roberts and Rosenthal (2009) for details.

cov.model

a quoted keyword that specifies the covariance function used to model the spatial dependence structure among the observations. Supported covariance model key words are: "exponential", "matern", "spherical", and "gaussian".

NNGP

if TRUE, model is fit with an NNGP. If FALSE, a full Gaussian process is used. See Datta et al. (2016) and Finley et al. (2019) for more information. Only NNGP = TRUE is currently supported.

n.neighbors

number of neighbors used in the NNGP. Only used if NNGP = TRUE. Datta et al. (2016) showed that 15 neighbors is usually sufficient, but that as few as 5 neighbors can be adequate for certain data sets, which can lead to even greater decreases in run time. We recommend starting with 15 neighbors (the default) and if additional gains in computation time are desired, subsequently compare the results with a smaller number of neighbors using WAIC.

search.type

a quoted keyword that specifies the type of nearest neighbor search algorithm. Supported method key words are: "cb" and "brute". The "cb" should generally be much faster. If locations do not have identical coordinate values on the axis used for the nearest neighbor ordering then "cb" and "brute" should produce identical neighbor sets. However, if there are identical coordinate values on the axis used for nearest neighbor ordering, then "cb" and "brute" might produce different, but equally valid, neighbor sets, e.g., if data are on a grid.

n.factors

the number of factors to use in the spatial factor model approach. Typically, the number of factors is set to be small (e.g., 4-5) relative to the total number of species in the community, which will lead to substantial decreases in computation time. However, the value can be anywhere between 1 and N (the number of species in the community).

n.batch

the number of MCMC batches in each chain to run for the Adaptive MCMC sampler. See Roberts and Rosenthal (2009) for details.

batch.length

the length of each MCMC batch to run for the Adaptive MCMC sampler. See Roberts and Rosenthal (2009) for details.

accept.rate

target acceptance rate for Adaptive MCMC. Defaul is 0.43. See Roberts and Rosenthal (2009) for details.

n.omp.threads

a positive integer indicating the number of threads to use for SMP parallel processing. The package must be compiled for OpenMP support. For most Intel-based machines, we recommend setting n.omp.threads up to the number of hyperthreaded cores. Note, n.omp.threads > 1 might not work on some systems.

verbose

if TRUE, messages about data preparation, model specification, and progress of the sampler are printed to the screen. Otherwise, no messages are printed.

ar1

logical value indicating whether to include an AR(1) zero-mean temporal random effect in the model. If FALSE, the model is fit without an AR(1) temporal autocovariance structure. If TRUE, an AR(1) random effect is included in the model to account for temporal autocorrelation across the primary time periods.

n.report

the interval to report Metropolis sampler acceptance and MCMC progress. Note this is specified in terms of batches and not overall samples for spatial models.

n.burn

the number of samples out of the total n.samples to discard as burn-in for each chain. By default, the first 10% of samples is discarded.

n.thin

the thinning interval for collection of MCMC samples. The thinning occurs after the n.burn samples are discarded. Default value is set to 1.

n.chains

the number of chains to run in sequence.

...

currently no additional arguments

Note

Some of the underlying code used for generating random numbers from the Polya-Gamma distribution is taken from the pgdraw package written by Daniel F. Schmidt and Enes Makalic. Their code implements Algorithm 6 in PhD thesis of Jesse Bennett Windle (2013) https://repositories.lib.utexas.edu/handle/2152/21842.

References

Datta, A., S. Banerjee, A.O. Finley, and A.E. Gelfand. (2016) Hierarchical Nearest-Neighbor Gaussian process models for large geostatistical datasets. Journal of the American Statistical Association, doi:10.1080/01621459.2015.1044091 .

Finley, A.O., A. Datta, B.D. Cook, D.C. Morton, H.E. Andersen, and S. Banerjee. (2019) Efficient algorithms for Bayesian Nearest Neighbor Gaussian Processes. Journal of Computational and Graphical Statistics, doi:10.1080/10618600.2018.1537924 .

Finley, A. O., Datta, A., and Banerjee, S. (2020). spNNGP R package for nearest neighbor Gaussian process models. arXiv preprint arXiv:2001.09111.

Polson, N.G., J.G. Scott, and J. Windle. (2013) Bayesian Inference for Logistic Models Using Polya-Gamma Latent Variables. Journal of the American Statistical Association, 108:1339-1349.

Roberts, G.O. and Rosenthal J.S. (2009) Examples of adaptive MCMC. Journal of Computational and Graphical Statistics, 18(2):349-367.

Bates, Douglas, Martin Maechler, Ben Bolker, Steve Walker (2015). Fitting Linear Mixed-Effects Models Using lme4. Journal of Statistical Software, 67(1), 1-48. doi:10.18637/jss.v067.i01 .

Hooten, M. B., and Hobbs, N. T. (2015). A guide to Bayesian model selection for ecologists. Ecological Monographs, 85(1), 3-28.

Christensen, W. F., and Amemiya, Y. (2002). Latent variable analysis of multivariate spatial data. Journal of the American Statistical Association, 97(457), 302-317.

Author

Jeffrey W. Doser doserjef@msu.edu,
Andrew O. Finley finleya@msu.edu

Value

An object of class stMsPGOcc that is a list comprised of:

beta.comm.samples

a coda object of posterior samples for the community level occurrence regression coefficients.

alpha.comm.samples

a coda object of posterior samples for the community level detection regression coefficients.

tau.sq.beta.samples

a coda object of posterior samples for the occurrence community variance parameters.

tau.sq.alpha.samples

a coda object of posterior samples for the detection community variance parameters.

beta.samples

a coda object of posterior samples for the species level occurrence regression coefficients.

alpha.samples

a coda object of posterior samples for the species level detection regression coefficients.

theta.samples

a coda object of posterior samples for the species level correlation parameters and the species-level temporal autocorrelation parameters.

lambda.samples

a coda object of posterior samples for the latent spatial factor loadings.

z.samples

a four-dimensional array of posterior samples for the latent occurrence values for each species. Dimensions corresopnd to MCMC sample, species, site, and primary time period.

psi.samples

a four-dimensional array of posterior samples for the latent occupancy probability values for each species. Dimensions correspond to MCMC sample, species, site, and primary time period.

w.samples

a three-dimensional array of posterior samples for the latent spatial random effects for each spatial factor. Dimensions correspond to MCMC sample, factor, and site.

sigma.sq.psi.samples

a coda object of posterior samples for variances of random intercepts included in the occurrence portion of the model. Only included if random intercepts are specified in occ.formula.

sigma.sq.p.samples

a coda object of posterior samples for variances of random intercpets included in the detection portion of the model. Only included if random intercepts are specified in det.formula.

beta.star.samples

a coda object of posterior samples for the occurrence random effects. Only included if random intercepts are specified in occ.formula.

alpha.star.samples

a coda object of posterior samples for the detection random effects. Only included if random intercepts are specified in det.formula.

like.samples

a four-dimensional array of posterior samples for the likelihood value used for calculating WAIC. Dimensions correspond to MCMC sample, species, site, and time period.

rhat

a list of Gelman-Rubin diagnostic values for some of the model parameters.

ESS

a list of effective sample sizes for some of the model parameters.

run.time

MCMC sampler execution time reported using proc.time().

The return object will include additional objects used for subsequent prediction and/or model fit evaluation. Note that detection probability estimated values are not included in the model object, but can be extracted using fitted().

Examples

# Simulate Data -----------------------------------------------------------
set.seed(500)
J.x <- 8
J.y <- 8
J <- J.x * J.y
# Years sampled
n.time <- sample(3:10, J, replace = TRUE)
# n.time <- rep(10, J)
n.time.max <- max(n.time)
# Replicates
n.rep <- matrix(NA, J, max(n.time))
for (j in 1:J) {
  n.rep[j, 1:n.time[j]] <- sample(2:4, n.time[j], replace = TRUE)
}
N <- 7
# Community-level covariate effects
# Occurrence
beta.mean <- c(-3, -0.2, 0.5)
trend <- FALSE
sp.only <- 0
p.occ <- length(beta.mean)
tau.sq.beta <- c(0.6, 1.5, 1.4)
# Detection
alpha.mean <- c(0, 1.2, -1.5)
tau.sq.alpha <- c(1, 0.5, 2.3)
p.det <- length(alpha.mean)
# Random effects
psi.RE <- list()
p.RE <- list()
# Draw species-level effects from community means.
beta <- matrix(NA, nrow = N, ncol = p.occ)
alpha <- matrix(NA, nrow = N, ncol = p.det)
for (i in 1:p.occ) {
  beta[, i] <- rnorm(N, beta.mean[i], sqrt(tau.sq.beta[i]))
}
for (i in 1:p.det) {
  alpha[, i] <- rnorm(N, alpha.mean[i], sqrt(tau.sq.alpha[i]))
}
sp <- TRUE
svc.cols <- c(1)
p.svc <- length(svc.cols)
n.factors <- 3
phi <- runif(p.svc * n.factors, 3 / .9, 3 / .3)
factor.model <- TRUE
cov.model <- 'exponential'
ar1 <- TRUE
sigma.sq.t <- runif(N, 0.05, 1)
rho <- runif(N, 0.1, 1)

dat <- simTMsOcc(J.x = J.x, J.y = J.y, n.time = n.time, n.rep = n.rep, N = N,
                 beta = beta, alpha = alpha, sp.only = sp.only, trend = trend,
                 psi.RE = psi.RE, p.RE = p.RE, factor.model = factor.model,
                 svc.cols = svc.cols, n.factors = n.factors, phi = phi, sp = sp,
                 cov.model = cov.model, ar1 = ar1, sigma.sq.t = sigma.sq.t, rho = rho)

y <- dat$y
X <- dat$X
X.p <- dat$X.p
coords <- dat$coords
X.re <- dat$X.re
X.p.re <- dat$X.p.re

occ.covs <- list(occ.cov.1 = X[, , 2],
                 occ.cov.2 = X[, , 3])
det.covs <- list(det.cov.1 = X.p[, , , 2],
                 det.cov.2 = X.p[, , , 3])

data.list <- list(y = y, occ.covs = occ.covs,
                  det.covs = det.covs,
                  coords = coords)
# Priors
prior.list <- list(beta.comm.normal = list(mean = 0, var = 2.72),
                   alpha.comm.normal = list(mean = 0, var = 2.72),
                   tau.sq.beta.ig = list(a = 0.1, b = 0.1),
                   tau.sq.alpha.ig = list(a = 0.1, b = 0.1),
                   rho.unif = list(a = -1, b = 1),
                   sigma.sq.t.ig = list(a = 0.1, b = 0.1),
                   phi.unif = list(a = 3 / .9, b = 3 / .1))
z.init <- apply(y, c(1, 2, 3), function(a) as.numeric(sum(a, na.rm = TRUE) > 0))
inits.list <- list(alpha.comm = 0, beta.comm = 0, beta = 0,
                   alpha = 0, tau.sq.beta = 1, tau.sq.alpha = 1,
                   rho = 0.5, sigma.sq.t = 0.5,
                   phi = 3 / .5, z = z.init)
# Tuning
tuning.list <- list(phi = 1, rho = 0.5)

# Number of batches
n.batch <- 5
# Batch length
batch.length <- 25
n.burn <- 25
n.thin <- 1
n.samples <- n.batch * batch.length

out <- stMsPGOcc(occ.formula = ~ occ.cov.1 + occ.cov.2,
                 det.formula = ~ det.cov.1 + det.cov.2,
                 data = data.list,
                 inits = inits.list,
                 n.batch = n.batch,
                 batch.length = batch.length,
                 accept.rate = 0.43,
                 ar1 = TRUE,
                 NNGP = TRUE,
                 n.neighbors = 5,
                 n.factors = n.factors,
                 cov.model = 'exponential',
                 priors = prior.list,
                 tuning = tuning.list,
                 n.omp.threads = 1,
                 verbose = TRUE,
                 n.report = 1,
                 n.burn = n.burn,
                 n.thin = n.thin,
                 n.chains = 1)
#> ----------------------------------------
#> 	Preparing to run the model
#> ----------------------------------------
#> lambda is not specified in initial values.
#> Setting initial values of the lower triangle to 0
#> ----------------------------------------
#> 	Building the neighbor list
#> ----------------------------------------
#> ----------------------------------------
#> Building the neighbors of neighbors list
#> ----------------------------------------
#> ----------------------------------------
#> 	Model description
#> ----------------------------------------
#> Spatial Factor NNGP Multi-season Multi-species Occupancy Model with Polya-Gamma latent
#> variables with 64 sites, 7 species, and 10 primary time periods.
#> 
#> Samples per chain: 125 (5 batches of length 25)
#> Burn-in: 25 
#> Thinning Rate: 1 
#> Number of Chains: 1 
#> Total Posterior Samples: 100 
#> 
#> Using the exponential spatial correlation model.
#> 
#> Using 3 latent spatial factors.
#> Using 5 nearest neighbors.
#> 
#> Source compiled with OpenMP support and model fit using 1 thread(s).
#> 
#> Adaptive Metropolis with target acceptance rate: 43.0
#> ----------------------------------------
#> 	Chain 1
#> ----------------------------------------
#> Sampling ... 
#> Batch: 1 of 5, 20.00%
#> 	Latent Factor	Parameter	Acceptance	Tuning
#> 	1		phi		60.0		1.02020
#> 	2		phi		64.0		1.02020
#> 	3		phi		48.0		1.02020
#> 	Species		Parameter	Acceptance	Tuning
#> 	1		rho		80.0		0.51010
#> 	2		rho		76.0		0.51010
#> 	3		rho		84.0		0.51010
#> 	4		rho		72.0		0.51010
#> 	5		rho		80.0		0.51010
#> 	6		rho		72.0		0.51010
#> 	7		rho		76.0		0.51010
#> -------------------------------------------------
#> Batch: 2 of 5, 40.00%
#> 	Latent Factor	Parameter	Acceptance	Tuning
#> 	1		phi		64.0		1.03045
#> 	2		phi		84.0		1.03045
#> 	3		phi		72.0		1.03045
#> 	Species		Parameter	Acceptance	Tuning
#> 	1		rho		72.0		0.51523
#> 	2		rho		76.0		0.51523
#> 	3		rho		96.0		0.51523
#> 	4		rho		72.0		0.51523
#> 	5		rho		68.0		0.51523
#> 	6		rho		80.0		0.51523
#> 	7		rho		84.0		0.51523
#> -------------------------------------------------
#> Batch: 3 of 5, 60.00%
#> 	Latent Factor	Parameter	Acceptance	Tuning
#> 	1		phi		52.0		1.04081
#> 	2		phi		72.0		1.04081
#> 	3		phi		76.0		1.04081
#> 	Species		Parameter	Acceptance	Tuning
#> 	1		rho		76.0		0.52041
#> 	2		rho		72.0		0.52041
#> 	3		rho		84.0		0.52041
#> 	4		rho		72.0		0.52041
#> 	5		rho		80.0		0.52041
#> 	6		rho		80.0		0.52041
#> 	7		rho		80.0		0.52041
#> -------------------------------------------------
#> Batch: 4 of 5, 80.00%
#> 	Latent Factor	Parameter	Acceptance	Tuning
#> 	1		phi		76.0		1.05127
#> 	2		phi		72.0		1.05127
#> 	3		phi		52.0		1.05127
#> 	Species		Parameter	Acceptance	Tuning
#> 	1		rho		72.0		0.52564
#> 	2		rho		68.0		0.52564
#> 	3		rho		64.0		0.52564
#> 	4		rho		84.0		0.52564
#> 	5		rho		96.0		0.52564
#> 	6		rho		72.0		0.52564
#> 	7		rho		64.0		0.52564
#> -------------------------------------------------
#> Batch: 5 of 5, 100.00%

summary(out)
#> 
#> Call:
#> stMsPGOcc(occ.formula = ~occ.cov.1 + occ.cov.2, det.formula = ~det.cov.1 + 
#>     det.cov.2, data = data.list, inits = inits.list, priors = prior.list, 
#>     tuning = tuning.list, cov.model = "exponential", NNGP = TRUE, 
#>     n.neighbors = 5, n.factors = n.factors, n.batch = n.batch, 
#>     batch.length = batch.length, accept.rate = 0.43, n.omp.threads = 1, 
#>     verbose = TRUE, ar1 = TRUE, n.report = 1, n.burn = n.burn, 
#>     n.thin = n.thin, n.chains = 1)
#> 
#> Samples per Chain: 125
#> Burn-in: 25
#> Thinning Rate: 1
#> Number of Chains: 1
#> Total Posterior Samples: 100
#> Run Time (min): 0.0088
#> 
#> ----------------------------------------
#> 	Community Level
#> ----------------------------------------
#> Occurrence Means (logit scale): 
#>                Mean     SD    2.5%     50%   97.5% Rhat ESS
#> (Intercept) -3.1903 0.2621 -3.7197 -3.1385 -2.6969   NA   7
#> occ.cov.1    0.5659 0.2262  0.1026  0.5668  1.0244   NA 100
#> occ.cov.2    0.7110 0.4862 -0.2455  0.7253  1.6190   NA 173
#> 
#> Occurrence Variances (logit scale): 
#>               Mean     SD   2.5%    50%  97.5% Rhat ESS
#> (Intercept) 0.1913 0.2260 0.0297 0.1257 0.7905   NA  33
#> occ.cov.1   0.4054 0.3723 0.0845 0.2865 1.6582   NA 100
#> occ.cov.2   2.1141 1.5138 0.5280 1.7568 5.0045   NA  67
#> 
#> Detection Means (logit scale): 
#>                Mean     SD    2.5%     50%   97.5% Rhat ESS
#> (Intercept)  0.1471 0.2927 -0.4031  0.1408  0.6521   NA 100
#> det.cov.1    0.9921 0.2475  0.5202  0.9998  1.4663   NA  37
#> det.cov.2   -1.2253 0.6473 -2.5985 -1.1659 -0.1460   NA 109
#> 
#> Detection Variances (logit scale): 
#>               Mean     SD   2.5%    50%   97.5% Rhat ESS
#> (Intercept) 0.6392 0.5414 0.1680 0.5279  2.1914   NA  27
#> det.cov.1   0.3403 0.2488 0.0733 0.2733  0.9511   NA  42
#> det.cov.2   3.6049 3.2837 0.7812 2.6650 13.4984   NA  21
#> 
#> ----------------------------------------
#> 	Species Level
#> ----------------------------------------
#> Occurrence (logit scale): 
#>                    Mean     SD    2.5%     50%   97.5% Rhat ESS
#> (Intercept)-sp1 -3.3297 0.3888 -4.1433 -3.2824 -2.6703   NA   5
#> (Intercept)-sp2 -3.0302 0.3488 -3.7514 -2.9583 -2.4705   NA  10
#> (Intercept)-sp3 -3.3860 0.3936 -4.2327 -3.3367 -2.7372   NA   6
#> (Intercept)-sp4 -3.1237 0.2630 -3.6790 -3.1009 -2.6907   NA  12
#> (Intercept)-sp5 -3.2946 0.3954 -4.1444 -3.2466 -2.7079   NA   7
#> (Intercept)-sp6 -3.1601 0.3479 -3.8420 -3.0743 -2.5627   NA   6
#> (Intercept)-sp7 -3.1352 0.3265 -3.6939 -3.1856 -2.4080   NA  13
#> occ.cov.1-sp1    0.2307 0.1804 -0.1378  0.2201  0.5889   NA  27
#> occ.cov.1-sp2    0.7235 0.2103  0.2901  0.7207  1.1503   NA  23
#> occ.cov.1-sp3    0.3755 0.2140 -0.1279  0.3762  0.7251   NA  28
#> occ.cov.1-sp4    0.4869 0.1889  0.1968  0.4896  0.8538   NA  31
#> occ.cov.1-sp5    0.6040 0.1643  0.2727  0.5979  0.9092   NA  29
#> occ.cov.1-sp6    0.2298 0.1499 -0.0311  0.2304  0.5123   NA  40
#> occ.cov.1-sp7    1.4114 0.2386  0.9509  1.4039  1.8346   NA  22
#> occ.cov.2-sp1    1.3786 0.2342  0.9905  1.3411  1.8719   NA   8
#> occ.cov.2-sp2    2.0273 0.2591  1.4931  2.0476  2.5555   NA  12
#> occ.cov.2-sp3   -0.7674 0.1811 -1.0609 -0.7866 -0.3743   NA  35
#> occ.cov.2-sp4   -0.6393 0.2165 -1.0877 -0.6302 -0.2833   NA  20
#> occ.cov.2-sp5    0.2300 0.2462 -0.2024  0.1953  0.7407   NA  16
#> occ.cov.2-sp6    1.1910 0.1730  0.8715  1.2023  1.5325   NA  14
#> occ.cov.2-sp7    2.0668 0.3866  1.2297  2.0799  2.6985   NA   8
#> 
#> Detection (logit scale): 
#>                    Mean     SD    2.5%     50%   97.5% Rhat ESS
#> (Intercept)-sp1  0.9012 0.2535  0.4761  0.8726  1.4530   NA  39
#> (Intercept)-sp2 -0.8390 0.2127 -1.2080 -0.8558 -0.4193   NA  20
#> (Intercept)-sp3 -0.2259 0.3871 -0.8882 -0.2475  0.5711   NA  46
#> (Intercept)-sp4  0.6908 0.2238  0.2717  0.6970  1.0743   NA  46
#> (Intercept)-sp5  0.4036 0.3396 -0.0944  0.3693  1.0458   NA  39
#> (Intercept)-sp6  0.5787 0.1811  0.2400  0.5855  0.8641   NA  31
#> (Intercept)-sp7 -0.1498 0.2142 -0.5360 -0.1570  0.3436   NA 221
#> det.cov.1-sp1    1.2902 0.2829  0.7425  1.2786  1.9091   NA  32
#> det.cov.1-sp2    0.7445 0.1761  0.4891  0.7216  1.1369   NA  23
#> det.cov.1-sp3    0.2938 0.3684 -0.4570  0.3221  0.8771   NA  91
#> det.cov.1-sp4    0.7465 0.2061  0.3463  0.7380  1.1203   NA  54
#> det.cov.1-sp5    1.4646 0.3052  0.9639  1.4415  2.1005   NA  44
#> det.cov.1-sp6    1.0180 0.1830  0.6775  1.0178  1.3522   NA  36
#> det.cov.1-sp7    1.2519 0.2474  0.8177  1.2405  1.7466   NA  45
#> det.cov.2-sp1   -0.0931 0.2450 -0.5409 -0.1060  0.3954   NA  43
#> det.cov.2-sp2    0.0983 0.1430 -0.2344  0.0985  0.3614   NA 100
#> det.cov.2-sp3   -4.4606 1.1734 -7.4954 -4.2584 -2.7708   NA   6
#> det.cov.2-sp4   -1.4042 0.2966 -2.0085 -1.4245 -0.9351   NA  32
#> det.cov.2-sp5   -0.3332 0.2692 -0.8393 -0.3440  0.1686   NA  55
#> det.cov.2-sp6   -2.3120 0.3032 -2.9638 -2.2908 -1.7709   NA  18
#> det.cov.2-sp7   -1.8293 0.3512 -2.6926 -1.7842 -1.2772   NA  29
#> 
#> ----------------------------------------
#> 	Spatio-temporal Covariance: 
#> ----------------------------------------
#>                   Mean      SD    2.5%     50%   97.5% Rhat ESS
#> phi-1          11.2942  6.0786  3.4838 10.7022 24.8789   NA   6
#> phi-2          15.2182  6.7113  4.3910 15.0727 26.1479   NA   3
#> phi-3          14.8833  6.6208  5.2272 13.4962 26.4224   NA   9
#> sigma.sq.t-sp1  0.1907  0.2315  0.0276  0.1031  0.7960   NA  24
#> sigma.sq.t-sp2  0.6681  0.6546  0.0823  0.4595  2.4232   NA  22
#> sigma.sq.t-sp3  1.1736  1.3530  0.1693  0.7717  5.4696   NA   9
#> sigma.sq.t-sp4  0.5479  0.7019  0.1020  0.3329  1.6769   NA  44
#> sigma.sq.t-sp5  3.8500  8.4377  0.1152  0.8617 27.8119   NA  13
#> sigma.sq.t-sp6  1.5864  1.5311  0.3723  1.1219  7.0752   NA  13
#> sigma.sq.t-sp7  9.2036 15.2452  0.6544  4.4113 53.2451   NA  13
#> rho-sp1        -0.5524  0.4909 -0.9765 -0.7490  0.6696   NA   3
#> rho-sp2         0.6753  0.3835 -0.2623  0.8441  0.9799   NA   2
#> rho-sp3         0.2734  0.4077 -0.5023  0.2218  0.9096   NA   4
#> rho-sp4         0.5117  0.3626 -0.4240  0.6434  0.9053   NA   5
#> rho-sp5         0.5583  0.2749  0.0540  0.5711  0.9704   NA   5
#> rho-sp6         0.7721  0.1338  0.3860  0.8100  0.9322   NA  22
#> rho-sp7         0.3376  0.5412 -0.3874  0.1182  0.9826   NA   1