From 3222d2a8985be7d6e965092ee04b872c7994643a Mon Sep 17 00:00:00 2001 From: Walmes Zeviani <walmes@ufpr.br> Date: Thu, 7 Jan 2016 15:30:34 -0200 Subject: [PATCH] Add roxygen tags and tidy - Add @title, @name and @author. - Tidy the code and text. --- R/mc_auxiliar.R | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/R/mc_auxiliar.R b/R/mc_auxiliar.R index f59257a..10b6ee4 100644 --- a/R/mc_auxiliar.R +++ b/R/mc_auxiliar.R @@ -1,43 +1,47 @@ -#' Matrix product in sandwich form +#' @title Matrix product in sandwich form +#' @name mc_sandwich +#' @author Wagner Hugo Bonat #' -#' @description The function \code{mc_sandwich} is just an auxiliar function to compute product matrix -#' in the sandwich form bord1*middle*bord2. An special case appears when computing the derivative of -#' the covariance matrix with respect to the power parameter. Always the bord1 and bord2 should be -#' diagonal matrix. If it is not true, this product is too slow. +#' @description The function \code{mc_sandwich} is just an auxiliar +#' function to compute product matrix in the sandwich form +#' bord1*middle*bord2. An special case appears when computing the +#' derivative of the covariance matrix with respect to the power +#' parameter. Always the bord1 and bord2 should be diagonal +#' matrix. If it is not true, this product is too slow. #' #' @param middle A matrix. #' @param bord1 A matrix. #' @param bord2 A matrix. #' @return The matrix product bord1*middle*bord2. -## Auxiliar function to multiply matrices +## Auxiliar function to multiply matrices ------------------------------ mc_sandwich <- function(middle, bord1, bord2) { bord1 %*% middle %*% bord2 } -#' @rdname mc_sandwich +#' @rdname mc_sandwich ------------------------------------------------- mc_sandwich_negative <- function(middle, bord1, bord2) { -bord1 %*% middle %*% bord2 } -#' @rdname mc_sandwich +#' @rdname mc_sandwich ------------------------------------------------- mc_sandwich_power <- function(middle, bord1, bord2) { temp1 <- mc_sandwich(middle = middle, bord1 = bord1, bord2 = bord2) return(temp1 + t(temp1)) } -#' @rdname mc_sandwich +#' @rdname mc_sandwich ------------------------------------------------- mc_sandwich_cholesky <- function(bord1, middle, bord2) { p1 <- bord1 %*% middle %*% bord2 return(p1 + t(p1)) } -#' @rdname mc_sandwich +#' @rdname mc_sandwich ------------------------------------------------- mc_multiply <- function(bord1, bord2) { return(bord2 %*% bord1) } -#' @rdname mc_sandwich +#' @rdname mc_sandwich ------------------------------------------------- mc_multiply2 <- function(bord1, bord2) { return(bord1 %*% bord2) } -- GitLab