Skip to content

Instantly share code, notes, and snippets.

@mick001
Created March 27, 2016 21:36
How to fit a copula model in R [heavily revised]. Part 2: fitting the copula. Full article at
gf <- gofCopula(normalCopula(dim = 2), as.matrix(mydata), N = 50)
gf
## Parametric bootstrap goodness-of-fit test with 'method'="Sn", 'estim.method'="mpl"
##
## data: x
## statistic = 0.29449, parameter = 0.59983, p-value = 0.009804
gfc <- gofCopula(claytonCopula(dim = 2), as.matrix(mydata), N = 50)
gfc
## Parametric bootstrap goodness-of-fit test with 'method'="Sn", 'estim.method'="mpl"
##
## data: x
## statistic = 0.018788, parameter = 1.4822, p-value = 0.3235
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment