要形成一个混合Copula模型,您可以使用R.
这是给你的:
MixCop <- mixCopula(list(frankCopula(9,dim=3), claytonCopula(4, dim=3))) ## form the model
CopD <- rCopula(300, MixCop) ## generate the data
Res <- fitCopula(CopD) ## estimate the model
based on your updated question:
library(copula)
### Input three-dimension data :
x1 <- rnorm(n=1000,mean = 0.5,sd = 0.1)
x2 <- rlnorm(n = 1000,meanlog = 0.5,sdlog = 0.01)
x3 <- runif(n = 1000,min = 0.2,max = 0.8)
data <- cbind(x1, x2,x3)
Copdat <- pobs(data)## transform the data to copula data
### mixture copula type: clayton + gumbel + frank copula (or + normal copula \ t copula)
###for example:
copula1 <- mixCopula(list( claytonCopula (param = 1.3,dim = 3),
frankCopula (param = 2.718,dim = 3),
gumbelCopula (param = 4.58,dim = 3)))
cop <- fitCopula(copula1, Copdat)
结果是:
> cop <- fitCopula(copula1, Copdat)
Warning messages:
1: In .local(copula, tau, ...) :
For the Gumbel copula, tau must be >= 0. Replacing negative values by 0.
2: In fitCopula.ml(copula, u = data, method = method, start = start, :
var.mpl(copula, u) failed: system is computationally singular: reciprocal condition number = 6.5821e-29
> cop
Call: fitCopula(copula1, data = Copdat)
Fit based on "maximum pseudo-likelihood" and 1000 3-dimensional observations.
Copula: mixExplicitCopula
m1.alpha m2.alpha m3.alpha w1 w2 w3
3.893e+00 8.883e-01 1.000e+00 5.682e-14 1.060e-10 1.000e+00
The maximized loglikelihood is -2.649e-06
Optimization converged
我建议您try 其他类型的Copula函数来处理您的数据.
希望这能有所帮助