I am trying to understand why specifying AR-1 covariance structure in conditional formula estimates 2 parameters (like it should), but estimates many parameters when specified in zero-inflation formula. A small example (replicated from “Covariance structures with glmmTMB” tutorial) using simulated data is shown below.
n <- 25 ## Number of time points
x <- MASS::mvrnorm(mu = rep(0,n),
Sigma = .7 ^ as.matrix(dist(1:n)) ) ## Simulate the process using the MASS package
y <- x + rnorm(n) ## Add measurement noise
z <- MASS::mvrnorm(mu = rep(0,n),
Sigma = .7 ^ as.matrix(dist(1:n)) ) # offset
times <- factor(1:n, levels=1:n)
head(levels(times))
group <- factor(rep(1,n))
dat0 <- data.frame(y, times, group, z)
glmmTMB(y ~ offset(z) + ar1(factor(times) + 0 | group), ziformula = ~ 1 + offset(z) + ar1(factor(times) + 0 | group), data=dat0, family = gaussian())
Conditional model:
Groups Name Std.Dev. Corr
group times1 1.406 0.83 (ar1)
Residual 1.164
Zero-inflation model:
Groups Name Std.Dev. Corr
group times1 0.006374
times2 0.006374 0.99
times3 0.006374 0.99 0.99
times4 0.006374 0.98 0.99 0.99
times5 0.006374 0.97 0.98 0.99 0.99
(Note: the remainder of the result is truncated.)
Could anyone shed some light on this?