Skip to content

Commit

Permalink
Update paper.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Santymax98 authored Feb 23, 2024
1 parent c6e0f30 commit ce819dd
Showing 1 changed file with 0 additions and 30 deletions.
30 changes: 0 additions & 30 deletions joss/paper.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,36 +108,6 @@ using Turing
Turing.Turing.@addlogprob! loglikelihood(D, dataset)
end
```
Outside the common context we can use the API to work on different aspects, suppose you want to generate random samples of a copula whose parameter depends on a covariate $X$ [@abegaz2012], for example, Consider the Frank copula whose parameter depends on a covariate $X$ that follows a truncated normal distribution with mean zero and variance 9. Also, consider the parameter $\theta(x), x \in [-2,2]$.
```julia
using Distributions, Copulas, DataFrames

x= truncated(Normal(0,3),-2,2)

function model_1(x)
return (10-1.5x^2)
end

data = rand(x,10^5)

#Frank Copula whose parameter depends on a covariate
function rFrank(x, C_function, dimension)
data_list = DataFrame(u1=Float64[], u2=Float64[])

for i in x
param = C_function(i)
copula_instance = FrankCopula(dimension, param)
value_copula = rand(copula_instance, 1)
push!(data_list, (value_copula[1], value_copula[2]))
end

return data_list
end

New_frank = rFrank(data, model_1, 2)
```
In this way we easily obtain random samples of a new bivariate Frank copula whose parameter can depend on any covariate.

## The Archimedean interface

Archimedean copulas form a large class of copulas that has seen a lot of theoretical work. Among others, you may take a look at [@mcneilMultivariateArchimedeanCopulas2009b]. We use [`WilliamsonTransforms.jl`](https://github.com/lrnv/WilliamsonTransforms.jl/)'s implementation of the Williamson $d$-transfrom to sample from any archimedean copula, including for example the `ClaytonCopula` with negative dependence parameter in any dimension, which is a first to our knowledge.
Expand Down

0 comments on commit ce819dd

Please sign in to comment.