These functions check whether the input is a transition probability matrix.
check_transition_probability_matrix(
x,
dim = NULL,
tolerance = sqrt(.Machine$double.eps)
)assert_transition_probability_matrix(
x,
dim = NULL,
tolerance = sqrt(.Machine$double.eps),
.var.name = checkmate::vname(x),
add = NULL
)
test_transition_probability_matrix(
x,
dim = NULL,
tolerance = sqrt(.Machine$double.eps)
)
Same as documented in check_matrix
.
[any]
Object to check.
[integer(1)
]
The matrix dimension.
[numeric(1)
]
A non-negative tolerance value.
[character(1)
]
Name of the checked object to print in assertions. Defaults to
the heuristic implemented in vname
.
[AssertCollection
]
Collection to store assertion messages. See AssertCollection
.
Other matrix helpers:
check_correlation_matrix()
,
check_covariance_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()
T <- matrix(c(0.8, 0.2, 0.1, 0.1, 0.7, 0.4, 0.1, 0.1, 0.6), nrow = 3)
check_transition_probability_matrix(T)
test_transition_probability_matrix(T)
if (FALSE) {
assert_transition_probability_matrix(T)
}
Run the code above in your browser using DataLab