Skip to content

Commit

Permalink
add few methods
Browse files Browse the repository at this point in the history
  • Loading branch information
lrnv committed Dec 21, 2023
1 parent 8f6153c commit facae2e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/Generator/UnivariateGenerator/ClaytonGenerator.jl
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ end
max_monotony(G::ClaytonGenerator) = G.θ >= 0 ? Inf : Int(floor(1 - 1/G.θ))
ϕ( G::ClaytonGenerator, t) = max(1+G.θ*t,zero(t))^(-1/G.θ)
ϕ⁻¹(G::ClaytonGenerator, t) = (t^(-G.θ)-1)/G.θ
# ϕ⁽¹⁾(G::ClaytonGenerator, t) = First derivative of ϕ
# ϕ⁽¹⁾(G::ClaytonGenerator, t) = (1+G.θ*t) > 0 ? zero(t) : - (1+G.θ*t)^(-1/G.θ -1) # First derivative of ϕ
# ϕ⁽ᵏ⁾(G::ClaytonGenerator, k, t) = kth derivative of ϕ
τ(G::ClaytonGenerator) = ifelse(isfinite(G.θ), G.θ/(G.θ+2), 1)
τ⁻¹(::Type{T},τ) where T<:ClaytonGenerator = ifelse== 1,Inf,2τ/(1-τ))
Expand Down
2 changes: 1 addition & 1 deletion src/Generator/UnivariateGenerator/FrankGenerator.jl
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ max_monotony(G::FrankGenerator) = G.θ < 0 ? 2 : Inf
ϕ( G::FrankGenerator, t) = G.θ > 0 ? -LogExpFunctions.log1mexp(LogExpFunctions.log1mexp(-G.θ)-t)/G.θ : -log1p(exp(-t) * expm1(-G.θ))/G.θ
ϕ( G::FrankGenerator, t::TaylorSeries.Taylor1) = G.θ > 0 ? -log(-expm1(LogExpFunctions.log1mexp(-G.θ)-t))/G.θ : -log1p(exp(-t) * expm1(-G.θ))/G.θ
ϕ⁻¹(G::FrankGenerator, t) = G.θ > 0 ? LogExpFunctions.log1mexp(-G.θ) - LogExpFunctions.log1mexp(-t*G.θ) : -log(expm1(-t*G.θ)/expm1(-G.θ))
# ϕ⁽¹⁾(G::FrankGenerator, t) = First derivative of ϕ
ϕ⁽¹⁾(G::FrankGenerator, t) = (one(t) - one(t) / (one(t) + exp(-t)*expm1(-G.θ))) / G.θ # First derivative of ϕ
# ϕ⁽ᵏ⁾(G::FrankGenerator, k, t) = kth derivative of ϕ
williamson_dist(G::FrankGenerator, d) = G.θ > 0 ? WilliamsonFromFrailty(Logarithmic(-G.θ), d) : WilliamsonTransforms.𝒲₋₁(t -> ϕ(G,t),d)

Expand Down
4 changes: 2 additions & 2 deletions src/Generator/ZeroVariateGenerator/WGenerator.jl
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ The two Frechet-Hoeffding bounds are also Archimedean copulas.
struct WGenerator <: ZeroVariateGenerator end
max_monotony(G::WGenerator) = 2
τ(::WGenerator) = -1
ϕ(::WGenerator,t) = throw(MethodError("WGenerator cannot have a ϕ function"))
ϕ⁻¹(::WGenerator,t) = throw(MethodError("WGenerator cannot have a ϕ⁻¹ function"))
ϕ(::WGenerator,t) = throw(ArgumentError("WGenerator cannot have a ϕ function"))
ϕ⁻¹(::WGenerator,t) = throw(ArgumentError("WGenerator cannot have a ϕ⁻¹ function"))

0 comments on commit facae2e

Please sign in to comment.