1

I am working with copulas and I am trying to select the best copula I want to use a goodness of fit test, but my code is giving me the same p-values for all the copulas, which is ceirtainly wrong. Here is my code:

dat <- read_excel("SMI.xlsx")
data <- cbind(dat[,2], dat[,3], dat[4])
dataNZ <- cbind(data[,1], data[,3])

#definition of copulas
#Normal copula
nc <- ellipCopula(family = "normal", param= 0.5, dim = 2, dispstr = "un")
#Gumbel-Hougaard copula
gc <- gumbelCopula(dim = 2, param = 1.1)

#GOF tests
gofmplnNZ <- gofCopula(nc, u, estim.method= "mpl")
gofmplgNZ <- gofCopula(gc, u, estim.method= "mpl")

To show exaclty what I mean here are the results of gofmplnNZ and gofmplgNZ:

> gofmplnNZ

    Parametric bootstrap-based goodness-of-fit test of Normal copula, dim. d = 2, with 'method'="Sn",
    'estim.method'="mpl":

data:  x
statistic = 0.062807, parameter = 0.45013, p-value = 0.0004995

> gofmplgNZ

    Parametric bootstrap-based goodness-of-fit test of Gumbel copula, dim. d = 2, with 'method'="Sn",
    'estim.method'="mpl":

data:  x
statistic = 0.1805, parameter = 1.4038, p-value = 0.0004995
Martin Gal
  • 16,640
  • 5
  • 21
  • 39
Gabriela M
  • 57
  • 4
  • Hi Gabriela! I don't know anything about copulas, sorry, but it's really difficult to help you if you don't share any data and you don't specify which packages you used. You should check [here](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example?noredirect=1&lq=1) for how to create a greate question. – agila Jun 11 '20 at 21:00
  • Hello Agila, thank you for the link! – Gabriela M Jun 12 '20 at 16:30
  • you can easily use `BiCopSelect` function. –  Jun 22 '20 at 14:54
  • I have already used it, but I need to show it using a goodness of fit test. – Gabriela M Jun 23 '20 at 15:17

0 Answers0