Skip to content

Instantly share code, notes, and snippets.

@mick001
Last active March 13, 2016 22:20
Show Gist options
  • Save mick001/022495b3d5c88820949a to your computer and use it in GitHub Desktop.
Save mick001/022495b3d5c88820949a to your computer and use it in GitHub Desktop.
How to fit a copula model in R [heavily revised]. Part 1: basic tools. Full article at http://firsttimeprogrammer.blogspot.com/2016/03/how-to-fit-copula-model-in-r-heavily.html
# Select the copula
cp <- claytonCopula(param = c(3.4), dim = 2)
# Generate the multivariate distribution (in this case it is just bivariate) with normal and t marginals
multivariate_dist <- mvdc(copula = cp,
margins = c("norm", "t"),
paramMargins = list(list(mean = 2, sd=3),
list(df = 2)) )
print(multivariate_dist)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment