[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #65178] [octave forge] (statistics) pdist2 BIS
From: |
Dmitri A. Sergatskov |
Subject: |
[Octave-bug-tracker] [bug #65178] [octave forge] (statistics) pdist2 BIST failures |
Date: |
Fri, 1 Mar 2024 08:02:23 -0500 (EST) |
Follow-up Comment #7, bug#65178 (group octave):
WRT pdist2:
octave:5> pkg load statistics
octave:6> test pdist2 verbose
>>>>>
/home/uu1/.local/share/octave/api-v58/packages/statistics-1.6.4/pdist2.m
***** shared x, y, xx
x = [1, 1, 1; 2, 2, 2; 3, 3, 3];
y = [0, 0, 0; 1, 2, 3; 0, 2, 4; 4, 7, 1];
xx = [1 2 3; 4 5 6; 7 8 9; 3 2 1];
***** test
d = sqrt([3, 5, 11, 45; 12, 2, 8, 30; 27, 5, 11, 21]);
assert (pdist2 (x, y), d);
***** test
d = [5.1962, 2.2361, 3.3166, 6.7082; ...
3.4641, 2.2361, 3.3166, 5.4772];
i = [3, 1, 1, 1; 2, 3, 3, 2];
[D, I] = pdist2 (x, y, "euclidean", "largest", 2);
assert ({D, I}, {d, i}, 1e-4);
***** test
d = [1.7321, 1.4142, 2.8284, 4.5826; ...
3.4641, 2.2361, 3.3166, 5.4772];
i = [1, 2, 2, 3;2, 1, 1, 2];
[D, I] = pdist2 (x, y, "euclidean", "smallest", 2);
assert ({D, I}, {d, i}, 1e-4);
***** test
yy = [1 2 3;5 6 7;9 5 1];
d = [0, 6.1644, 5.3852; 1.4142, 6.9282, 8.7750; ...
3.7417, 7.0711, 9.9499; 6.1644, 10.4881, 10.3441];
i = [2, 4, 4; 3, 2, 2; 1, 3, 3; 4, 1, 1];
[D, I] = pdist2 (y, yy, "euclidean", "smallest", 4);
assert ({D, I}, {d, i}, 1e-4);
***** test
yy = [1 2 3;5 6 7;9 5 1];
d = [0, 38, 29; 2, 48, 77; 14, 50, 99; 38, 110, 107];
i = [2, 4, 4; 3, 2, 2; 1, 3, 3; 4, 1, 1];
[D, I] = pdist2 (y, yy, "squaredeuclidean", "smallest", 4);
assert ({D, I}, {d, i}, 1e-4);
***** test
yy = [1 2 3;5 6 7;9 5 1];
d = [0, 3.3256, 2.7249; 0.7610, 3.3453, 4.4799; ...
1.8514, 3.3869, 5.0703; 2.5525, 5.0709, 5.1297];
i = [2, 2, 4; 3, 4, 2; 1, 3, 1; 4, 1, 3];
[D, I] = pdist2 (y, yy, "seuclidean", "smallest", 4);
assert ({D, I}, {d, i}, 1e-4);
***** test
d = [2.1213, 4.2426, 6.3640; 1.2247, 2.4495, 4.4159; ...
3.2404, 4.8990, 6.8191; 2.7386, 4.2426, 6.1237];
assert (pdist2 (y, x, "mahalanobis"), d, 1e-4);
***** test
xx = [1, 3, 4; 3, 5, 4; 8, 7, 6];
d = [1.3053, 1.8257, 15.0499; 1.3053, 3.3665, 16.5680];
i = [2, 2, 2; 3, 4, 4];
[D, I] = pdist2 (y, xx, "mahalanobis", "smallest", 2);
assert ({D, I}, {d, i}, 1e-4);
***** test
d = [2.5240, 4.1633, 17.3638; 2.0905, 3.9158, 17.0147];
i = [1, 1, 3; 4, 3, 1];
[D, I] = pdist2 (y, xx, "mahalanobis", "largest", 2);
assert ({D, I}, {d, i}, 1e-4);
***** test
yy = [1 2 3;5 6 7;9 5 1];
d = [0, 8.4853, 18.0416; 2.4495, 10.0995, 19.4808; ...
2.4495, 10.6771, 19.7104; 2.4495, 10.6771, 20.4573];
i = [2, 2, 2; 1, 4, 4; 4, 1, 1; 3, 3, 3];
[D, I] = pdist2 (y, yy, "mahalanobis", "smallest", 4);
assert ({D, I}, {d, i}, 1e-4);
!!!!! test failed
ASSERT errors for: assert (cond {i},expected {i},tol)
Location | Observed | Expected | Reason
(3,1) 3 4 Abs err 1 exceeds tol 0.0001 by 1
(4,1) 4 3 Abs err 1 exceeds tol 0.0001 by 1
shared variables
x =
1 1 1
2 2 2
3 3 3
y =
0 0 0
1 2 3
0 2 4
4 7 1
xx =
1 3 4
3 5 4
8 7 6
I also see the problem with "mad" (it looks like the test uses octave's "mad",
rather than one from statistics):
../share/octave/api-v58/packages/statistics-1.6.4/shadow9/mad.m pass 74/82
FAIL 8
and also if I do "pkg load statistics" and then "pkg test statistics"
BurrDistribution.m fails:
***** error <paramci: optional arguments must be in NAME-VALUE pairs.> ...
paramci (BurrDistribution.fit (x), "alpha")
!!!!! error failed.
Expected <paramci: optional arguments must be in NAME-VALUE pairs.>, but got
<burrfit: Weibull distribution fits better in X.>
***** error <paramci: invalid VALUE for 'Alpha' argument.> ...
paramci (BurrDistribution.fit (x), "alpha", 0)
!!!!! error failed.
Expected <paramci: invalid VALUE for 'Alpha' argument.>, but got <burrfit:
Weibull distribution fits better in X.>
...
Dmitri.
--
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?65178>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
Message not available
Message not available
Message not available