Skip to main content
edited title
Link
JohnK
  • 21.1k
  • 11
  • 71
  • 119

How to simulate Gumbel CouplaCopula in R?

made the function balanced
Source Link
Anonymous
  • 353
  • 2
  • 11

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),....

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),....

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),....
Source Link
Anonymous
  • 353
  • 2
  • 11

How to simulate Gumbel Coupla in R?

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),....