Skip to content

Instantly share code, notes, and snippets.

@mick001
Created March 27, 2016 21:36
Show Gist options
  • Save mick001/92f18c40b0660ed16773 to your computer and use it in GitHub Desktop.
Save mick001/92f18c40b0660ed16773 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
# Estimate copula parameters
cop_model <- claytonCopula(dim = 2)
m <- pobs(as.matrix(mydata))
fit <- fitCopula(cop_model, m, method = 'ml')
coef(fit)
## param
## 1.482168
# Check Kendall's tau value for the Clayton copula with theta = 1.48
tau(claytonCopula(param = 1.48))
## [1] 0.4252874
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment