Skip to content

Instantly share code, notes, and snippets.

@mick001
Created August 29, 2015 11:46
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mick001/59d952691eff6e917206 to your computer and use it in GitHub Desktop.
Save mick001/59d952691eff6e917206 to your computer and use it in GitHub Desktop.
How to fit a copula model in R (part 3). Full article at http://www.firsttimeprogrammer.blogspot.com/2015/02/how-to-fit-copula-model-in-r.html
# Pseudo observations
p_obs <- pobs(mat)
plot(p_obs[,1],p_obs[,2],main="Pseudo/simulated observations: BLUE/RED",xlab="u",ylab="v",col="blue")
# Simulate data
set.seed(100)
u1 = rCopula(500,normalCopula(coef(fit.cop),dim=2))
points(u1[,1],u1[,2],col="red")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment