Choose a confidence interval for a pooled DeCovarT composition
Source:R/03_01_interior_intervals.R
confint_decovart.RdOne entry point for the interior intervals of the population
convolution (covariance weights \(p_j^2\), no technical scales).
The default, method = "ilr", is confint_ilr_backtransform().
ilrWald interval for \(\boldsymbol{\rho}\), mapped by the inverse ILR chart.
waldDelta method on \(\boldsymbol{p}\). Endpoints can leave \([0,1]\).
firthWald interval at the Jeffreys-penalised estimate (
fit_firth_decovart()).interval_ilris the same estimate mapped through the inverse chart.profileLikelihood-ratio interval (
confint_profile_decovart()). This is the interior calibration. A null on a face islrt_decovart(), not an interval.bootstrapParametric percentile interval (
bootstrap_decovart()).referenceResample the reference, then refit (
reference_bootstrap_decovart()). Two or more donors in every cell type use the donor bootstrap and keep the bulk fixed. Otherwise columns are resampled within each cell type and the bulk is regenerated. Cell-type labels are not shuffled; that check isequivariance_check_decovart().
Columns of y share one composition. fit_decovart() instead
estimates a separate composition per column, and
confint.decovart_fit() is the per-column delta method.
Usage
confint_decovart(
y,
mean_signature_matrix = NULL,
Sigma = NULL,
method = c("ilr", "wald", "firth", "profile", "bootstrap", "reference"),
level = 0.95,
p = NULL,
n_draws = 2000L,
n_boot = 500L,
seed = NULL,
reference_profiles = NULL,
donor_ids = NULL,
resample = NULL,
regenerate_bulk = NULL,
...
)Arguments
- y
Numeric vector of length \(G\), or \(G\times N\) matrix of replicate bulk profiles that share one composition; their log-likelihoods are summed (the pooled, population-level fit).
- mean_signature_matrix
Numeric matrix \(\boldsymbol{\mu}\in\mathcal{M}_{G\times J}\) (plug-in means).
- Sigma
Array of cell-type covariances in \(\mathcal{M}_{G\times G\times J}\).
- method
Interval to compute. See Description.
- level
Confidence level.
- p
Composition at which to evaluate the information.
NULLuses the pooled maximum likelihood estimate.- n_draws
Monte Carlo size used when there are three or more cell types. Ignored for two cell types.
- n_boot
Bootstrap size for
method = "bootstrap"or"reference".- seed
Optional seed for the Monte Carlo map. The previous random-number state is restored.
NULLleaves the state unchanged and draws from the current stream.- reference_profiles, donor_ids
Passed to
reference_bootstrap_decovart()whenmethod = "reference".- resample
"donors"or"cells".NULLchooses fromdonor_idsas in Description.- regenerate_bulk
Whether the reference bootstrap redraws the bulk.
NULLfollows the automatic rule in Description.- ...
Passed to the selected method (
epsilon,itmax,celltypes,null_value,ridge,n_replicates).
See also
lrt_decovart(), confint_single_cell()
Other decovart_inference:
bootstrap_decovart(),
bootstrap_single_cell(),
boundary_diagnostics(),
chi_bar_square_pvalue(),
confint_ilr_backtransform(),
confint_profile_decovart(),
confint_profile_single_cell(),
confint_single_cell(),
equivariance_check_decovart(),
fit_firth_decovart(),
fit_firth_single_cell(),
lrt_decovart(),
lrt_single_cell(),
multistart_decovart(),
reference_bootstrap_decovart(),
reference_bootstrap_single_cell(),
restricted_mle_decovart(),
restricted_mle_single_cell()
Examples
mu <- matrix(c(20, 40, 15, 40, 20, 25), nrow = 3)
colnames(mu) <- paste0("ct", 1:2)
Sigma <- array(c(diag(3), diag(3)), dim = c(3, 3, 2))
y <- drop(mu %*% c(0.6, 0.4))
confint_decovart(y, mu, Sigma)$interval
#> 2.5% 97.5%
#> ct1 0.5514710 0.6453814
#> ct2 0.3546186 0.4485290
confint_decovart(y, mu, Sigma, method = "wald")$interval
#> 2.5% 97.5%
#> ct1 0.5522501 0.6464257
#> ct2 0.3535743 0.4477499