library(copula)
library(lcopula)
library(lattice)
library(latticeExtra)
library(RColorBrewer)
setwd("C:/Users/lenovo/Documents/")
data1<-read.table("_QVD_CN_75_Tc_480_series001.txt",header = TRUE,sep = "",skip = 4)
data2<-data1[rowSums(data1[,3:5]!=0)>0,]
data2
x11()
splom2(data2[,3:5])
u<-pobs(data2[,3:5])
x11()
splom2(u)
u2<-pobs(data2[,3:5],ties.method = "random")
splom2(u2)
#----------------2D
u<-pobs(data2[,3:4],ties.method = "random")
#because pc are based on base of 2
n.grid<-64
U<-seq(0,1,length.out = n.grid+1)
grid<-as.matrix(expand.grid(u1=U,u2=U))
val<-cbind(grid,z=C.n(grid,X=u))
#------------- rotated Gumbel
#fit the parameter
grotG<-rotCopula(gumbelCopula(),flip = c(TRUE,TRUE))
fit.rotG<-fitCopula(grotG,data = u)
评论10