1

I want to impose a Gumbel (or Gaussian) copula on two independent random variables

library(tidyverse); set.seed(1); n <- 1e3
data <- tibble(x = rbeta(n, 1, 2), y = rbeta(n, 1, 3))
plot(data$x, data$y)

Here is the uncorrelated plot: enter image description here

I would like impose a copula to reorder the deviates such that I get the following:

Gumbel
gumbel

Gaussian

gaussian

I have looked through the copula, MASS and VineCopula packages but it is unclear how this can be achieved. Thank you very much!

  • 1
    Could you please explain what it means to "impose [a] copula"? Would this be some kind of operation data or on mathematical objects (random variables)? What would the result of this operation be? – whuber Apr 07 '19 at 14:46
  • Right now I'm simulating uncorrelated random variables. I would like them to be correlated using a copula distribution. – Vincent Risington Apr 07 '19 at 14:59
  • 1
    We have numerous threads about simulating multivariate data based on a copula: please see https://stats.stackexchange.com/search?q=simulate+copula. https://stats.stackexchange.com/questions/19670 gives a software recommendation but unfortunately provides no description of how it works. See https://stats.stackexchange.com/questions/37424 for simulating from a Gaussian copula. – whuber Apr 07 '19 at 15:02
  • Thanks @whuber - that makes sense. The way forward is to simulate correlated Gaussian variables using rmvnorm, transform to uniform, then apply that to the inverse cdfs of choice. However it's still a bit of a mystery how a bivariate Gumbel copula distribution is supposed to be generated in R. – Vincent Risington Apr 07 '19 at 15:48
  • What I would suggest, then, is to edit your post to focus on the Gumbel copula question. You might consider emphasizing the general question of simulating from *any* copula, but I fear the community might find that too broad. It's likely different copulas may require different techniques. – whuber Apr 07 '19 at 16:51
  • 1
    I've figured it out; just wasn't looking properly. `library(copula); n % as_tibble; plot(gumbel.deviates$V1, gumbel.deviates$V2)` – Vincent Risington Apr 08 '19 at 15:22

0 Answers0