Profile-likelihood confidence intervals for cellular ratios
Source:R/03_06_decovart_inference.R
confint_profile_decovart.RdInverts the likelihood-ratio test of lrt_decovart() coordinate by
coordinate: the interval collects every \(c\) with
\(2\{\ell(\hat{\boldsymbol{p}})-\ell^{\mathrm{prof}}_j(c)\}
\le\chi^{2}_{1,1-\alpha}\). Because likelihood ratios are invariant
under reparametrisation, the interval respects
\(0\le p_j\le 1\) without the delta-method linearisation that makes
Wald intervals unreliable near a simplex face.
Usage
confint_profile_decovart(
y = NULL,
mean_signature_matrix,
Sigma,
bulk_expression = NULL,
level = 0.95,
celltypes = NULL,
epsilon = 10^-8,
itmax = 500L
)Arguments
- y
Numeric vector (or one-column matrix) \(\boldsymbol{y}\in\mathbb{R}^{G}\).
- 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}\).
- bulk_expression
Numeric matrix \(\boldsymbol{Y}\in \mathcal{M}_{G\times N}\) of replicate bulk profiles sharing one composition, used instead of
yfor the pooled (population) test.- level
Confidence level \(1-\alpha\).
- celltypes
Cell types to profile; defaults to all.
- epsilon, itmax
Relative convergence tolerance and iteration budget passed to
stats::optim().
See also
confint.decovart_fit() for the Wald analogue,
lrt_decovart()
Other decovart_inference:
bootstrap_decovart(),
boundary_diagnostics(),
chi_bar_square_pvalue(),
equivariance_check_decovart(),
lrt_decovart(),
multistart_decovart(),
profile_loglik_decovart(),
reference_bootstrap_decovart(),
restricted_mle_decovart()
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_profile_decovart(y, mu, Sigma)
#> estimate lower upper
#> ct1 0.599338 0.5530429 0.6473202
#> ct2 0.400662 0.3526798 0.4469571