Likelihood-ratio test for one single-cell composition
Source:R/03_04_single_cell_inference.R
lrt_single_cell.RdCompares the profiled maximum with the maximum on fixed
(passed as null_value). An interior null uses Wilks'
chi-square. A null on a face uses the chi-bar-square mixture of
chi_bar_square_pvalue(). The two technical scales are profiled
out under both hypotheses, so the degrees of freedom count
composition constraints only.
Usage
lrt_single_cell(
y,
mean_signature_matrix,
Sigma,
null_value,
n_boundary = NULL,
boundary_tol = 1e-06,
epsilon = 1e-08,
itmax = 100L
)Arguments
- y
Bulk vector of length \(G\).
- mean_signature_matrix
Reference mean, \(G\times J\).
- Sigma
Cell-level covariances, \(G\times G\times J\).
- null_value
Named hypothesised ratios.
- n_boundary, boundary_tol
As in
lrt_decovart().- epsilon
Relative function and step tolerances passed to
stats::nlminb().- itmax
Maximum number of iterations.
Value
A one-row data frame, as for lrt_decovart().
See also
confint_profile_single_cell(), lrt_decovart()
Other decovart_inference:
bootstrap_decovart(),
bootstrap_single_cell(),
boundary_diagnostics(),
chi_bar_square_pvalue(),
confint_decovart(),
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(),
multistart_decovart(),
reference_bootstrap_decovart(),
reference_bootstrap_single_cell(),
restricted_mle_decovart(),
restricted_mle_single_cell()
Examples
mu <- matrix(c(2, 0.2, 0.2, 2, 0.2, 3, 0.2, 3), nrow = 4)
colnames(mu) <- c("ct1", "ct2")
sigma <- array(rep(diag(0.05, 4), 2), c(4, 4, 2))
y <- 20 * drop(mu %*% c(1, 0)) + c(0.2, -0.1, 0.05, 0.05)
lrt_single_cell(y, mu, sigma, null_value = c(ct2 = 0))
#> statistic n_boundary df_interior p_value loglik_full loglik_null
#> ct2 0 1 0 0.5 8.127704 8.127704
#> calibration
#> ct2 chi-bar-square (Self-Liang)