Learn R Programming

copula (version 0.999-7)

p2P: Convert (Rho) Matrices to and From Parameter Vectors

Description

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 $d \times d$ symmetric matrix $\Sigma$ which is called Rho as well, written (capital Greek $\rho$ !) as $P$ (and hence sometimes erronously pronounced "Pee"). Note that getSigma() works for all elliptical copulas and uses p2P() for the unstuctured case, dispstr = "un".

Usage

p2P(param, d)
P2p(P)
getSigma(copula)

Arguments

param
a parameter vector.
d
dimension of the resulting matrix.
P
matrix which should be converted to a vector.
copula
an elliptical copula, i.e., an object (extending) class ellipCopula; typically resulting from tCopula() or n

Value

  • [object Object],[object Object],[object Object]

Details

These auxiliary functions are often used when working with elliptical copulas.

See Also

ellipCopula, tCopula, normalCopula.

Examples

Run this code
## display the definitions
p2P
P2p

param <- (2:7)/10
tC <- tCopula(param, dim = 4, dispstr="un", df = 3)
## consistency of the three functions :
P <- p2P(param, d=4)
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))))

Run the code above in your browser using DataLab