search for: subsetcbindysumy

Displaying 1 result from an estimated 1 matches for "subsetcbindysumy".

2010 Nov 15
2
Zero truncated Poisson distribution & R2WinBUGS
...lambda = lam) #True abundance # Simulate count data; only a fraction of N is counted which results in y y <- array(dim = c(R, T)) for(i in 1:T){ y[,i] <- rbinom(n = n.site, size = N, prob = 0.5) } #truncate y matrix y # R-by-T matrix of counts sumy=apply(y,1,sum) cbindysumy=cbind(y,sumy) subsetcbindysumy=subset(cbindysumy,sumy!=0) y=subsetcbindysumy[,1:3]# sites where no animals ever counted are removed C1<-c(y) #vectorized matrix y R=dim(y)[1] site = 1:R site.p <- rep(site, T) ##################################################################################################################...