Skip to contents

Profiles the two technical scales out. Without fixed, this is deconvolute_single_cell(). With fixed, the free block is an ILR chart of the remaining face, so a coordinate can be held at zero, and it is fitted by Newton-Raphson on the profile log-likelihood with the PORT trust region of stats::nlminb(), as restricted_mle_decovart().

Usage

restricted_mle_single_cell(
  y,
  mean_signature_matrix,
  Sigma,
  fixed = NULL,
  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\).

fixed

Named ratios held fixed, as in restricted_mle_decovart().

epsilon

Relative function and step tolerances passed to stats::nlminb().

itmax

Maximum number of iterations.

Value

A list with coefficients (the fitted composition), loglik, fixed and convergence.

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(0.7, 0.3)) + c(0.3, -0.2, 0.1, -0.1)
restricted_mle_single_cell(y, mu, sigma, fixed = c(ct2 = 0.3))$loglik
#> [1] 4.567453