The argument ar1()
in glmmTMB
accepts two different forms of syntax (that I know of, there might be others):
ar1(time + 0 | group)
ar1(time - 1 | group)
Using one or the other produces the same outcome as far as I can tell, so why are different equivalent forms allowed and what do - 1
and + 0
stand for?
With regards to - 1
, Ben Bolker writes:
If we use
ar1(tt|f)
, withglmmTMB
we get a warning message (“AR1 not meaningful with intercept”). This is important; it made me aware of a similar mistake I was making previously with mylmer
hack below. Sincelme4
uses unstructured (i.e. general positive-definite) variance-covariance matrices by default, it normally doesn’t matter how you parameterize the contrasts for a categorical variable – the model fit/predictions are invariant to linear transformations. This is no longer true when we use structured variance-covariance matrices (!), so we need(tt-1|f)
rather than(tt|f)
…
This doesn't help me understand, probably because of my lack of understanding of the difference between structured and unstructured variance-covariance matrices. Here they explain:
in an unstructured covariance matrix there are no constraints. Each variance and each covariance is estimated uniquely from the data. As you can imagine, this results in the best possible model fit, because each variance and covariance values is very close to what the data reflect.
But that comes at a cost that may not be worth the improved fit. Estimating each one of those values can use up many degrees of freedom.
I guess the follow-up question is "in which way are structured variance-covariance matrices structured?" Besides, I thought that the whole point of assuming an order-1 autoregressive structure in the data was to assume that residuals were autocorrelated in a fixed way (reference). Doesn't assuming an order-1 autoregressive structure in the data lead to a structured variance-covariance matrix in any case?