spi() is deprecated. Use hdi(method = "density") instead, which returns
the same interval. See hdi() for how the interval is computed.
Value
A data frame with following columns:
ParameterThe model parameter(s), ifxis a model-object. Ifxis a vector, this column is missing.CIThe probability of the credible interval.CI_low,CI_highThe lower and upper credible interval limits for the parameters.
References
Liu, Y., Gelman, A., & Zheng, T. (2015). Simulation-efficient shortest probability intervals. Statistics and Computing, 25(4), 809–819. https://doi.org/10.1007/s11222-015-9563-8
Examples
library(bayestestR)
posterior <- rnorm(1000)
# instead of spi(posterior), use:
hdi(posterior, method = "density")
#> 95% SPI: [-2.19, 1.93]
