I am relatively new to R programming,

I am trying to generate Gumbel coupla as described by


Apply the copula in the mvdc() function and then use rmvdc() to get our simulated observations from the generated multivariate distribution.

copula_dist <- mvdc(copula=gumbelCopula(1.37,dim=2), margins=c("gumbel","gumbel"),
                    paramMargins=list(list(shape=10.2988298881251, scale=1.02463492397923),
                                      list(shape=11.3384023583015, scale=2.02977411878884)))

My outcome was:

Error in parse(text = x, srcfile = src): <text>:5:0: unexpected end of input
3:                                       list(shape=11.3384023583015, scale=2.02977411878884))
4: # sim <- rmvdc(copula_dist, 3965)

Can someone help me with understanding how may I simulate Gumbel Copula?

Btw I did

# Fit the transformed data
u <- pobs(as.matrix(resi_Trans))[,1]
v <- pobs(as.matrix(resi_Trans))[,2]
selectedCopula <- BiCopSelect(u,v,familyset=NA)

and the outcome was

Bivariate copula: Gumbel (par = 1.37, tau = 0.27)

I am not sure if the tau need to be represented in gumbelCopula(1.37,dim=2) in my previous function

copula_dist <- mvdc(copula=gumbelCopula(1.37,dim=2),....
  • $\begingroup$ You have a syntax error (unbalanced parentheses). $\endgroup$ – whuber Mar 11 '17 at 19:15
  • $\begingroup$ Thank you for pointing it out i will re-edit it but this will not stop the problem $\endgroup$ – rsc05 Mar 11 '17 at 19:16

After lots of search and work, I found the following one needs to understand that

Quantile function and generating Gumbel variates is mentioned in


Moreover, I was misunderstanding the idea of shape and scale it seems that a Gumbel distribution is defined by location and scale. However, for our purpose, I kept it as shape and scale.

I believe that the margin distribution of "gumbel" is not well implemented in the package "Copula" maybe because it might not have frequently been used.

To work around this you better define the function

qgumbel <- function(p,shape,scale) shape-scale *log(-log(p))

And now this code runs

G3 <- gumbelCopula(1.37, dim=2)
gMvd2 <- mvdc(G3, c("gumbel","exp"), param = list(list(shape=10.2988298881251, scale=1.02463492397923), list(rate=4)))
# n <- if(Xtras) 10000 else 200 # sample size (realistic vs short for example)
x <- rMvdc(100, gMvd2)
#  parameter values of the marginal distributions 
| cite | improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.