diff --git a/.Rbuildignore b/.Rbuildignore
index 82cd8b483..aed852bd5 100644
--- a/.Rbuildignore
+++ b/.Rbuildignore
@@ -24,6 +24,7 @@ tests\^spelling
\.lintr$
^CRAN-SUBMISSION$
^data-raw$
+^tests/testthat/_snaps/.
^man/figures/JASP.
^man/figures/b.
diff --git a/DESCRIPTION b/DESCRIPTION
index b44c233d2..a1ffd3b0b 100644
--- a/DESCRIPTION
+++ b/DESCRIPTION
@@ -1,7 +1,7 @@
Type: Package
Package: bayestestR
Title: Understand and Describe Bayesian Models and Posterior Distributions
-Version: 0.15.1.2
+Version: 0.15.2
Authors@R:
c(person(given = "Dominique",
family = "Makowski",
diff --git a/NEWS.md b/NEWS.md
index 5f440d4eb..12b273646 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -5,6 +5,13 @@
* `describe_posterior()` no longer re-samples a model when computing
indices.
+* `describe_posterior()` calls tests only when needed. Before, there was a
+ minimal overhead by calling tests that were not requested.
+
+## Bug fixes
+
+* Fixed failing test for Mac OS.
+
# bayestestR 0.15.1
## Changes
diff --git a/R/describe_posterior.R b/R/describe_posterior.R
index 7a5bbc80b..30f24d3ab 100644
--- a/R/describe_posterior.R
+++ b/R/describe_posterior.R
@@ -1449,4 +1449,4 @@ describe_posterior.BFBayesFactor <- function(posterior,
)
return(is.character(test) && length(test) > 0L && any(need_rope %in% tolower(test)))
-}
\ No newline at end of file
+}
diff --git a/README.Rmd b/README.Rmd
index aef473de4..7be2b756c 100644
--- a/README.Rmd
+++ b/README.Rmd
@@ -24,7 +24,7 @@ knitr::opts_chunk$set(
)
```
-[](https://doi.org/10.21105/joss.01541) [](https://CRAN.R-project.org/package=bayestestR) [](https://lifecycle.r-lib.org/articles/stages.html)
+[](https://doi.org/10.21105/joss.01541)
***Become a Bayesian master you will***
@@ -95,14 +95,14 @@ In the Bayesian framework, parameters are estimated in a probabilistic fashion a
- [**Centrality**](https://easystats.github.io/bayestestR/articles/web_only/indicesEstimationComparison.html)
- `mean()`, `median()` or [`map_estimate()`](https://easystats.github.io/bayestestR/reference/map_estimate.html) for an estimation of the mode.
- [`point_estimate()`](https://easystats.github.io/bayestestR/reference/point_estimate.html) can be used to get them at once and can be run directly on models.
-
+
- [**Uncertainty**](https://easystats.github.io/bayestestR/articles/credible_interval.html)
- [`hdi()`](https://easystats.github.io/bayestestR/reference/hdi.html) for *Highest Density Intervals (HDI)*, [`spi()`](https://easystats.github.io/bayestestR/reference/spi.html) for *Shortest Probability Intervals (SPI)* or [`eti()`](https://easystats.github.io/bayestestR/reference/eti.html) for *Equal-Tailed Intervals (ETI)*.
- [`ci()`](https://easystats.github.io/bayestestR/reference/ci.html) can be used as a general method for Confidence and Credible Intervals (CI).
-
+
- [**Effect Existence**](https://easystats.github.io/bayestestR/articles/indicesExistenceComparison.html): whether an effect is different from 0.
- [`p_direction()`](https://easystats.github.io/bayestestR/reference/p_direction.html) for a Bayesian equivalent of the frequentist *p*-value (see [Makowski et al., 2019](https://doi.org/10.3389/fpsyg.2019.02767))
- - [`p_pointnull()`](https://easystats.github.io/bayestestR/reference/p_map.html) represents the odds of null hypothesis (*h0 = 0*) compared to the most likely hypothesis (the MAP).
+ - [`p_pointnull()`](https://easystats.github.io/bayestestR/reference/p_map.html) represents the odds of null hypothesis (*h0 = 0*) compared to the most likely hypothesis (the MAP).
- [`bf_pointnull()`](https://easystats.github.io/bayestestR/reference/bayesfactor_parameters.html) for a classic *Bayes Factor (BF)* assessing the likelihood of effect presence against its absence (*h0 = 0*).
- [**Effect Significance**](https://easystats.github.io/bayestestR/articles/indicesExistenceComparison.html): whether the effect size can be considered as non-negligible.
@@ -199,7 +199,7 @@ While the **median** and the **mean** are available through base R functions, [`
[`hdi()`](https://easystats.github.io/bayestestR/reference/hdi.html) computes the **Highest Density Interval (HDI)** of a posterior distribution, i.e., the interval which contains all points within the interval have a higher probability density than points outside the interval. The HDI can be used in the context of Bayesian posterior characterization as **Credible Interval (CI)**.
-Unlike equal-tailed intervals (see [`eti()`](https://easystats.github.io/bayestestR/reference/eti.html)) that typically exclude 2.5\% from each tail of the distribution, the HDI is *not* equal-tailed and therefore always includes the mode(s) of posterior distributions.
+Unlike equal-tailed intervals (see [`eti()`](https://easystats.github.io/bayestestR/reference/eti.html)) that typically exclude 2.5\% from each tail of the distribution, the HDI is *not* equal-tailed and therefore always includes the mode(s) of posterior distributions.
```{r message=FALSE, warning=FALSE}
posterior <- distribution_chisquared(10000, 4)
@@ -322,9 +322,9 @@ ggplot(dat4, aes(x = x, y = y, fill = fill)) +
### Bayes Factor
-[`bayesfactor_parameters()`](https://easystats.github.io/bayestestR/reference/bayesfactor_parameters.html) computes Bayes factors against the null (either a point or an interval), bases on prior and posterior samples of a single parameter. This Bayes factor indicates the degree by which the mass of the posterior distribution has shifted further away from or closer to the null value(s) (relative to the prior distribution), thus indicating if the null value has become less or more likely given the observed data.
+[`bayesfactor_parameters()`](https://easystats.github.io/bayestestR/reference/bayesfactor_parameters.html) computes Bayes factors against the null (either a point or an interval), bases on prior and posterior samples of a single parameter. This Bayes factor indicates the degree by which the mass of the posterior distribution has shifted further away from or closer to the null value(s) (relative to the prior distribution), thus indicating if the null value has become less or more likely given the observed data.
-When the null is an interval, the Bayes factor is computed by comparing the prior and posterior odds of the parameter falling within or outside the null; When the null is a point, a Savage-Dickey density ratio is computed, which is also an approximation of a Bayes factor comparing the marginal likelihoods of the model against a model in which the tested parameter has been restricted to the point null [@wagenmakers2010bayesian].
+When the null is an interval, the Bayes factor is computed by comparing the prior and posterior odds of the parameter falling within or outside the null; When the null is a point, a Savage-Dickey density ratio is computed, which is also an approximation of a Bayes factor comparing the marginal likelihoods of the model against a model in which the tested parameter has been restricted to the point null [@wagenmakers2010bayesian].
```{r message=FALSE, warning=FALSE}
diff --git a/README.md b/README.md
index d9abfc326..d50b93f19 100644
--- a/README.md
+++ b/README.md
@@ -2,8 +2,6 @@
# bayestestR
[](https://doi.org/10.21105/joss.01541)
-[](https://CRAN.R-project.org/package=bayestestR)
-[](https://lifecycle.r-lib.org/articles/stages.html)
***Become a Bayesian master you will***
@@ -46,9 +44,9 @@ badge](https://easystats.r-universe.dev/badges/bayestestR)](https://easystats.r-
The *bayestestR* package is available on CRAN, while its latest
development version is available on R-universe (from *rOpenSci*).
-| Type | Source | Command |
-|-------------|------------|------------------------------------------------------------------------------|
-| Release | CRAN | `install.packages("bayestestR")` |
+| Type | Source | Command |
+|----|----|----|
+| Release | CRAN | `install.packages("bayestestR")` |
| Development | R-universe | `install.packages("bayestestR", repos = "https://easystats.r-universe.dev")` |
Once you have downloaded the package, you can then load it using:
@@ -159,9 +157,9 @@ describe_posterior(
)
## Summary of Posterior Distribution
##
-## Parameter | Median | 95% CI | pd | ps
-## --------------------------------------------------
-## Posterior | -0.01 | [-1.98, 1.93] | 50.52% | 0.46
+## Parameter | Median | 95% CI | pd | ps
+## ----------------------------------------------------
+## Posterior | 3.05e-03 | [-1.92, 1.95] | 50.09% | 0.46
```
`describe_posterior()` works for many objects, including more complex
@@ -464,7 +462,7 @@ Compute the density of a given point of a distribution.
``` r
density_at(rnorm(1000, 1, 1), 1)
-## [1] 0.41
+## [1] 0.36
```
## Code of Conduct
@@ -477,7 +475,7 @@ By contributing to this project, you agree to abide by its terms.
# References