Closed matschmitz closed 3 months ago
When using get_variance() from insight v0.20.3, the model unexpectedly recompiles, and the function returns NULL. This behavior differs from v0.20.1, where it correctly returns the variance components without recompiling the model.
get_variance()
insight
NULL
library(brms) library(insight) mdl <- brm(mpg ~ hp + (1 | cyl), data = mtcars) get_variance(mdl) # Model recompiles, returns NULL with v0.20.3 # Model recompiles # NULL get_variance(mdl) # Returns expected variance components with v0.20.1 # $var.fixed # [1] 4.90803 # # $var.random # [1] 22.64787 # # $var.residual # [1] 10.82719 # # $var.distribution # [1] 10.82719 # # $var.dispersion # [1] 0 # # $var.intercept # cyl # 22.64787
However, when using a model fitted with lme4::lmer, get_variance() returns the expected output, even in v0.20.3:
lme4::lmer
library(lme4) library(insight) mdl <- lmer(mpg ~ hp + (1 | cyl), data = mtcars) get_variance(mdl) # Returns expected variance components with v0.20.1 # $var.fixed # [1] 4.363142 # # $var.random # [1] 16.18444 # # $var.residual # [1] 9.917004 # # $var.distribution # [1] 9.917004 # # $var.dispersion # [1] 0 # # $var.intercept # cyl # 16.18444
### Tasks
When using
get_variance()
frominsight
v0.20.3, the model unexpectedly recompiles, and the function returnsNULL
. This behavior differs from v0.20.1, where it correctly returns the variance components without recompiling the model.However, when using a model fitted with
lme4::lmer
,get_variance()
returns the expected output, even in v0.20.3: