I am looking at modelling a bivariate distribution with observed data from distributions that look like this:

Histogram of variable 1

Histogram of variable 2

Variable 1's distribution looks like a gamma distribution and variable 2's distribution is a bimodal distribution that can't be modeled using any of the "standard" distributions. Both my marginal distributions are discrete.

A scatter plot of the two variables look like this:

Scatter plot

There seems to be a relationship between the two, as in when variable 1 is around 0, variable 2 tends to be clustered around 0 or between 200 and 320. And other such relationships.

Obviously I don't think the distribution can be modeled using the multivariate normal function in R. But I am at a loss as to how to approximate the distribution. Correlation and covariance measures probably wouldn't be helpful in capturing the relationship either, looking at the scatter graph.

After I approximate the distribution, I would like to sample from the distribution.

I prefer using R or python for this, but if you have suggestions that are implemented in other languages feel free to post them too!

Note, if you are interested in seeing what I have attempted to try and model this:

This is the same data in the previous question I posted:

Copula for non-standard distributions in R

In that question I'm asking about modelling a particular bivariate distribution using copulas.

I figured I should ask a more general question like this, because it looks like using copulas might be overkill because copulas are usually used on higher dimension data and people use it because they want to model the dependency structure and the marginals separately. Given that I am only trying to model a bivariate distribution that I can visualize quite easily, is there a better way to model it?

  • $\begingroup$ Is there a bound on their sum? That would be important to specifying a suitable model. $\endgroup$
    – Glen_b
    Jan 8, 2018 at 2:46
  • $\begingroup$ By their sum, do you mean the sum of var1 and var2? The range of var1 should be from 0 to 300 and the range of var2 should be from 0 to 300 also (although the observed data goes up to 320). $\endgroup$
    – Kelian
    Jan 8, 2018 at 3:04
  • $\begingroup$ @Glen_b Actually get your question now, var1+var2 is bounded by 300. As in, the sum of var1 and var2 cannot exceed 300. $\endgroup$
    – Kelian
    Jan 8, 2018 at 3:48
  • 1
    $\begingroup$ Thanks; that's an important bit of information. However, your plot seems to say something different from that, since there are values of var2 that seem to be well above 300 for values where var1 is positive (looks like it's about 14 and some var2 values look to be about 320). How is that appearance happening if their sum is no more than 300? Is there substantial vertical jitter in the plot? (What are these values? Days of the year ? Angles in degrees? ) $\endgroup$
    – Glen_b
    Jan 8, 2018 at 8:55
  • $\begingroup$ A copula is a family of distributions with fixed marginals, starting with two-dimensional vectors. $\endgroup$
    – Xi'an
    Jan 8, 2018 at 17:17

1 Answer 1


Start with some bivariate see Introductory reading on Copulas, and then you can transform the marginals separately.

(I will come back adding an example)


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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