Skip to contents

Checks whether the matrix given is a valid Huesler-Reiss parameter matrix in the role of \(\Gamma\), \(\Theta\), or \(\Sigma\), 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 \(d \times d\) 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, \(\Gamma\), \(\Sigma\), or \(\Theta\).

k

NULL if the input/output matrix is \(\Sigma\)/\(\Theta\). Else, an integer between 1 and d indicating the value of k in \(\Sigma^k\), \(\Theta^k\).

full

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

matrixName

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

Theta

Numeric \(d \times d\) or \((d-1) \times (d-1)\) precision matrix.

Sigma

Numeric \(d \times d\) or \((d-1) \times (d-1)\) covariance matrix.

name

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

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.

Details

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

See also

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