Closed strengejacke closed 1 year ago
library(rstanarm)
d <- data.frame(
y = c(
7, 38, 6, 11, 0, 8, 6, 5, 28, 2, 32, 14,
46, 19, 20, 28, 51, 12, 10, 1, 2, 22
),
x = c(
46, 41, 30, 30, 61, 42, 63, 13, 52, 59, 42, 45,
55, 47, 36, 48, 70, 67, 50, 34, 72, 46
)
)
m <- stan_glm(y ~ x, data = d)
bayestestR::describe_posterior(m)
#> Summary of Posterior Distribution
#>
#> Parameter | Median | 95% CI | pd | ROPE | % in ROPE | Rhat | ESS
#> ---------------------------------------------------------------------------------------------
#> (Intercept) | 9.00 | [-15.60, 33.02] | 77.55% | [-1.48, 1.48] | 7.29% | 1.000 | 3213.00
#> x | 0.16 | [ -0.32, 0.66] | 76.02% | [-1.48, 1.48] | 100% | 1.000 | 3240.00
Created on 2023-03-14 with reprex v2.0.2
What was this doing before?
It was working several months ago, but then Vincent and I came up with a performance improvement by converting model objects to data frames only once (https://github.com/easystats/bayestestR/pull/532). However, in .describe_posterior()
, instead of model objects, a data frame of posteriors was passed to every function (like pd()
, rope()
etc.). This works well in most situations, except when you want to define the rope range. This PR fixes this issue
errors seem unrelated
Fixes #587