checkGamma: HR parameter matrix checks

View source: R/input_checks.R

checkGammaR Documentation

HR parameter matrix checks

Description

Checks whether the matrix given is a valid Huesler-Reiss parameter matrix in the role of \eGamma, \eTheta, or \eSigma, respectively.

Usage

checkGamma(Gamma, alert = NULL, tol = get_small_tol(), returnBoolean = FALSE)

checkSigmaTheta(
  M,
  k,
  full,
  matrixName = "Sigma",
  tol = get_small_tol(),
  alert = NULL,
  returnBoolean = FALSE
)

checkTheta(
  Theta,
  k = NULL,
  full = FALSE,
  tol = get_small_tol(),
  alert = NULL,
  returnBoolean = FALSE
)

checkSigma(
  Sigma,
  k = NULL,
  full = FALSE,
  tol = get_small_tol(),
  alert = NULL,
  returnBoolean = FALSE
)

checkMatrix(
  M,
  name = c("Gamma", "Sigma", "Theta")[1],
  k = NULL,
  full = FALSE,
  tol = get_small_tol(),
  alert = NULL,
  returnBoolean = FALSE
)

is_valid_Gamma(M, tol = get_small_tol())

is_valid_Theta(Theta, k = NULL, full = FALSE, tol = get_small_tol())

is_valid_Sigma(Sigma, k = NULL, full = FALSE, tol = get_small_tol())

Arguments

Gamma

Numeric \dxd variogram matrix.

alert

Passed to get_alert_function: NULL or TRUE to read the option value, FALSE to return a dummy function, or a function that takes an arbitrary number of strings as arguments (e.g. stop()).

tol

Numeric scalar. Values below this are considered as zero, when zeros are required (e.g. row-sums).

returnBoolean

Logical scalar, set to TRUE to return a boolean instead of the (adjusted) input.

M

Numeric matrix, \eGamma, \eSigma, or \eTheta.

k

NULL if the input/output matrix is \eSigma/\eTheta. Else, an integer between 1 and d indicating the value of k in \eSigmaK, \eThetaK.

full

Logical. If TRUE and !is.null(k), the input/output matrix is a \dxd matrix with the kth row filled with zeros.

matrixName

Name of the matrix to be used in alerts/error messages.

Theta

Numeric \dxd or \d1xd1 precision matrix.

Sigma

Numeric \dxd or \d1xd1 covariance matrix.

name

Name of the input matrix, indicating which other function to call.

Details

The function ⁠is_valid_*⁠ are a wrapper around ⁠check*⁠, with arguments alert=FALSE and returnBoolean=TRUE.

Value

For ⁠check*⁠, the input matrix, passed through ensure_matrix_symmetry_and_truncate_zeros.

For ⁠is_valid_*⁠, a boolean indicating whether the input is a valid parameter matrix.

See Also

Other input validation functions: check_graph(), check_partial_matrix_and_graph(), ensure_matrix_symmetry()


graphicalExtremes documentation built on Nov. 14, 2023, 1:07 a.m.