set.seed(123)
M <- 100
T <- 5
J <- 4
psi <- 0.5
phi <- 0.3
p <- 0.4
z <- rbinom(M, 1, psi)
zmat <- matrix(z, nrow=M, ncol=T)
zz <- rbinom(M*T, 1, zmat*phi)
zz <- matrix(zz, nrow=M, ncol=T)
zzmat <- zz[,rep(1:T, each=J)]
y <- rbinom(M*T*J, 1, zzmat*p)
y <- matrix(y, M, J*T)
umf <- unmarkedMultFrame(y=y, numPrimary=T)
if (FALSE) {
mod <- goccu(psiformula = ~1, phiformula = ~1, pformula = ~1, umf)
plogis(coef(mod))
}
Run the code above in your browser using DataLab