Skip to contents

Returns \(\ell^{\mathrm{prof}}_j(c)=\max\{\ell(\boldsymbol{p}): \boldsymbol{p}\in\Delta^{J-1},\,p_j=c\}\), i.e. the restricted maximum of restricted_mle_decovart() for a single coordinate. Profiling concentrates out the remaining \(J-2\) free proportions instead of relying on a quadratic (Wald) approximation, so it is reliable even when \(\hat{p}_j\) sits close to a simplex face.

Usage

profile_loglik_decovart(
  y,
  mean_signature_matrix,
  Sigma,
  celltype,
  value,
  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}\).

celltype

Cell-type name or integer index \(j\).

value

Numeric vector of candidate ratios \(c\in[0,1]\).

epsilon, itmax

Relative convergence tolerance and iteration budget passed to stats::optim().

Value

Numeric vector of profile log-likelihoods, named by value.

Examples

mu <- matrix(c(20, 22, 18, 22, 20, 24), nrow = 2)
colnames(mu) <- paste0("ct", 1:3)
Sigma <- array(c(diag(2), diag(2), diag(2)), dim = c(2, 2, 3))
y <- drop(mu %*% c(0.5, 0.3, 0.2))
profile_loglik_decovart(y, mu, Sigma, "ct3", c(0, 0.2, 0.4))
#>       0.0       0.2       0.4 
#> 0.4623643 0.9941606 0.8435155