Skip to content

Commit

Permalink
Fix first example
Browse files Browse the repository at this point in the history
  • Loading branch information
lrnv committed Feb 13, 2024
1 parent 6e43d58 commit 4529835
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 12 deletions.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,7 @@ D = SklarDist(C,(X₁,X₂,X₃)) # The final distribution
simu = rand(D,1000) # Generate a dataset

# You may estimate a copula using the `fit` function:
= fit(SklarDist{FrankCopula,Tuple{Gamma,Normal,LogNormal}}, simu)
# Increase the number of observations to get a beter fit (or not?)
= fit(SklarDist{ClaytonCopula,Tuple{Gamma,Normal,LogNormal}}, simu)
```

The list of availiable copula models is *very* large, check it out on our [documentation](https://lrnv.github.io/Copulas.jl/stable) !
Expand Down
8 changes: 3 additions & 5 deletions docs/src/getting_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,10 @@ X₃ = LogNormal(0,1)
C = ClaytonCopula(3,0.7) # A 3-variate Clayton Copula with θ = 0.7
D = SklarDist(C,(X₁,X₂,X₃)) # The final distribution

# This generates a (3,1000)-sized dataset from the multivariate distribution D
simu = rand(D,1000)
simu = rand(D,1000) # Generate a dataset

# While the following estimates the parameters of the model from a dataset:
= fit(SklarDist{FrankCopula,Tuple{Gamma,Normal,LogNormal}}, simu)
# Increase the number of observations to get a beter fit (or not?)
# You may estimate a copula using the `fit` function:
= fit(SklarDist{ClaytonCopula,Tuple{Gamma,Normal,LogNormal}}, simu)
```

!!! info "About fitting methods"
Expand Down
8 changes: 3 additions & 5 deletions src/SklarDist.jl
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,10 @@ X₃ = LogNormal(0,1)
C = ClaytonCopula(3,0.7) # A 3-variate Clayton Copula with θ = 0.7
D = SklarDist(C,(X₁,X₂,X₃)) # The final distribution
# This generates a (3,1000)-sized dataset from the multivariate distribution D
simu = rand(D,1000)
simu = rand(D,1000) # Generate a dataset
# While the following estimates the parameters of the model from a dataset:
D̂ = fit(SklarDist{FrankCopula,Tuple{Gamma,Normal,LogNormal}}, simu)
# Increase the number of observations to get a beter fit (or not?)
# You may estimate a copula using the `fit` function:
D̂ = fit(SklarDist{ClaytonCopula,Tuple{Gamma,Normal,LogNormal}}, simu)
```
References:
Expand Down

0 comments on commit 4529835

Please sign in to comment.