Skip to contents

Compares 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().

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)