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: src/WilliamsonTransforms.jl
+42-35Lines changed: 42 additions & 35 deletions
Original file line number
Diff line number
Diff line change
@@ -7,11 +7,9 @@ module WilliamsonTransforms
7
7
end WilliamsonTransforms
8
8
9
9
import Distributions
10
-
import TaylorSeries
11
-
import Base.minimum
10
+
import TaylorDiff
12
11
import Roots
13
12
import Base: minimum, maximum
14
-
15
13
export 𝒲, 𝒲₋₁
16
14
17
15
"""
@@ -36,29 +34,40 @@ References:
36
34
- Williamson, R. E. (1956). Multiply monotone functions and their Laplace transforms. Duke Math. J. 23 189–207. MR0077581
37
35
- McNeil, Alexander J., and Johanna Nešlehová. "Multivariate Archimedean copulas, d-monotone functions and ℓ 1-norm symmetric distributions." (2009): 3059-3097.
38
36
"""
39
-
struct 𝒲{TX}
37
+
struct 𝒲{TX, d}
40
38
X::TX
41
-
d::Int
42
-
# E::TE
43
-
function 𝒲(X::TX,d) where TX<:Distributions.UnivariateDistribution
39
+
function 𝒲(X::TX, ::Val{d}) where {TX<:Distributions.UnivariateDistribution, d}
Compute the Taylor series expansion of the function `f` around the point `x₀` up to order `d`, and gives you back all the successive derivatives.
59
+
60
+
# Arguments
61
+
- `f`: A function to be expanded.
62
+
- `x₀`: The point around which to expand the Taylor series.
63
+
- `d`: The order up to which the Taylor series is computed.
64
+
65
+
# Returns
66
+
A tuple with value ``(f(x₀), f'(x₀),...,f^{(d)}(x₀))``.
67
+
"""
68
+
function taylor(f::F, x₀, D::Val{d}) where {F,d}
69
+
r = TaylorDiff.derivatives(f, x₀, one(x₀), D)
70
+
return (r.value, r.partials...)
62
71
end
63
72
64
73
"""
@@ -87,38 +96,36 @@ References:
87
96
- Williamson, R. E. (1956). Multiply monotone functions and their Laplace transforms. Duke Math. J. 23 189–207. MR0077581
88
97
- McNeil, Alexander J., and Johanna Nešlehová. "Multivariate Archimedean copulas, d-monotone functions and ℓ 1-norm symmetric distributions." (2009): 3059-3097.
0 commit comments