After implementing glmmVA() and a VA-logit formulation, I have repeated the simulations by Ormerod and Wand (2012) to compare performance of our implementation against their GVA with adaptive-GH quadrature.
There are 3 sets of simulations, each with 2 trials that determine the cluster size of the random intercept. The following figure warranted investigation of our implementation:
As is clear in set 2 and set 3 (the logistic model), our implementation severely underestimates the standard deviation of the random effect. Note,the VA implementation of Ormerod and Wand, which combines logistic regression with AGH-quadrature, does not have same issue.
This is something I have encountered before in probit models in gllvm (diagnosed as estimated LVs taking very small values), but attributed in the usual "VA underestimates variance" way. However, since Ormerod & Wand's GVA implementation does not have the same issue, something else entirely seems to be going on.
The following application to simulated data from set 3 trial 1 (with true parameters beta0 = 0, beta1 = 5, sigma = sqrt(1.5), 15 levels in the random effect and 8 data points per level) demonstrates the issue further:
data.csv
glmmVA.fit <- glmmVA(formula=vy~vx + (1|id), data = data, family = binomial)
glmmEVA.fit <- glmmVA(formula=vy~vx + (1|id), data = data, family = binomial, method = "EVA")
glmmLA.fit <- glmmVA(formula=vy~vx + (1|id), data = data, family = binomial, method = "LA")
where glmmVA.fit produces a very different result to EVA and LA. The model produces the following likelihood profile (which looks slightly different depending on the numerical details of the implementation):
plot(TMB::tmbprofile(glmmVA.fit$TMBfn, "log_sigma"))
Clearly, negative values for log(sigma) receive a better negative log-likelihood. In contrast to EVA and LA on the same data, the VA objective does not seem to have a unique minimum for sigma. This seems odd, given that EVA is supposed to be a less accurate version of VA.
par(mfrow=c(1,2))
plot(TMB::tmbprofile(glmmEVA.fit$TMBfn,"log_sigma", parm.range = c(-10,10)), main = "EVA")
plot(TMB::tmbprofile(glmmLA.fit$TMBfn,"log_sigma", parm.range = c(-10,10)), main = "LA")
Investigating this fit with tmbstan in the following manner, produces the following posterior for the log standard deviation:
library(tmbstan)
m <- tmbstan(glmmVA.fit$TMBfn, seed = 101, iter = 10e3)
hist(m@sim$samples[[1]]$log_sigma, col="transparent")
hist(m@sim$samples[[2]]$log_sigma, col="transparent", border = "blue", add = TRUE, lty = "dotted")
hist(m@sim$samples[[3]]$log_sigma, col="transparent", border = "red", add = TRUE, lty = "dotdash")
hist(m@sim$samples[[4]]$log_sigma, col="transparent", border = "orange", add = TRUE, lty = "longdash")
traceplot(m, "log_sigma")
So that it is clear the model formulation is not the issue: MCMC shows the posterior to be centered far away from zero, and it does not even have a mode at zero as one might expect. At this point, it is not clear to me what is going on, or how to fix it.
After implementing glmmVA() and a VA-logit formulation, I have repeated the simulations by Ormerod and Wand (2012) to compare performance of our implementation against their GVA with adaptive-GH quadrature.
There are 3 sets of simulations, each with 2 trials that determine the cluster size of the random intercept. The following figure warranted investigation of our implementation:
As is clear in set 2 and set 3 (the logistic model), our implementation severely underestimates the standard deviation of the random effect. Note,the VA implementation of Ormerod and Wand, which combines logistic regression with AGH-quadrature, does not have same issue.
This is something I have encountered before in probit models in gllvm (diagnosed as estimated LVs taking very small values), but attributed in the usual "VA underestimates variance" way. However, since Ormerod & Wand's GVA implementation does not have the same issue, something else entirely seems to be going on.
The following application to simulated data from set 3 trial 1 (with true parameters beta0 = 0, beta1 = 5, sigma = sqrt(1.5), 15 levels in the random effect and 8 data points per level) demonstrates the issue further:
data.csv
where
glmmVA.fitproduces a very different result to EVA and LA. The model produces the following likelihood profile (which looks slightly different depending on the numerical details of the implementation):plot(TMB::tmbprofile(glmmVA.fit$TMBfn, "log_sigma"))Clearly, negative values for log(sigma) receive a better negative log-likelihood. In contrast to EVA and LA on the same data, the VA objective does not seem to have a unique minimum for sigma. This seems odd, given that EVA is supposed to be a less accurate version of VA.
Investigating this fit with
tmbstanin the following manner, produces the following posterior for the log standard deviation:So that it is clear the model formulation is not the issue: MCMC shows the posterior to be centered far away from zero, and it does not even have a mode at zero as one might expect. At this point, it is not clear to me what is going on, or how to fix it.