Closed matschmitz closed 2 weeks ago
Seems to be related to the new version. I'm running an earlier version (0.19.8) and I do get the same result in both cases (10.83026).
library(brms) # v2.21.0
library(insight) # v0.20.4.3
mdl <- brm(mpg ~ hp + (1 | cyl), data = mtcars, seed = 123)
VC <- VarCorr(mdl)
VC$residual__$sd[1, 1]^2 # Residual variance
#> [1] 10.83026
get_variance(mdl)$var.residual
#> [1] 10.83026
#> attr(,"class")
#> [1] "insight_aux" "numeric"
get_sigma(mdl)^2
#> [1] 10.83026
#> attr(,"class")
#> [1] "insight_aux" "numeric"
get_variance_residual(mdl)
#> var.residual
#> 10.83026
Created on 2024-11-05 with reprex v2.1.1
There seems to be a discrepancy between the residual variance calculated using
brms::VarCorr()
andinsight::get_variance_residual()
for a brms model. Apologies if I'm missing something obvious.