spOccupancy v0.5.2 contains an important bug fix in the cross-validation functionality for single-season occupancy models with unbalanced sampling across replicates in the data set. Specifically, the reported cross-validation deviance metrics may be inaccurate when one or more sites had a detection history where a missing value came before a non-missing value. For example, if one or more sites had a detection history of
c(NA, 1, 0, 0, 1), this would lead to the problem occurring, but this would not occur if all missing values were at the end of the detection history (e.g.,
c(1, 0, 0, 1, NA)). The affected functions include the following:
spIntPGOcc(). We strongly encourage users who have performed cross-validation with these models and unbalanced sampling across replicates in the manner described to rerun their analyses using v0.5.2. We apologize for any troubles this has caused.
CRAN release: 2022-12-08
- Fixed issues with unicode text in the manual for passing CRAN checks on Windows
- Fixed a bug in the k-fold cross-validation for models that include unstructured random intercepts on the occupancy portion of the model. This bug could have led to inacurrate cross-validation metrics when comparing a model with the unstructured random effect and without the unstructured random effect. We strongly encourage users who have performed cross-validation under such a scenario to rerun their analyses using v0.5.1.
CRAN release: 2022-11-16
spOccupancy v0.5.0 contains numerous substantial updates that provide new functionality, improved run times for models with unstructured random effects, an important bug fix for cross-validation with unstructured random effects under certain scenarios, and some other minor bug fixes. The changes include:
- New functionality for fitting spatially-varying coefficient occupancy models. The function
svcPGOcc()fits a single-season spatially-varying coefficient model, and
svcTPGOcc()fits a multi-season spatially-varying coefficient model. We also include the functions
svcTPGBinom()for fitting spatially-varying coefficient generalized linear models when ignoring imperfect detection. We also include the helper function
getSVCSamples()to more easily extract the SVC samples from the resulting model objects if they are desired.
- Updated the underlying
C++code to reduce run times for models that include unstructured random intercepts.
- Added the
k.fold.onlyargument to all model-fitting functions, which allows users to only perform k-fold cross-validation instead of having to run the model first with the entire data set.
- Adjusted how random intercepts in the detection model were being calculated, which resulted in unnecessary massive objects when fitting a model with a large number of random effect levels and spatial locations. See GitHub issue 14.
- Fixed a bug that prevented prediction from working for multi-species models when
X.0was supplied as a data frame and not a matrix. See GitHub issue 13.
- Fixed an error that occurred when the detection-nondetection data were specified in a specific way. See GitHub issue 12.
CRAN release: 2022-07-13
- Major new functionality for fitting multi-season (i.e., spatio-temporal) single-species occupancy models using the functions
- Fixed a bug in calculation of the detection probability values in
fitted()functions for all spOccupancy model objects. See this Github issue for more details.
- Fixed an error that occurred when predicting for multi-species models and setting
ignore.RE = TRUE.
- Fixed other small bugs that caused model fitting functions to break under specific circumstances.
CRAN release: 2022-05-21
- Fixed a bug in
waicOcc()for integrated models (
spIntPGOcc()) that sometimes resulted in incorrect estimates of WAIC for data sets other than the first data set. We strongly encourage users who have used
waicOcc()with an integrated model to rerun their analyses using v0.3.2.
- Fixed a bug introduced in v0.3.0 that sometimes resulted in incorrect predictions from a spatially-explicit model with non-spatial random effects in the occurrence portion of the model. We strongly encourage users who have used
predict()on a spatially-explicit model with non-spatial random effects in the occurrence portion of the model to rerun their analyses using v0.3.2.
- Users can now specify a uniform prior on the spatial variance parameter instead of an inverse-Gamma prior. We also allow users to fix the value of the spatial variance parameter at the initial value. See the reference pages of spatially-explicit functions for more details.
- Slight changes in the information printed when fitting spatially-explicit models.
- Removed dependency on spBayes to pass CRAN checks.
CRAN release: 2022-04-13
CRAN release: 2022-03-29
spOccupancy Version 0.3.0 contains numerous substantial updates that provide new functionality, improved computational performance for model fitting and subsequent model checking/comparison, and minor bug fixes. The changes include:
- Additional functionality for fitting spatial and non-spatial multi-species occupancy models with residual species correlations (i.e., joint species distribution models with imperfect detection). See documentation for
sfMsPGOcc(). We also included the functions
sfJSDM()which are more typical joint species distribution models that fail to explicitly account for imperfect detection.
- All single-species and multi-species models allow for unstructured random intercepts in both the occurrence and detection portions of the occupancy model. Prior to this version, random intercepts were not supported in the occurrence portion of spatially-explicit models.
predict()functions for single-species and multi-species models now include the argument
type, which allows for prediction of detection probability (
type = 'detection') at a set of covariate values as well as predictions of occurrence (
type = 'occupancy').
- All models are substantially faster than version 0.2.1. We improved performance by implementing a change in how we sample the latent Polya-Gamma variables in the detection component of the model. This results in substantial increases in speed for models where the number of replicates varies across sites. We additionally updated how non-spatial random effects were sampled, which also contributes to improved computational performance.
- All model fitting functions now include the object
like.samplesin the resulting model object, which contains model likelihood values needed for calculation of WAIC. This leads to much shorter run times for
waicOcc()compared to previous versions.
fitted.*()functions now return both the fitted values and the estimated detection probability samples from a fitted
- Improved error handling for models with missing values and random effects.
- Added the argument
predict()functions. If non-spatial random intercepts are included when fitting the model, setting
ignore.RE = TRUEwill yield predictions that ignore the values of the random effects. If
ignore.RE = FALSE, the model will predict new values using the random intercepts for both sampled and non-sampled levels of the effects.
- Fixed a bug in the cross-validation component of all
spOccupancymodel fitting functions that occurred when random effects were included in the occurrence and/or detection component of the model.
- Fixed minor bug in
simMsOcc()that prevented simulating data with multiple random intercepts on detection.
- Fixed minor bug in spatially-explicit models that resulted in an error when setting
NNGP = FALSEand not specifying initial values for the spatial range parameter
- Fixed a bug in the
spPGOccobjects that resulted in potentially inaccurate predictions when
CRAN release: 2022-01-07
- Minor changes related to arguments in C++ code in header files to pass CRAN additional issues.
CRAN release: 2021-12-19
- Added an
n.chainsargument to all model-fitting functions for running multiple chains in sequence.
- Added posterior means, standard deviations, Gelman-Rubin diagnostic (Rhat) and Effective Sample Size (ESS) to
summarydisplays for each model-fitting function.
- Fixed spatially-explicit
predictfunctions to return occurrence probabilities at sampled sites instead of NAs.