This function estimates \(\pi_0\), the proportion of datasets that follow the null hypothesis,
using Bayes Factor (BF) control.
BF_control(BF, plot = FALSE)
Arguments
- BF
A numeric vector of Bayes Factors computed from `BF_compute()`.
- plot
A logical value. If TRUE
, generates diagnostic plots for BF control.
Value
A list containing:
- mu
Cumulative mean of sorted Bayes Factors.
- pi0_hat
Estimated \(\pi_0\) values for each BF threshold.
- pi0_hat_star
Final estimated \(\pi_0\) based on the first BF threshold where \(E(BF) \geq 1\).
Examples
set.seed(1)
BF_values <- runif(100, 0.5, 5) # Example Bayes Factors
BF_control_results <- BF_control(BF_values, plot = TRUE)
print(BF_control_results$pi0_hat_star)
#> [1] 0.15