PoisBinOrd (version 1.4.1)

validation.corr: Validates the specified correlation matrix

Description

This function validates the specified correlation vector and/or matrix for appropriate dimension, symmetry, range, and positive definiteness. If both correlation matrix and correlation vector are supplied, it checks whether the matrix and vector are conformable.

Usage

validation.corr(n.P, n.B, n.O, corr.vec = NULL, corr.mat = NULL)

Arguments

n.P

Number of Poisson variables.

n.B

Number of binary variables.

n.O

Number of ordinal variables.

corr.vec

Vector of elements below the diagonal of correlation matrix ordered column-wise.

corr.mat

Specified correlation matrix.

Value

The function returns TRUE if no specification problem is encountered. Otherwise, it returns an error message.

See Also

correlation.limits, correlation.bound.check

Examples

Run this code
# NOT RUN {
n.P<-1
n.B<-1
n.O<-1
corr.vec=c(0.2,0.1,0.5)
validation.corr(n.P,n.B,n.O,corr.vec,corr.mat=NULL)

n.P<-2
n.B<-2
n.O<-2
corr.mat=matrix(0.5,6,6)
diag(corr.mat)=1
validation.corr(n.P,n.B,n.O,corr.vec=NULL,corr.mat)
# }

Run the code above in your browser using DataCamp Workspace