I am relatively new to R programming,
I am trying to generate Gumbel coupla as described by
https://datascienceplus.com/modelling-dependence-with-copulas/
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)
^
Traceback:
Can someone help me with understanding how may I simulate Gumbel Copula?
Btw I did
# Fit the transformed data
library('VineCopula')
library(copula)
u <- pobs(as.matrix(resi_Trans))[,1]
v <- pobs(as.matrix(resi_Trans))[,2]
selectedCopula <- BiCopSelect(u,v,familyset=NA)
selectedCopula
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),....