Skip to content

Commit

Permalink
fix c++ issue with predict.spAbund in certain situations
Browse files Browse the repository at this point in the history
  • Loading branch information
doserjef committed Oct 4, 2024
1 parent e429a18 commit 626db6d
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 22 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: spAbundance
Type: Package
Title: Univariate and Multivariate Spatial Modeling of Species Abundance
Version: 0.2.0
Version: 0.2.1
Authors@R: c(person("Jeffrey", "Doser", role=c("aut", "cre"), email="[email protected]"), person("Andrew", "Finley", role = c("aut")))
Description: Fits single-species (univariate) and multi-species (multivariate) non-spatial and spatial abundance models in a Bayesian framework using Markov Chain Monte Carlo (MCMC). Spatial models are fit using Nearest Neighbor Gaussian Processes (NNGPs). Details on NNGP models are given in Datta, Banerjee, Finley, and Gelfand (2016) <doi:10.1080/01621459.2015.1044091> and Finley, Datta, and Banerjee (2022) <doi:10.18637/jss.v103.i05>. Fits single-species and multi-species spatial and non-spatial versions of generalized linear mixed models (Gaussian, Poisson, Negative Binomial), N-mixture models (Royle 2004 <doi:10.1111/j.0006-341X.2004.00142.x>) and hierarchical distance sampling models (Royle, Dawson, Bates (2004) <doi:10.1890/03-3127>). Multi-species spatial models are fit using a spatial factor modeling approach with NNGPs for computational efficiency.
License: GPL (>= 3)
Expand Down
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# spAbundance 0.2.1

+ Fixed a `C++` memory issue in `predict.spAbund()` that could result in crashes under certain situations.

# spAbundance 0.2.0

+ Updated `svcAbund()` to now work with Poisson and negative binomial families. Note that the function now defaults to use `family = 'Poisson'`, which differs from the previous implementation when only `family = 'Gaussian'` was supported. This switch was done to maintain consistency with other spAbundance model-fitting functions.
Expand Down
2 changes: 1 addition & 1 deletion R/generics.R
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,7 @@ predict.spAbund <- function(object, X.0, coords.0,
if (is(object, 'spAbund')) {
svc.cols <- 1
p.svc <- 1
X.w.0 <- matrix(1, nrow = X.0, ncol = 1)
X.w.0 <- matrix(1, nrow = nrow(X.0), ncol = 1)
} else {
svc.cols <- object$svc.cols
p.svc <- length(svc.cols)
Expand Down
40 changes: 20 additions & 20 deletions spAbundance.Rproj
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
Version: 1.0
RestoreWorkspace: Default
SaveWorkspace: Default
AlwaysSaveHistory: Default
EnableCodeIndexing: Yes
UseSpacesForTab: Yes
NumSpacesForTab: 2
Encoding: UTF-8
RnwWeave: knitr
LaTeX: pdfLaTeX
AutoAppendNewline: Yes
StripTrailingWhitespace: Yes
BuildType: Package
PackageUseDevtools: Yes
PackageInstallArgs: --no-multiarch --with-keep.source
Version: 1.0

RestoreWorkspace: Default
SaveWorkspace: Default
AlwaysSaveHistory: Default

EnableCodeIndexing: Yes
UseSpacesForTab: Yes
NumSpacesForTab: 2
Encoding: UTF-8

RnwWeave: knitr
LaTeX: pdfLaTeX

AutoAppendNewline: Yes
StripTrailingWhitespace: Yes

BuildType: Package
PackageUseDevtools: Yes
PackageInstallArgs: --no-multiarch --with-keep.source

0 comments on commit 626db6d

Please sign in to comment.