R/shiftedMean.R

Defines functions shiftedMean

Documented in shiftedMean

#' Shifted Mean Vector for Data Generation
#'
#' This function shifts a given mean vector. The function shifts 4/5 of each
#' block in m out of the total number of blocks. (Thulin)
#'
#' @param mean Original mean vector.
#' @param shift Amount to shift by.
#' @param m Number of blocks to experience shift.
#'
#' @return
#' @export
#'
#' @examples
shiftedMean <- function(mean, shift, m) {
  p <- length(mean)
  shiftVec <- c(rep(shift, 20), rep(0, 5))
  shiftVecXm <- rep(shiftVec, m)
  totalShiftVec <- c(shiftVecXm, rep(0, p - length(shiftVecXm)))
  mean + totalShiftVec
}
whitneyworley/HighDim2Means documentation built on Oct. 17, 2019, 9:40 p.m.