R/averageT.R

Defines functions averageT

Documented in averageT

#' @title Averages out the sufficient statistics T(y)
#' @description Takes a vector of values and returns the column average of their
#' sufficient statistic (determined by their class)
#' @param y vector of values
#' @return A vector with the average of the sufficient statistics
averageT <- function(y) {
  Ty <- sufficientT(y)
  if (is.null(dim(Ty))) {
    out <- mean(Ty)
  } else {
    out <- colMeans(Ty)
  }
}

Try the TruncExpFam package in your browser

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

TruncExpFam documentation built on April 11, 2025, 6:11 p.m.