Skip to contents

\(\ell^{\ast}(\boldsymbol{\rho}) =\ell(\boldsymbol{\psi}(\boldsymbol{\rho}),\hat c,\hat\phi)\), with the scales recomputed in closed form at every composition (see single_cell_nuisance_scales()). By the envelope theorem its score is the score of loglik_single_cell() at those scales, mapped by \(\mathbf{J}_{\psi}^{\top}\). Its Hessian is the Schur complement of the observed Hessian in \((\boldsymbol{p},c,\phi)\), mapped by the second-order chain rule.

The profile objective returns -Inf where a closed-form scale is not positive, so the trust-region driver rejects that trial point.

Usage

profile_loglik_single_cell_ilr(z, y, mean_signature_matrix, Sigma, V = NULL)

gradient_profile_loglik_single_cell_ilr(
  z,
  y,
  mean_signature_matrix,
  Sigma,
  V = NULL
)

hessian_profile_loglik_single_cell_ilr(
  z,
  y,
  mean_signature_matrix,
  Sigma,
  V = NULL
)

Arguments

z

ILR coordinate of length \(J-1\).

y

Bulk vector of length \(G\).

mean_signature_matrix

Reference mean, \(G\times J\).

Sigma

Cell-level covariances, \(G\times G\times J\).

V

Optional ILR basis. See isometric_logistic().

Value

profile_loglik_single_cell_ilr(): scalar. gradient_profile_loglik_single_cell_ilr(): vector of length \(J-1\). hessian_profile_loglik_single_cell_ilr(): symmetric \((J-1)\times(J-1)\) matrix.