Hi there,
I’m building a mixed effects model, where each simulated observation of an individual will be grouped by a “method” by which the response was simulated (input data are simulated, not observed).
Model specification is:
AAC ~ Days + (Days | method)
AAC is the ratio of a thermal power plant’s operational capacity (how much power did they generate in a day?) divided by the nameplate capacity (how much are they capable of generating?). Simulated observations are daily AAC for each power plant. For this toy experiment, assume there are only two days, which are consecutive.
In rstanarm, this looks like:
b <- stan_glmer(
AAC ~ Days + (Days | method),
family = gaussian(),
data = all_test,
prior = normal(0, 1, autoscale = TRUE),
prior_intercept = normal(0, 1, autoscale = TRUE),
prior_covariance = decov(regularization = 2),
prior_aux = cauchy(0, 1, autoscale = TRUE),
cores = 4,
iter = 2000,
# reproducible blogging
seed = 8675309
)
The challenge I’m confronted with is that the family of the distribution shouldn’t really be gaussian – I just modeled it like this to throw together a first model. I’d like to specify it like this with inverse gaussian, but executing this code does nothing – it doesn’t even execute:
b <- stan_glmer(
AAC ~ Days + (Days | method),
family = inverse.gaussian(),
data = all_test,
prior = normal(0, 1, autoscale = TRUE),
prior_intercept = normal(0, 1, autoscale = TRUE),
prior_covariance = decov(regularization = 2),
prior_aux = cauchy(0, 1, autoscale = TRUE),
cores = 4,
iter = 2000,
# reproducible blogging
seed = 8675309
)
Am I specifying the family correctly? I also tried defining a new response variable, log(AAC), but I see the same thing – model doesn’t execute. Plot shows partially pooled slopes (blue) with the data (black).