R/mc_core_pearson.R

Defines functions mc_core_pearson

Documented in mc_core_pearson

#' @title Core of the Pearson estimating function.
#' @author Wagner Hugo Bonat
#'
#' @description Core of the Pearson estimating function.
#'
#' @param product A matrix.
#' @param inv_C A matrix.
#' @param res A vector of residuals.
#' @param W Matrix of weights.
#' @return A vector
#' @keywords internal
#' @details It is an internal function.

mc_core_pearson <- function(product, inv_C, res, W) {
    product <- product %*% W
    output <- t(res) %*% product %*%
        (inv_C %*% res) - sum(diag(product))
    return(as.numeric(output))
}
wbonat/mcglm documentation built on June 23, 2020, 11:06 a.m.