Learn R Programming

NORTARA (version 1.0.0)

check_input_cormat: Test the input correlation matrix weather it is in the feasible bounds.

Description

The function uses the lower and upper correlation bounds from results of the function valid_input_cormat to test the users' input correlation matrix.

Usage

check_input_cormat(invcdfnames, paramslists, cor_matrix)

Arguments

invcdfnames
A character sequence of the marginals' inverse cdf names.
paramslists
A list contains lists of params of the marginals as the same order as invcdfnames.
cor_matrix
The input correlation matrix to be checked.

Value

If all the elements of the input correlation matrix all in the bounds the function will return TRUE, otherwise it will print messages about the out of bounds elements' positions and then give an error message to users.

Details

The function uses the lower and upper correlation bounds from results of the function valid_input_cormat to test the users' input correlation matrix. If all the elements in the input correlation matrix are in the bounds, the function will return TRUE, otherwise it will print out the elements' positions in the input correlation matrix which are out of the lower and upper bounds.

See Also

BoundingRA, valid_input_cormat, genNORTARA

Examples

Run this code
## Not run: 
# invcdfnames <- c("qt","qpois","qnorm")
# paramslists <- list(
#                m1 = list(df = 3),
#                m2 = list(lambda = 5),
#                m3 = list(mean = 0, sd = 1)
#                  )
# cor_matrix_correct <- matrix(c(1,0.5,-0.3,0.5,1,0.4,-0.3,0.4,1), 3)
# cor_matrix_wrong <- matrix(c(1,0.94,-0.3,0.94,1,0.4,-0.3,0.4,1), 3)
# check_input_cormat(invcdfnames, paramslists, cor_matrix_correct)
# check_input_cormat(invcdfnames, paramslists, cor_matrix_wrong)
# ## End(Not run)

Run the code above in your browser using DataLab