View source: R/thresholding_algos.R
get_optimal_threshold | R Documentation |
Thresholds counts according to the Bayes-optimal decision boundary. When a covariate matrix is present, the decision boundary that is used is the mean of the Bayes-optimal decision boundaries across all examples.
get_optimal_threshold(
g_intercept,
g_perturbation,
g_fam,
pi,
covariate_matrix = NULL,
g_covariate_coefs = NULL,
g_offset = NULL
)
g_intercept |
intercept for gRNA model |
g_perturbation |
perturbation coefficient for gRNA model |
g_fam |
family object describing distribution of g |
pi |
probability of perturbation |
covariate_matrix |
(optional) matrix of technical covariates |
g_covariate_coefs |
(optional) coefficients corresponding to technical factors |
g_offset |
(optional) the offset vector |
an integer (0/1) vector of thresholded counts.
## Not run:
library(magrittr)
m_fam <- g_fam <- poisson() %>% augment_family_object()
m_intercept <- 2; m_perturbation <- -1; g_intercept <- -2; g_perturbation <- 1
pi <- 0.2; n <- 1000; B <- 500; alpha <- 0.95
m_offset <- g_offset <- NULL
bdy <- get_optimal_threshold(g_intercept, g_perturbation, g_fam, pi)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.