R/rhoMatrix-vechsrhocap-check-dot.R

Defines functions .check_vechsrhocap

#' Sanity Check for the Strict Half-Vectorization
#' of the Correlation Matrix
#'
#' @author Ivan Jacob Agaloos Pesigan
#'
#' @param x Numeric vector.
#'   Strict half-vectorization of the covariance matrix.
#' @param return_k Logical.
#'   Return the dimension of the covariance matrix.
#' @family Correlation Functions
#' @keywords rhoMatrix correlation check
#' @noRd
.check_vechsrhocap <- function(x,
                               return_k = FALSE) {
  k <- .check_vechs(
    x = x,
    diags = NULL,
    return_k = TRUE
  )
  stopifnot(
    all(
      abs(x) <= 1
    )
  )
  if (return_k) {
    return(k)
  }
}
jeksterslab/rhoMatrix documentation built on Dec. 20, 2021, 10:11 p.m.