tnagler / VineCopula

Statistical inference of vine copulas

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error in RVineMatrixCheck

dtmueller opened this issue · comments

RVineMatrixCheck does not function properly if the matrix entered is not upper or lower triangular:

RVM
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 1 0 0 0 0 0 0 0 0 0
[2,] 0 9 0 0 0 0 0 5 0 0
[3,] 0 0 10 0 0 0 6 6 0 0
[4,] 0 0 0 6 0 8 7 3 0 0
[5,] 0 0 0 0 2 6 10 9 0 0
[6,] 0 0 0 3 8 8 8 8 0 0
[7,] 0 0 4 4 4 7 7 4 0 0
[8,] 0 3 7 8 3 5 3 5 0 0
[9,] 4 4 3 7 7 2 4 10 4 0
[10,] 3 5 5 5 2 4 2 2 3 3

RVineMatrixCheck(RVM)
Error in A2[i, j] <- iorder[A[i, j]] : replacement has length zero

I think a single check if an upper/lower triangular matrix is entered should fix the problem. Nevertheless, a sufficiently intelligent user would know that this matrix can not be an R-vine matrix.

I added another error code (-4) for this case.