Skip to content

separate variance-covariance matrix for each level of grouping variable

2 messages · Thomas Merkling, Ben Bolker

#
Thanks Ben for your reply,

I used:

glmmTMB(count ~ Trt + (0 + dummy(Trt, "0") + dummy(Trt, "0"):zAge |
patient) + (0 + dummy(Trt, "1") + dummy(Trt, "1"):zAge | patient), data =
epilepsy)

which gave me similar SDs for the random intercepts and slopes as the brms
output but the correlations were 1 and -1 (see below) which is quite
different from the brms output (0.56 and -0.84).
Given that the correlations were exactly 1 and -1, I'm wondering if it is
the exact same fit as brms (count ~ Trt + (zAge|gr(patient, by = Trt)),
data = epilepsy), or if something differs in how the covariances are
estimated ?

Thomas

Conditional model:
 Groups    Name                     Variance   Std.Dev.   Corr
 patient   dummy(Trt, "0")         57.57        7.588
           dummy(Trt, "0"):zAge    11.60        3.405   1.00
 patient.1 dummy(Trt, "1")        103.60     10.178
           dummy(Trt, "1"):zAge    38.37        6.194   -1.00
 Residual                                   32.21    5.676

  
  
#
The most obvious differences are that brms (a) imposes priors on all
parameters and (b) computes the point estimate by taking the posterior
mean (maybe median? I'm not sure) rather than the value with the highest
likelihood.

There are some good answers about MLE vs Bayesian answers here:

https://stats.stackexchange.com/questions/401349/maximum-likelihood-parameters-deviate-from-posterior-distributions/401356#401356

  To explore this further you could (1) try out the blme package, which
allows for priors (not necessarily the same as those used in brms
through) and finds MAP (maximum a posteriori) estimates; (2) look at the
likelihood profile for the confidence intervals, and/or their posterior
distributions, which should show you that they're very flat [in which
case it's easy to get a large difference between the MLE and the
posterior mean due to the combination of priors and mode vs mean])
On 2019-08-23 7:44 a.m., Thomas MERKLING wrote: