R/mc_core_cross_variability.R

Defines functions covprod

Documented in covprod

#' @title Cross variability matrix
#' @author Wagner Hugo Bonat
#'
#' @description Compute the cross-covariance matrix between covariance
#'     and regression parameters.  Equation (11) of Bonat and Jorgensen
#'     (2016).
#'
#' @param A A matrix.
#' @param res A vector of residuals.
#' @param W A matrix of weights.
#' @return Return a matrix.
#' @keywords internal

covprod <- function(A, res, W) {
    res <- as.numeric(res)
    saida <- (res %*% W %*% res) %*% (t(res) %*% A)
    return(as.numeric(saida))
}

Try the mcglm package in your browser

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

mcglm documentation built on Sept. 16, 2022, 1:06 a.m.