Skip to content

Commit 5d24e35

Browse files
committed
add test for conv stability of cf
1 parent f930625 commit 5d24e35

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

test/runtests.jl

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ using Test, Random, Distributions
55
rng = MersenneTwister(1)
66
for _ in 1:100
77
d = AlphaStable(
8-
α=rand(rng,Uniform(0,10)),
8+
α=rand(rng,Uniform(0,2)),
99
β=rand(rng,Uniform(-1,1)),
1010
scale=rand(rng,Uniform(0,10)),
1111
location=rand(rng,Uniform(0,10)),
@@ -18,6 +18,18 @@ using Test, Random, Distributions
1818
@test cf(d32, Float32(x)) isa Complex{Float32}
1919
@test cf(d32, Float32(x)) cf(d,x) atol=100*eps(Float32)
2020
end
21+
for _ in 1:100
22+
# test stability under convolution
23+
d = AlphaStable(
24+
α=rand(rng,Uniform(0.1,2)),
25+
scale=1.0,
26+
location=0.0,
27+
)
28+
x = rand(rng,Uniform(-1,1))
29+
n = rand(rng,1:10^6)
30+
s = n^inv(d.α)
31+
@test cf(d, x) cf(d, x/s)^n
32+
end
2133
xs = range(-1,1,length=100)
2234
d1 = SymmetricAlphaStable=2.0, scale=1/sqrt(2), location=0.0)
2335
d2 = AlphaStable(d1)

0 commit comments

Comments
 (0)