Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move archimedean generators to their own structs. #63

Closed
lrnv opened this issue Nov 14, 2023 · 0 comments · Fixed by #79
Closed

Move archimedean generators to their own structs. #63

lrnv opened this issue Nov 14, 2023 · 0 comments · Fixed by #79
Labels
enhancement New feature or request

Comments

@lrnv
Copy link
Owner

lrnv commented Nov 14, 2023

The idea is to have

abstract type Generator end
max_monotony(Generator) = ...
\phi(Generator) = ....
\phi_inv(Generator) = ... # with an adequate default method
williamson_dist(Generator,d) = ... # with an adequate default method. 

then

struct WilliamsonGenerator <: Generator
    X::TX # the random variable 
    d::Int # the dimension in which the transformation has been done. 
end
struct ClaytonGenerator <: Generator
    theta::T
end

with the appropriate methods overloads.

And then we can construct copulas as

# for archimedeans: 
ClaytonCopula{d,T} = ArchimedeanCopula{d,ClatyonGenerator{T}}
# or even 
struct LiouvilleCopula{d,V,G}
    alpha::V # vector of dirichlet parameters
    phi::G # archimedean generator
end

it is still unclear how the other methods (fitting, tau, invtau, rho, invrho) will be implemented for specific archimedeans..

It will also easily allow for nested archimedeans, by defining e.g.

can_nest(inner::Generator, outer::Generator) = ...
struct NestedLiouvilleCopula
    phi::Generator
    content::Vector{Union{NestedLiouvilleCopula,LiouvilleCopula,Distributions.Uniform}}
end

that recursively checks possibility by using the nesting conditions through e.g.

can_nest(inner::ClaytonGenerator, outer::ClaytonGenerator) = inner.theta < outer.theta
can_nest(inner::ClaytonGenerator,outer::GumbelGenerator) = # more complicated but doable

maybe even a generic can_nest could be implemented ? I dunno if it is even possible.

So maybe ArchimedeanCopula<:LiouvilleCopula should be true ?

@lrnv lrnv added the enhancement New feature or request label Nov 17, 2023
@lrnv lrnv linked a pull request Nov 20, 2023 that will close this issue
@lrnv lrnv closed this as completed in #79 Nov 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
1 participant