Skip to content

Commit

Permalink
[bug] Change from Id check to diagonal check (#192)
Browse files Browse the repository at this point in the history
  • Loading branch information
lrnv authored Mar 24, 2024
1 parent 8f47a05 commit b7d7ef0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Cubature = "667455a9-e2ce-5579-9412-b964f529a492"
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210"
InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
LogExpFunctions = "2ab3a3ac-af41-5b50-aa03-7779005ae688"
MvNormalCDF = "37188c8d-bc69-4638-b057-733e744175ec"
PrecompileTools = "aea7be01-6a6a-4083-8856-8a6e6704d82a"
Expand Down
1 change: 1 addition & 0 deletions src/Copulas.jl
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ module Copulas
import Combinatorics
import LogExpFunctions
import QuadGK
import LinearAlgebra

# Standard copulas and stuff.
include("utils.jl")
Expand Down
5 changes: 4 additions & 1 deletion src/EllipticalCopulas/GaussianCopula.jl
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,16 @@ cdf(C,u) # to get the distribution function
Ĉ = fit(GaussianCopula,u) # to fit on the sampled data.
```
GaussianCopulas have a special case:
- When `isdiag(Σ)`, the constructor returns an `IndependentCopula(d)`
References:
* [nelsen2006](@cite) Nelsen, Roger B. An introduction to copulas. Springer, 2006.
"""
struct GaussianCopula{d,MT} <: EllipticalCopula{d,MT}
Σ::MT
function GaussianCopula(Σ)
if Σ == one(Σ)
if LinearAlgebra.isdiag(Σ)
return IndependentCopula(size(Σ,1))
end
make_cor!(Σ)
Expand Down

0 comments on commit b7d7ef0

Please sign in to comment.