Ce serveur Gitlab sera éteint le 30 juin 2020, pensez à migrer vos projets vers les serveurs gitlab-research.centralesupelec.fr et gitlab-student.centralesupelec.fr !

Commit 20d87d57 authored by Dahua Lin's avatar Dahua Lin

tested triangular distributions

parent 91db997b
......@@ -151,9 +151,9 @@ for finame in ["arcsine.jl",
"poisson.jl",
"rayleigh.jl",
"skellam.jl",
"tdist.jl",
"triangular.jl",
"symtriangular.jl",
"tdist.jl",
"triangular.jl",
"uniform.jl",
"vonmises.jl",
"weibull.jl"
......
......@@ -104,10 +104,7 @@ for distr in [
NoncentralF(2,2,2),
NoncentralF(8,10,5),
NoncentralT(2,2),
NoncentralT(10,2),
SymTriangularDist(3.0, 1.0),
SymTriangularDist(3.0, 2.0),
SymTriangularDist(10.0, 10.0) ]
NoncentralT(10,2) ]
println(" testing $(distr)")
test_distr(distr, n_tsamples)
......
......@@ -47,9 +47,15 @@
"Rayleigh(1.0)", 1.2533141373155001e+00, 4.2920367320510344e-01, 9.4203424217079368e-01, 7.5852761644093214e-01, 1.1774100225154747e+00, 1.6651092223153954e+00, -5.6405814402542731e-01, -5.2983005057080479e-01, -8.7640364085077727e-01
"Rayleigh(3.0)", 3.7599424119465006e+00, 3.8628330588459310e+00, 2.0406465308389032e+00, 2.2755828493227965e+00, 3.5322300675464238e+00, 4.9953276669461859e+00, -1.6626704326935371e+00, -1.6284423392389145e+00, -1.9750159295188872e+00
"Rayleigh(8.0)", 1.0026513098524001e+01, 2.7469035085126620e+01, 3.0214757838506294e+00, 6.0682209315274571e+00, 9.4192801801237973e+00, 1.3320873778523163e+01, -2.6434996857052631e+00, -2.6092715922506406e+00, -2.9558451825306129e+00
"SymTriangularDist(3.0, 1.0)", 3.0000000000000000e+00, 1.6666666666666666e-01, 5.0000000000000000e-01, 2.7071067811865475e+00, 3.0000000000000000e+00, 3.2928932188134525e+00, -3.4657359027997270e-01, 0.0000000000000000e+00, -3.4657359027997270e-01
"SymTriangularDist(3.0, 2.0)", 3.0000000000000000e+00, 6.6666666666666663e-01, 1.1931471805599454e+00, 2.4142135623730949e+00, 3.0000000000000000e+00, 3.5857864376269051e+00, -1.0397207708399181e+00, -6.9314718055994529e-01, -1.0397207708399181e+00
"SymTriangularDist(10.0, 10.0)", 1.0000000000000000e+01, 1.6666666666666664e+01, 2.8025850929940455e+00, 7.0710678118654755e+00, 1.0000000000000000e+01, 1.2928932188134524e+01, -2.6491586832740182e+00, -2.3025850929940455e+00, -2.6491586832740182e+00
"TDist(1.2)", 0.0000000000000000e+00, inf, 2.3401827213118382e+00, -9.3358614772330029e-01, 7.9820775349995142e-17, 9.3358614772330029e-01, -1.7122227129873395e+00, -1.1116320206507522e+00, -1.7122227129873395e+00
"TDist(5.0)", 0.0000000000000000e+00, 1.6666666666666667e+00, 1.6275026724163131e+00, -7.2668684379793969e-01, 6.9760036230033171e-17, 7.2668684379793969e-01, -1.2698241446815288e+00, -9.6861958905472412e-01, -1.2698241446815288e+00
"TDist(28.0)", 0.0000000000000000e+00, 1.0769230769230769e+00, 1.4549639186397185e+00, -6.8335284452749046e-01, 6.6975103488125950e-17, 6.8335284111072625e-01, -1.1676951605678694e+00, -9.2786520944663353e-01, -1.1676951581892965e+00
"TriangularDist(-4, 14, 3)", 4.3333333333333339e+00, 1.3722222222222223e+01, 2.6972245773362191e+00, 1.6124860801609113e+00, 4.0501256289337988e+00, 6.9643763602648541e+00, -2.4181409534757390e+00, -2.2975599250672949e+00, -2.6441335153472671e+00
"TriangularDist(2, 2000, 500)", 8.3400000000000000e+02, 1.8027800000000000e+05, 7.4067547786485530e+00, 5.0075018759380850e+02, 7.7586765421381006e+02, 1.1344077172247894e+03, -6.9072550288153449e+00, -7.1099875828694268e+00, -7.4565611731493995e+00
"TriangularDist(1, 3, 2)", 2.0000000000000000e+00, 1.6666666666666666e-01, 5.0000000000000000e-01, 1.7071067811865475e+00, 2.0000000000000000e+00, 2.2928932188134525e+00, -3.4657359027997270e-01, 0.0000000000000000e+00, -3.4657359027997270e-01
"TruncatedNormal(0, 1, -2, 2)", 0.0000000000000000e+00, 7.7374130354992321e-01, 1.2592412726872442e+00, -6.3911191087127295e-01, 0.0000000000000000e+00, 6.3911191087127306e-01, -1.0766026382210476e+00, -8.7237062091228246e-01, -1.0766026382210476e+00
"TruncatedNormal(3, 10, 7, 8)", 7.4962513762870771e+00, 8.3297130072637615e-02, -8.4383927631215272e-05, 7.2458921432975716e+00, 7.4943789877185045e+00, 7.7456727334081119e+00, 1.1444251309232101e-02, 5.8503934558418180e-04, -1.1024796691253780e-02
"TruncatedNormal(27, 3, 0, Inf)", 2.7000000000000000e+01, 9.0000000000000000e+00, 2.5175508218727831e+00, 2.4976530749411754e+01, 2.7000000000000000e+01, 2.9023469250588246e+01, -2.2450190334325688e+00, -2.0175508218727822e+00, -2.2450190334325688e+00
......
......@@ -47,12 +47,15 @@ Pareto(3.0, 2.0)
Rayleigh(1.0)
Rayleigh(3.0)
Rayleigh(8.0)
SymTriangularDist(3.0, 1.0)
SymTriangularDist(3.0, 2.0)
SymTriangularDist(10.0, 10.0)
TDist(1.2)
TDist(5.0)
TDist(28.0)
TriangularDist(-4, 14, 3),
TriangularDist(2, 2000, 500),
TriangularDist(1, 3, 2),
TriangularDist(-4, 14, 3)
TriangularDist(2, 2000, 500)
TriangularDist(1, 3, 2)
TruncatedNormal(0, 1, -2, 2)
TruncatedNormal(3, 10, 7, 8)
TruncatedNormal(27, 3, 0, Inf)
......
......@@ -135,6 +135,10 @@ def to_scipy_dist(name, args):
assert len(args) == 1
return rayleigh(scale=args[0])
elif name == "SymTriangularDist":
assert len(args) == 2
return triang(0.5, loc=args[0] - args[1], scale=args[1] * 2.0)
elif name == "TDist":
assert len(args) == 1
return t(args[0])
......@@ -148,6 +152,11 @@ def to_scipy_dist(name, args):
zb = min(zb, 1000.0)
return truncnorm(za, zb, loc=mu, scale=sig)
elif name == "TriangularDist":
assert len(args) == 3
a, b, c = args
return triang((c - a) / (b - a), loc=a, scale=b-a)
elif name == "Uniform":
assert len(args) == 2
return uniform(args[0], args[1] - args[0])
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment