Skip to content

Instantly share code, notes, and snippets.

@mick001
Created March 27, 2016 21:35
Show Gist options
  • Save mick001/31fbee9dc1c077f12a18 to your computer and use it in GitHub Desktop.
Save mick001/31fbee9dc1c077f12a18 to your computer and use it in GitHub Desktop.
How to fit a copula model in R [heavily revised]. Part 2: fitting the copula. Full article at
var_a <- pobs(mydata)[,1]
var_b <- pobs(mydata)[,2]
selectedCopula <- BiCopSelect(var_a, var_b, familyset = NA)
selectedCopula
## $p.value.indeptest
## [1] NA
##
## $family
## [1] 3
##
## $par
## [1] 1.482169
##
## $par2
## [1] 0
##
## attr(,"class")
## [1] "BiCop"
# Family = 1 -> Gaussian copula
# = 2 -> Student t copula (t-copula)
# = 3 -> Clayton
# ...
selectedCopula$family
## [1] 3
# par -> parameter of the copula
selectedCopula$par
## [1] 1.482169
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment