N <- 5000
# high precision in dimension 2
margins <- c("ZIGP","GP")
mu <- c(10, 15)
phi <- c(1.5, 3.5)
omega <- c(.25, NA)
corstr <- "ex"
corpar <- .5
Y <- rcounts(N=N, margins=margins, mu=mu, phi=phi, omega=omega, corstr=corstr,
corpar=corpar, conv=0.0001)
cor(Y)
# five-dimensional examples
margins <- c("ZIGP","GP","Poi","NB","ZIP")
mu <- c(10, 25, 12, 20, 28)
phi <- c(1.5, 2, NA, NA, NA)
omega <- c(.25, NA, NA, NA, .2)
psi <- c(NA, NA, NA, 7, NA)
# Exchangeable structure with correlation of 0.5
corstr <- "ex"
corpar <- .5
Y <- rcounts(N=N, margins=margins, mu=mu, phi=phi, omega=omega, psi=psi,
corstr=corstr, corpar=corpar)
cor(Y)
# AR(1) structure with correlation of corr(Y(t1), Y(t2)) = .8 ^ |t1-t2|
corstr <- "AR1"
corpar <- .8
Y <- rcounts(N=N, margins=margins, mu=mu, phi=phi, omega=omega, psi=psi,
corstr=corstr, corpar=corpar)
cor(Y)
# Unstructured correlation. Create random symmetric positive definite
# matrix using function 'unstructured'
corstr <- "unstr"
corpar <- unstructured(5)
corpar
Y <- rcounts(N=N, margins=margins, mu=mu, phi=phi, omega=omega, psi=psi,
corstr=corstr, corpar=corpar)
cor(Y)
Run the code above in your browser using DataLab