rasti matus
2008-Nov-10 10:41 UTC
[R] Copula package: How to calculate correlation matrix using 144 variables to denote parameters for normal copula?
Dears,
I calculated correlation matrix using 144 variables with a given function:
cor_flows_vec=cor()
Then I defined a normal copula with the above correlation matrix
myCop=normalCopula(param=cor_flows_vec, dim = 144, dispstr = "un")
Then I created a multivariate distribution with our defined copula while the
univariete functions were fitted by GEV distribution using fExtremes package
library(fExtremes)
paramMargin=function(d){
n=length(d[1,])
param=c(1:n)
for (i in seq(1:n)){
param[i]= list(list(xi=d[1,i], mu=d[2,i], beta=d[3,i]))
}
return(param)
}
paramMargins=paramMargin(d)
myMvd <- mvdc(copula=myCop,
margins=c(rep("gev",144)),paramMargins=paramMargins)
The problem occures when I am trying to sample from the mvdc regarding
correlation matrix.
rmvdc(myMvd, 3)
Cam anyone help? Thanks
[[alternative HTML version deleted]]