# Copulas in Julia?

**URL:** <https://discourse.julialang.org/t/copulas-in-julia/10285>\
**Category:** Statistics\
**Tags:** question\
**Created:** [April 11, 2018, 4:29pm UTC](https://discourse.julialang.org/t/copulas-in-julia/10285 "2018-04-11T16:29:52Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![floswald](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/floswald/32/195_2.png) [@floswald](https://discourse.julialang.org/u/floswald)\
**Post date:** [April 11, 2018, 4:29pm UTC](https://discourse.julialang.org/t/copulas-in-julia/10285/1 "2018-04-11T16:29:52Z")

</div>

hi all,

I am looking for a native julia Copula package.  
I have come across [https://github.com/JuliaFinMetriX/Copulas.jl](https://github.com/JuliaFinMetriX/Copulas.jl) but it seems quite something to install - plus I can’t figure out the most basic things from the docs.

---

<div class="post-metadata">

**Author:** ![Christoph\_H](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/christoph_h/32/8391_2.png) [@Christoph\_H](https://discourse.julialang.org/u/Christoph_H)\
**Post date:** [June 4, 2019, 5:53pm UTC](https://discourse.julialang.org/t/copulas-in-julia/10285/2 "2019-06-04T17:53:31Z")

</div>

Any news on Copulas in Julia?

---

<div class="post-metadata">

**Author:** ![floswald](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/floswald/32/195_2.png) [@floswald](https://discourse.julialang.org/u/floswald)\
**Post date:** [June 4, 2019, 9:42pm UTC](https://discourse.julialang.org/t/copulas-in-julia/10285/3 "2019-06-04T21:42:14Z")

</div>

Not that I know of. I’d go with RCall and the copula package. Of course depends what you need.

---

<div class="post-metadata">

**Author:** ![Christoph\_H](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/christoph_h/32/8391_2.png) [@Christoph\_H](https://discourse.julialang.org/u/Christoph_H)\
**Post date:** [June 10, 2019, 2:29pm UTC](https://discourse.julialang.org/t/copulas-in-julia/10285/4 "2019-06-10T14:29:12Z")

</div>

Thanks for the suggestion. If I end up coding something up myself, I will test against the R copula package.

Basically I just need to calculate the copulas themselves to construct multivariate distributions, this is in the background to solve a model of occupation choice.

---

<div class="post-metadata">

**Author:** ![floswald](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/floswald/32/195_2.png) [@floswald](https://discourse.julialang.org/u/floswald)\
**Post date:** [June 10, 2019, 2:32pm UTC](https://discourse.julialang.org/t/copulas-in-julia/10285/5 "2019-06-10T14:32:36Z")

</div>

not sure if you saw that, but i have a minimal thing that computes the copula density here [https://github.com/floswald/Copulas.jl](https://github.com/floswald/Copulas.jl)  
you could start upgrading that to julia v1.x 😉

---

<div class="post-metadata">

**Author:** ![Christoph\_H](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/christoph_h/32/8391_2.png) [@Christoph\_H](https://discourse.julialang.org/u/Christoph_H)\
**Post date:** [June 17, 2019, 7:13am UTC](https://discourse.julialang.org/t/copulas-in-julia/10285/6 "2019-06-17T07:13:00Z")

</div>

Oh I missed it. I quickly wrote what I needed: [https://github.com/chrished/NormalCopula.jl](https://github.com/chrished/NormalCopula.jl)

When I have time I’ll give a go on updating the package you wrote. I might not have time for a few weeks though…

And it would be very convenient to also define sampling functions that specify the marginals and copula and sample from the joint distribution.

---

<div class="post-metadata">

**Author:** ![AnderGray](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/andergray/32/20928_2.png) [@AnderGray](https://discourse.julialang.org/u/AnderGray)\
**Post date:** [April 13, 2021, 9:52pm UTC](https://discourse.julialang.org/t/copulas-in-julia/10285/7 "2021-04-13T21:52:04Z")

</div>

I’ve got a native Julia implementation of bivariate copulas (pi, W, M, gaussian, Clayton and frank) if it’s useful to anybody: [https://github.com/AnderGray/BivariateCopulas.jl](https://github.com/AnderGray/BivariateCopulas.jl)

You can do things like

- Create bivariate distributions using any continuous distribution from Distributions.jl
- Evaluate cdf and density of copulas and bivariate distributions
- Sampling
- Conditioning
- Plots

Only bivariate for now, but would be good to generalise to N-D

---

<div class="post-metadata">

**Author:** ![floswald](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/floswald/32/195_2.png) [@floswald](https://discourse.julialang.org/u/floswald)\
**Post date:** [April 27, 2021, 1:06pm UTC](https://discourse.julialang.org/t/copulas-in-julia/10285/8 "2021-04-27T13:06:00Z")

</div>

that looks beautiful! thanks!

(any reason you don’t register it yet? missing docs?)

---

<div class="post-metadata">

**Author:** ![AnderGray](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/andergray/32/20928_2.png) [@AnderGray](https://discourse.julialang.org/u/AnderGray)\
**Post date:** [April 27, 2021, 1:17pm UTC](https://discourse.julialang.org/t/copulas-in-julia/10285/9 "2021-04-27T13:17:19Z")

</div>

Thanks! No reason actually, I haven’t got around to it yet.

Will register shortly. Some docs and tests would be good though

---

<div class="post-metadata">

**Author:** ![floswald](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/floswald/32/195_2.png) [@floswald](https://discourse.julialang.org/u/floswald)\
**Post date:** [April 27, 2021, 1:19pm UTC](https://discourse.julialang.org/t/copulas-in-julia/10285/10 "2021-04-27T13:19:29Z")

</div>

definitely. are you familiar with setting up docs and testing on github actions? i could file a PR if not. (i basically copy stuff from [https://github.com/JuliaLang/Example.jl](https://github.com/JuliaLang/Example.jl) )

---

<div class="post-metadata">

**Author:** ![AnderGray](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/andergray/32/20928_2.png) [@AnderGray](https://discourse.julialang.org/u/AnderGray)\
**Post date:** [April 27, 2021, 1:39pm UTC](https://discourse.julialang.org/t/copulas-in-julia/10285/11 "2021-04-27T13:39:29Z")

</div>

I’ve registered a couple, wasn’t aware of the examples tho 😃

I think I’ll register it without testing and docs for now though.

---

<div class="post-metadata">

**Author:** ![AnderGray](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/andergray/32/20928_2.png) [@AnderGray](https://discourse.julialang.org/u/AnderGray)\
**Post date:** [April 30, 2021, 2:41pm UTC](https://discourse.julialang.org/t/copulas-in-julia/10285/12 "2021-04-30T14:41:43Z")

</div>

[BivariateCopulas.jl](https://github.com/AnderGray/BivariateCopulas.jl) should now be registered

---

<div class="post-metadata">

**Author:** ![floswald](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/floswald/32/195_2.png) [@floswald](https://discourse.julialang.org/u/floswald)\
**Post date:** [April 30, 2021, 2:53pm UTC](https://discourse.julialang.org/t/copulas-in-julia/10285/13 "2021-04-30T14:53:59Z")

</div>

👍

 ![Screenshot 2021-04-30 at 16.53.08](https://global.discourse-cdn.com/julialang/original/3X/b/2/b2b60ceda1c43428ffdbc2d4326f592db0e00458.png)

---

<div class="post-metadata">

**Author:** ![mickronome](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mickronome/32/31353_2.png) [@mickronome](https://discourse.julialang.org/u/mickronome)\
**Post date:** [December 2, 2021, 4:59pm UTC](https://discourse.julialang.org/t/copulas-in-julia/10285/14 "2021-12-02T16:59:46Z")

</div>

> Vine-Copula package for the analysis of non-Gaussian processes | Andrei Sarychev | JuliaCon2021

Anyone knows if/where the package referenced in the above JuliaCon poster talk is available?

The slides mention Copulas.jl, but the only Copulas.jl I can find seem to have a different author.

Link to poster talk: [https://www.youtube.com/watch?v=NY9-oWZqAUg](https://www.youtube.com/watch?v=NY9-oWZqAUg)

---

<div class="post-metadata">

**Author:** ![lrnv](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lrnv/32/19373_2.png) [@lrnv](https://discourse.julialang.org/u/lrnv)\
**Post date:** [January 27, 2022, 11:57pm UTC](https://discourse.julialang.org/t/copulas-in-julia/10285/15 "2022-01-27T23:57:51Z")

</div>

Also do consider [`DatagenCopulaBased.jl`](https://github.com/iitis/DatagenCopulaBased.jl), which is still experimental but where the authors largely expanded the functionality and quality of tests coverages in the previous year and clearly maintains his code.

This packages looks more promising to me than anything else yet for a future copula standard in Julia.

---

<div class="post-metadata">

**Author:** ![RuanCoelho](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ruancoelho/32/210977_2.png) [@RuanCoelho](https://discourse.julialang.org/u/RuanCoelho)\
**Post date:** [March 23, 2022, 8:55pm UTC](https://discourse.julialang.org/t/copulas-in-julia/10285/17 "2022-03-23T20:55:29Z")

</div>

Hi! I’m having trouble getting any of the plots. Everytime I try to use one of the plotting functions defined in the package, it tells me the function is not defined (“UndefVarError: scatter is not defined”, for example, when trying to do the test scatter plot shown on the “README.md”). The package’s compilation finishes without any warning or error messages. Is anyone also having these issues?

EDIT: I tried including individually the “plotting.jl” file, but got the error “LoadError: UndefVarError: AbstractCopula not defined”. I get the same error for the “copulas.jl” file. It seems that part of the package was properly compiled, such as the copula construction functions, and another part was left out for some reason.

---

<div class="post-metadata">

**Author:** ![Alec\_Loudenback](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/alec_loudenback/32/278_2.png) [@Alec\_Loudenback](https://discourse.julialang.org/u/Alec_Loudenback)\
**Post date:** [August 6, 2022, 4:46am UTC](https://discourse.julialang.org/t/copulas-in-julia/10285/18 "2022-08-06T04:46:19Z")

</div>

For folks coming to this thread more recently. There are more than one package named `Copulas.jl` referenced here. However, the one registered with the General Registry seems to not be mentioned: [GitHub - lrnv/Copulas.jl: A fully `Distributions.jl`-complient copula package](https://github.com/lrnv/Copulas.jl)

In my investigations today, that package seems to be the most Julian and with a path to being the first choice, if its not already.

There’s another announcement thread here: [[ANN] Copulas.jl : A fully `Distributions.jl`-complient copula package](https://discourse.julialang.org/t/ann-copulas-jl-a-fully-distributions-jl-complient-copula-package/76544)

---

<div class="post-metadata">

**Author:** ![lrnv](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lrnv/32/19373_2.png) [@lrnv](https://discourse.julialang.org/u/lrnv)\
**Post date:** [August 6, 2022, 11:24am UTC](https://discourse.julialang.org/t/copulas-in-julia/10285/19 "2022-08-06T11:24:47Z")

</div>

> [@Alec\_Loudenback](#):
>
> In my investigations today, that package seems to be the most Julia and with a path to being the first choice, if its not already.

The most lacking thing of this package right now are test cases, if you want to contribute some you’ll be welcome.

If you have ideas about what it should do, or if you see a lacking functionality, please open an issue to say it, we might code it for you 🙂
