Copulas in Julia?

hi all,

I am looking for a native julia Copula package.
I have come across 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.

1 Like

Any news on Copulas in Julia?

1 Like

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

1 Like

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.

1 Like

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

2 Likes

Oh I missed it. I quickly wrote what I needed: 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.

1 Like

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

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

13 Likes

that looks beautiful! thanks!

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

2 Likes

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

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

2 Likes

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 )

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

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

BivariateCopulas.jl should now be registered

4 Likes

:+1:

3 Likes

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

Also do consider 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.

2 Likes

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.

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

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

4 Likes

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 :slight_smile:

2 Likes