
Obtain posterior probability of being a signal
Source:R/pvEBayes_object_S3_methods.R
get_posterior_prob.RdObtain posterior probability of being a signal
Arguments
- obj
a
pvEBayesobject, which is the output of the function pvEBayes or pvEBayes_tune.- cutoff_signal
numeric. Threshold for signal detection. An AE-drug combination is classified as a detected signal if its 5th posterior percentile exceeds this threshold.
Examples
fit <- pvEBayes(
contin_table = statin2025_44, model = "general-gamma",
alpha = 0.3, n_posterior_draws = 1000
)
#> ℹ Fitting general-gamma model...
#> ✔ Fitting general-gamma model... [214ms]
#>
#> ℹ Generating 1000 posterior draws...
#> ✔ Generating 1000 posterior draws... [35ms]
#>
#> Object of class 'pvEBayes'
#>
#> General-gamma model with hyperparameter alpha = 0.3.
#> Estimated prior is a mixture of 18 gamma distributions.
#>
#> Running time of the general-gamma model fitting: 0.2213 seconds.
#> Optimizer convergence: successful.
#> Running time for posterior draws
#> (1000 signal strength posterior draws per AE-drug pair):0.0425 seconds.
#>
#> Extract estimated prior parameters, discovered signals
#> and signal strength posterior draws using `summary()`.
posterior_probs <- get_posterior_prob(fit,
cutoff_signal = 1.001)