fgmCopula | R Documentation |
Constructs a multivariate multiparameter Farlie-Gumbel-Morgenstern copula class object with its corresponding parameters and dimension.
fgmCopula(param, dim = 2)
param |
a numeric vector specifying the parameter values. |
dim |
the dimension of the copula. |
A Farlie-Gumbel-Morgenstern copula object of class
"fgmCopula"
.
Note that a d
-dimensional fgmCopula
must have
npar
= 2^d - d - 1
parameters.
The verification of the validity of the parameter values is of high
complexity and may not work for high dimensional copulas.
The random number generation needs to be properly tested, especially for dimensions higher than 2.
Nelsen, R. B. (2006), An introduction to Copulas, Springer, New York.
Copula
, copula-class
,
fitCopula
.
## length(param) = #{parameters} for d-dimensional FGM copula:
d <- 2:10; rbind(d, npar = 2^d - d - 1)
## d 2 3 4 5 6 7 8 9 10
## npar 1 4 11 26 57 120 247 502 1013
## a bivariate example
fgm.cop <- fgmCopula(1)
x <- rCopula(1000, fgm.cop)
cor(x, method = "kendall")
tau(fgm.cop)
cor(x, method = "spearman")
rho(fgm.cop)
persp (fgm.cop, dCopula)
contour(fgm.cop, dCopula)
## a trivariate example with wrong parameter values
try(
fgm2.cop <- fgmCopula(c(1,1,1,1), dim = 3)
) # Error: "Bad vector of parameters"
## a trivariate example with satisfactory parameter values
fgm2.cop <- fgmCopula(c(.2,-.2,-.4,.6), dim = 3)
fgm2.cop
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.