You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/src/manual/intro.md
+18-15Lines changed: 18 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -61,9 +61,9 @@ You may define a copula object in Julia by simply calling its constructor:
61
61
62
62
```@example 1
63
63
using Copulas
64
-
d = 4 # The dimension of the model
64
+
d = 3 # The dimension of the model
65
65
θ = 7 # Parameter
66
-
C = ClaytonCopula(4,7) # A 4-dimensional clayton copula with parameter θ = 7.
66
+
C = ClaytonCopula(d,7) # A 3-dimensional clayton copula with parameter θ = 7.
67
67
```
68
68
69
69
This object is a random vector, and behaves exactly as you would expect a random vector from `Distributions.jl` to behave: you may sample it with `rand(C,100)`, compute its pdf or cdf with `pdf(C,x)` and `cdf(C,x)`, etc:
@@ -84,6 +84,18 @@ plot(C, :logpdf)
84
84
85
85
See [the visualizations page](@ref viz_page) for details on the visualisations tools. It’s often useful to get an intuition by looking at scatter plots.
86
86
87
+
!!! example "Independence"
88
+
To give another example, the function
89
+
90
+
$\Pi : \boldsymbol x \mapsto \prod_{i=1}^d x_i = \boldsymbol x^{\boldsymbol 1}$ is a copula, corresponding to independent random vectors.
91
+
92
+
This copula can be constructed using the [`IndependentCopula(d)`](@ref IndependentCopula) syntax as follows:
93
+
94
+
```@example 1
95
+
Π = IndependentCopula(d) # A 4-variate independence structure.
96
+
nothing # hide
97
+
```
98
+
87
99
One of the reasons that makes copulas so useful is the bijective map from the Sklar Theorem [sklar1959](@cite):
88
100
89
101
!!! theorem "Sklar (1959)"
@@ -95,25 +107,14 @@ One of the reasons that makes copulas so useful is the bijective map from the Sk
95
107
96
108
This result allows to decompose the distribution of $\boldsymbol X$ into several components: the marginal distributions on one side, and the copula on the other side, which governs the dependence structure between the marginals. This object is central in our work, and therefore deserves a moment of attention.
97
109
98
-
!!! example "Independence"
99
-
The function
100
-
101
-
$\Pi : \boldsymbol x \mapsto \prod_{i=1}^d x_i = \boldsymbol x^{\boldsymbol 1}$ is a copula, corresponding to independent random vectors.
102
110
103
-
The independence copula can be constructed using the [`IndependentCopula(d)`](@ref IndependentCopula) syntax as follows:
104
-
105
-
```@example 1
106
-
Π = IndependentCopula(d) # A 4-variate independence structure.
107
-
nothing # hide
108
-
```
109
111
110
112
We can then leverage the Sklar theorem to construct multivariate random vectors from a copula-marginals specification. The implementation we have of this theorem allows building multivariate distributions by specifying separately their marginals and dependence structures as follows:
C = ClaytonCopula(3,0.7) # A 3-variate Clayton Copula with θ = 0.7
116
-
D = SklarDist(C, (X₁,X₂,X₃)) # The final distribution
117
+
D = SklarDist(C, (X₁,X₂,X₃)) # The final distribution, using the previous copula C.
117
118
plot(D, scale=:sklar)
118
119
nothing # hide
119
120
```
@@ -132,7 +133,7 @@ Sklar's theorem can be used the other way around (from the marginal space to the
132
133
133
134
!!! info "Independent random vectors"
134
135
135
-
`Distributions.jl` provides the [`product_distribution`](https://juliastats.org/Distributions.jl/stable/multivariate/#Product-distributions) function to create independent random vectors with given marginals. `product_distribution(args...)` is essentially equivalent to `SklarDist(Π, args)`, but our approach generalizes to other dependence structures.
136
+
`Distributions.jl` provides the [`product_distribution`](https://juliastats.org/Distributions.jl/stable/multivariate/#Product-distributions) function to create independent random vectors with given marginals. `product_distribution(args...)` is essentially equivalent to `SklarDist(IndependentCopula(d), args)`, but our approach generalizes to other dependence structures.
136
137
137
138
Copulas are bounded functions with values in [0,1] since they correspond to probabilities. But their range can be bounded more precisely, and [lux2017](@cite) gives us:
138
139
@@ -309,3 +310,5 @@ The documentation of this package aims to combine theoretical information and re
0 commit comments