aboutsummaryrefslogtreecommitdiff
path: root/R/unmarkedFit.R
diff options
context:
space:
mode:
Diffstat (limited to 'R/unmarkedFit.R')
-rw-r--r--R/unmarkedFit.R11
1 files changed, 8 insertions, 3 deletions
diff --git a/R/unmarkedFit.R b/R/unmarkedFit.R
index 161616e..95c832c 100644
--- a/R/unmarkedFit.R
+++ b/R/unmarkedFit.R
@@ -2945,10 +2945,15 @@ setMethod("simulate", "unmarkedFitGPC",
simList <- list()
for(s in 1:nsim) {
switch(mixture,
- P = M <- rpois(n=R, lambda=lam),
+ P = M <- rpois(n=R, lambda=lam),
# FIXME: Add ZIP
- NB = M <- rnbinom(n=R, mu=lam,
- size=exp(coef(object, type="alpha"))))
+ NB = M <- rnbinom(n=R, mu=lam,
+ size=exp(coef(object, type="alpha"))),
+ ZIP = {
+ psi <- plogis(coef(object['psi']))
+ M <- rzip(R, lambda=lam, psi=psi)
+ }
+ )
N <- rbinom(R*T, size=M, prob=phi.mat)
N <- matrix(N, nrow=R, ncol=T, byrow=FALSE)