tcopula-无法从多元分布中生成有效的随机数

时间:2018-08-31 18:35:40

标签: r

我正在使用copula包,为了估计多元分布,我使用了tcopula来链接边际。但是,来自多元分布的随机生成器会返回废话。

library("forecast")
library("copula")
library("MASS")
library("LaplacesDemon")
lpm <- list()
for (i in 1:11) {
  pm <- fitdistr(na.omit(RVV[,i]), densfun = "t")$estimate
  lpm[[i]] <- list(mu = pm[1], tau = pm[2], nu = pm[3])
}
t.cop <- tCopula(param = cor(RVV)[,1][-1], dim = 11, dispstr = "toep",
                 df = 4, df.fixed = TRUE)
t.cop2 <- fitCopula(t.cop, pobs(RVV))@copula
mvdc1 <- mvdc(t.cop2, margins = c("stp","stp","stp","stp","stp","stp","stp","stp","stp","stp","stp"),
              paramMargins = lpm )
rvv <- rMvdc(252, mvdc1)

rvv包含生成的随机数。

data used, "RVV"

0 个答案:

没有答案