# Fitting copula with known marginal, Copulas.jl

**URL:** <https://discourse.julialang.org/t/fitting-copula-with-known-marginal-copulas-jl/130255>\
**Category:** General Usage\
**Tags:** copula\
**Created:** [June 26, 2025, 7:35pm UTC](https://discourse.julialang.org/t/fitting-copula-with-known-marginal-copulas-jl/130255 "2025-06-26T19:35:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rand5](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rand5/32/867_2.png) [@rand5](https://discourse.julialang.org/u/rand5)\
**Post date:** [June 26, 2025, 7:35pm UTC](https://discourse.julialang.org/t/fitting-copula-with-known-marginal-copulas-jl/130255/1 "2025-06-26T19:35:53Z")

</div>

An example of fitting a copula using the Copulas.jl package is given as the following in the docs:

```julia
MyCop = SurvivalCopula{4,ClaytonCopula,(2,4)}
MyMargs = Tuple{LogNormal,Pareto,Gamma,Normal}
MyD = SklarDist{MyCop, MyMargs}
fitted_model = fit(MyD,data)

```

Question: Is there a good way to fit the copula when one already has the exact distributions for the marginals, not just the types of distributions? I have fit my marginals to custom distributions that take some time to calculate.

It would be great if `MyMargs` could be explicitly specified like `MyMargs=[Normal(0,1), Gamma(1,1), MyDist(1,1)]`

Thanks in advance for the help,

---

<div class="post-metadata">

**Author:** ![bertschi](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bertschi/32/33462_2.png) [@bertschi](https://discourse.julialang.org/u/bertschi)\
**Post date:** [June 26, 2025, 8:19pm UTC](https://discourse.julialang.org/t/fitting-copula-with-known-marginal-copulas-jl/130255/2 "2025-06-26T20:19:44Z")

</div>

If you have a CDF for your marginals, you can just transform to the unit space and fit the Copula there, i.e.,

```julia
known_marginals = [Normal(0, 1), Gamma(1, 1), MyDist(1, 1)]
u = cdf.(known_marginals, data)
fit(MyCop, u)

```
