powered by
These functions check whether the input fulfills the properties of a covariance matrix.
check_covariance_matrix(x, dim = NULL, tolerance = sqrt(.Machine$double.eps))assert_covariance_matrix( x, dim = NULL, tolerance = sqrt(.Machine$double.eps), .var.name = checkmate::vname(x), add = NULL )test_covariance_matrix(x, dim = NULL, tolerance = sqrt(.Machine$double.eps))
assert_covariance_matrix( x, dim = NULL, tolerance = sqrt(.Machine$double.eps), .var.name = checkmate::vname(x), add = NULL )
test_covariance_matrix(x, dim = NULL, tolerance = sqrt(.Machine$double.eps))
Same as documented in check_matrix.
check_matrix
[any] Object to check.
[integer(1)] The matrix dimension.
integer(1)
[numeric(1)] A non-negative tolerance value.
numeric(1)
[character(1)] Name of the checked object to print in assertions. Defaults to the heuristic implemented in vname.
character(1)
vname
[AssertCollection] Collection to store assertion messages. See AssertCollection.
AssertCollection
Other matrix helpers: check_correlation_matrix(), check_transition_probability_matrix(), cov_to_chol(), diff_cov(), insert_matrix_column(), matrix_diagonal_indices(), matrix_indices(), sample_correlation_matrix(), sample_covariance_matrix(), sample_transition_probability_matrix(), stationary_distribution()
check_correlation_matrix()
check_transition_probability_matrix()
cov_to_chol()
diff_cov()
insert_matrix_column()
matrix_diagonal_indices()
matrix_indices()
sample_correlation_matrix()
sample_covariance_matrix()
sample_transition_probability_matrix()
stationary_distribution()
M <- matrix(c(1, 2, 3, 2, 1, 2, 3, 2, 1), nrow = 3) check_covariance_matrix(M) test_covariance_matrix(M) if (FALSE) { assert_covariance_matrix(M) }
Run the code above in your browser using DataLab