From 84f3dc2d39f0c44cb831f6ae094d8e2f3a799ecd Mon Sep 17 00:00:00 2001 From: Ken Kellner Date: Tue, 9 Jul 2024 15:50:24 -0400 Subject: [PATCH] Fix bug in open model simulation --- DESCRIPTION | 4 ++-- R/unmarkedFit.R | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index de315131..f8020afe 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: unmarked -Version: 1.4.1.9003 -Date: 2024-06-14 +Version: 1.4.1.9004 +Date: 2024-07-09 Type: Package Title: Models for Data from Unmarked Animals Authors@R: c( diff --git a/R/unmarkedFit.R b/R/unmarkedFit.R index ad312180..b91fb24f 100644 --- a/R/unmarkedFit.R +++ b/R/unmarkedFit.R @@ -2206,9 +2206,9 @@ simOpenN <- function(object, na.rm) S <- G <- matrix(NA, M, T-1) for(i in 1:M) { switch(mix, - P = N[i, 1] <- rpois(1, lambda), + P = N[i, 1] <- rpois(1, lambda[i]), NB = N[i, 1] <- rnbinom(1, size = - exp(coef(object["alpha"])), mu = lambda), + exp(coef(object["alpha"])), mu = lambda[i]), ZIP = N[i,1] <- rzip(1, lambda[i], psi)) if(delta[i, 1] > 1) { for(d in 2:delta[i, 1]) {