Description Usage Arguments Value Examples
These functions reorder a vine according to a user-specified order.
reordervarray
reorders a vine array only, whereas
reorder.rvine
reorders an "rvine" object.
1 2 3 4 | reordervarray(G, ord)
## S3 method for class 'rvine'
reorder(rv, ord)
|
G |
Vine array matrix |
ord |
Vector consisting of the variables in |
rv |
Object of type "rvine" |
Returns NULL
if the vine cannot be re-ordered in the
requested manner. Otherwise, the re-ordered vine array (reordervarray
)
or "rvine" object (reorder.rvine
) is returned.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | ## reordervarray:
G <- AtoG(CopulaModel::Dvinearray(5))
reordervarray(G, 5:1)
reordervarray(truncvarray(G, c(0, 1, 2, 1, 3)), c(3, 2, 4, 1, 5))
reordervarray(G, c(5, 1, 4, 2, 3)) # NULL
reordervarray(G, c(5:1, 87)) # Error
## reorder.rvine:
copmat <- makevinemat("a", c("b","c"), letters[4:6], letters[7:10], zerocol=T)
cparmat <- makevinemat(1, 2:3, 4:6, 7:10, zerocol=T)
rv <- rvine(G, copmat, cparmat)
reorder(rv, 5:1)
reorder(rv, c(3, 2, 4, 1, 5))
reorder(rv, c(5, 1, 4, 2, 3)) # NULL
reorder(rv, c(5:1, 87)) # Error
## Trivial cases:
reordervarray(matrix(0,1,0), integer(0))
reorder(rvine(matrix(5)), 5)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.