R/quasiJacIndep.R

Defines functions quasiJacIndep

Documented in quasiJacIndep

#' The jacobian for column offset estimation
#' @inheritParams quasiScoreIndep
#' @return the jacobian matrix
quasiJacIndep = function(x, data, otherMargin, meanVarTrend, col, libSizes,...){
    mu = exp(buildMuMargins(x = x, otherMargin = otherMargin, col = col))
    if(anyNA(mu)){
        return(rep(1e16, length(x)))
    }
    tmp = diag((if(col) colSums else rowSums)(prepareJacMat(data = data, mu = mu,
                               meanVarTrend = meanVarTrend,
                               CompMat = exp(if(col) x else otherMargin),
                               libSizes = libSizes, ...), na.rm  = TRUE))
    tmp
  }

Try the combi package in your browser

Any scripts or data that you put into this service are public.

combi documentation built on Nov. 8, 2020, 5:34 p.m.