R/mk_fun.jacobian.R

Defines functions mk_fun.jacobian

Documented in mk_fun.jacobian

#' A function for newton update of m
#' This function calculate the jacobian matrix of the elbo with respect to m for it's kth element.
#' @param x kth element of m, variable of this function
#' @param iSig inverse matrices of the variance parameter for the latent Gaussian variable.
#' @param vsquare diagonal elements of the variational parameter V.
#' @param M sum of counts in K taxa for one observation.
#' @param xi variational parameter xi, vector of n.
#' @keywords jacobian
#' @export
#' @examples
#' mk_fun.jacobian()

mk_fun.jacobian <- function(x,iSig,vsquare,M,xi){
  return(-iSig-M*diag(exp(x+vsquare/2))/xi)
}
yuanfang90/LNMVGA documentation built on Jan. 29, 2024, 8:24 a.m.