p2P()
creates a matrix
from a given
vector
of parameters. P2p()
creates a
numeric vector from a given matrix
,
currently useful for elliptical copulas.
getSigma()
returns the getSigma()
works for all elliptical copulas and uses
p2P()
for the “unstuctured” case, dispstr = "un"
.
extremePairs()
identifies pairs with the largest (or smallest
or both) entries in a symmetric matrix.
p2P(param, d = floor(1 + sqrt(2*length(param))))
P2p(P)
getSigma(copula)
extremePairs(x, n = 6, method = c("largest", "smallest", "both"),
use.names = FALSE)
a parameter vector.
dimension of the resulting matrix
. The default
is correct under the assumption (of p2P()
in general!) that
param
is the lower-triangular part of a correlation matrix
P
and hence corresponds to ellipCopula(.., dispstr
= "un")
.
a matrix
which should be converted to a vector.
an elliptical copula, i.e., an object (extending)
class '>ellipCopula
; typically resulting from
tCopula()
or normalCopula()
.
a symmetric matrix
.
the number of pairs with smallest (or largest) values to be displayed.
a character
string indicating the method
to be used (with "largest"
to comute the n
pairs with
largest entries in x
(sorted in decreasing order); with
"smallest"
to compute the n
pairs with smallest entries
in x
(sorted in increasing order); and with "both"
to
comute the 2n
pairs with n
largest entries and
n
smallest entries (sorted in decreasing order)).
A logical
indicating whether
colnames(x)
are used as labels (if !is.null(colnames(x))
).
p2P
:a symmetric matrix
with ones on the
diagonal and the values of param
filled column-wise below the
diagonal (which corresponds to row-wise filling above the diagonal).
P2p
:vector
of column-wise below-diagonal
entries of P
(equal to the row-wise above-diagonal entries in
case of a symmetric matrix).
getSigma
:matrix
as from p2P()
for all cases of elliptical copulas.
extremePairs
:a data.frame
consisting of three columns (row
(index or name), col
(index or name),
value
).
These auxiliary functions are often used when working with elliptical copulas.
# NOT RUN {
## display the definitions
p2P
P2p
extremePairs
param <- (2:7)/10
tC <- tCopula(param, dim = 4, dispstr = "un", df = 3)
## consistency of the three functions :
P <- p2P(param) # (using the default 'd')
stopifnot(identical(param, P2p(P)),
identical(P, getSigma(tC)))
## Toeplitz case:
(tCt <- tCopula((2:6)/10, dim = 6, disp = "toep"))
(rhoP <- tCt@getRho(tCt))
stopifnot(identical(getSigma (tCt),
toeplitz (c(1, rhoP))))
## "AR1" case:
nC.7 <- normalCopula(0.8, dim = 7, dispstr = "ar1")
(Sar1.7 <- getSigma(nC.7))
0.8^(0:(7-1)) # 1 0.8 0.64 0.512 ..
stopifnot(all.equal(Sar1.7, toeplitz(0.8^(0:(7-1)))))
# }
Run the code above in your browser using DataLab