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

Description Usage Arguments Details Value Note See Also Examples

View source: R/check_input_cormat.R

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

1
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.

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.

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.

Note

Because of the random samples, the results of the function may be a little different each time.

See Also

BoundingRA, valid_input_cormat, genNORTARA

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## 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)

NORTARA documentation built on May 2, 2019, 3 p.m.