Hello community,
here is the log from the commit of package octave-forge-nan for
openSUSE:Factory checked in at 2020-08-17 12:05:12
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/octave-forge-nan (Old)
and /work/SRC/openSUSE:Factory/.octave-forge-nan.new.3399 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "octave-forge-nan"
Mon Aug 17 12:05:12 2020 rev:10 rq:826837 version:3.5.0
Changes:
--------
--- /work/SRC/openSUSE:Factory/octave-forge-nan/octave-forge-nan.changes
2019-12-09 21:38:16.806025926 +0100
+++
/work/SRC/openSUSE:Factory/.octave-forge-nan.new.3399/octave-forge-nan.changes
2020-08-17 12:05:49.734709261 +0200
@@ -1,0 +2,11 @@
+Tue Aug 4 22:26:54 UTC 2020 - Atri Bhattacharya <[email protected]>
+
+- Update to version 3.5.0:
+ * ttest: support output arguments CI and STATS.
+ * fishers_exact_test:
+ - Use VPA from symbolic pkg if available.
+ - Add unit tests.
+ - Improve help.
+- Remove exec bits from a file that isn't in executable path.
+
+-------------------------------------------------------------------
Old:
----
nan-3.4.5.tar.gz
New:
----
nan-3.5.0.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ octave-forge-nan.spec ++++++
--- /var/tmp/diff_new_pack.8mu8Fe/_old 2020-08-17 12:05:51.290710129 +0200
+++ /var/tmp/diff_new_pack.8mu8Fe/_new 2020-08-17 12:05:51.294710130 +0200
@@ -1,7 +1,7 @@
#
# spec file for package octave-forge-nan
#
-# Copyright (c) 2019 SUSE LLC
+# Copyright (c) 2020 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -18,7 +18,7 @@
%define octpkg nan
Name: octave-forge-%{octpkg}
-Version: 3.4.5
+Version: 3.5.0
Release: 0
Summary: A statistics and machine learning toolbox
License: GPL-3.0-or-later
@@ -43,6 +43,9 @@
%install
%octave_pkg_install
+# Spurious exec bit
+chmod -x
%{buildroot}%{_datadir}/octave/packages/nan-%{version}/fishers_exact_test.m
+
%check
%octave_pkg_test
++++++ nan-3.4.5.tar.gz -> nan-3.5.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/nan-3.4.5/DESCRIPTION new/nan-3.5.0/DESCRIPTION
--- old/nan-3.4.5/DESCRIPTION 2019-11-21 13:54:16.000000000 +0100
+++ new/nan-3.5.0/DESCRIPTION 2020-07-12 23:58:03.000000000 +0200
@@ -1,6 +1,6 @@
Name: NaN
-Version: 3.4.5
-Date: 2019-11-21
+Version: 3.5.0
+Date: 2020-07-12
Author: Alois Schloegl <[email protected]>
Maintainer: Alois Schloegl
Title: The NaN-toolbox
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/nan-3.4.5/NEWS new/nan-3.5.0/NEWS
--- old/nan-3.4.5/NEWS 2019-11-21 13:54:16.000000000 +0100
+++ new/nan-3.5.0/NEWS 2020-07-12 23:58:03.000000000 +0200
@@ -1,3 +1,13 @@
+2020-07-12: Release of NaN-toolbox 3.5.0
+
+* ttest:
+ - support output arguments CI and STATS
+
+* fishers_exact_test:
+ - use VPA from symbolic pkg if available;
+ - add unit tests;
+ - improve help
+
2019-11-16: Release of NaN-Tb v3.4.5
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/nan-3.4.5/inst/fishers_exact_test.m
new/nan-3.5.0/inst/fishers_exact_test.m
--- old/nan-3.4.5/inst/fishers_exact_test.m 2019-11-21 13:54:16.000000000
+0100
+++ new/nan-3.5.0/inst/fishers_exact_test.m 2020-07-12 23:58:03.000000000
+0200
@@ -7,11 +7,13 @@
% p = fishers_exact_test(a,b,c,d)
%
% with H being a 2x2 matrix representing a contincency table H = [[a,b];[c,d]]
-% and p is the resulting p-value. The implementation provides exact results
-% for small sample sizes, and might be subject to the limited accuracy of
-% floating point numbers for large sample sizes (a warning might be shown).
+% and p is the resulting p-value. The implementation provides exact results,
+% when (1) the symbolic toolbox (with vpa) is loaded, or (2) for small sample
+% sizes. In the latter case, the result might be subject to the limited
accuracy of
+% floating point numbers for large sample sizes (a warning might be shown);
+% in the case, the symbolic toolbox should be loaded.
%
-% Reference:
+% References:
% [1] https://en.wikipedia.org/wiki/Fisher%27s_exact_test
% [2] https://en.wikipedia.org/wiki/Lady_tasting_tea
% [3] Fisher, R. A. (1922). "On the interpretation of χ2 from contingency
@@ -47,7 +49,7 @@
% Boston, MA 02111-1307, USA.
if (nargin==1) && isequal(size(a),[2,2]),
- H = a;
+ H = a;
a=H(1,1);
b=H(1,2);
c=H(2,1);
@@ -57,12 +59,26 @@
else
error('invalid input argument')
end
-n = sum(H(:));
+
+try
+ % use symbolic package if available
+ a = vpa(a);
+ b = vpa(b);
+ c = vpa(c);
+ d = vpa(d);
+end
u = nchoosek(a+b,a);
v = nchoosek(c+d,c);
-w = nchoosek(n,a+c);
+w = nchoosek(a+b+c+d,a+c);
+
+if strcmp(lastwarn(),'nchoosek: possible loss of precision')
+ printf('It is recommended to load the symbolic package, and re-run
fishers_exact_test.\n')
+end
+
+p = u * v / w;
-p = u*v / w;
+%!assert((double(fishers_exact_test(1,1,1,1))-2/3)<eps)
+%!assert(abs(double(fishers_exact_test(10,1,1,10))-1.715261003186700e-04) <
eps)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/nan-3.4.5/inst/kstest2.m new/nan-3.5.0/inst/kstest2.m
--- old/nan-3.4.5/inst/kstest2.m 2019-11-21 13:54:16.000000000 +0100
+++ new/nan-3.5.0/inst/kstest2.m 2020-07-12 23:58:03.000000000 +0200
@@ -1,27 +1,28 @@
-function [H,p,ks2stat] = kstest2(x,y,varargin);
+function [H,p,ks2stat,D] = kstest2(x,y,varargin);
% KSTEST2 computes the two-sampleKolmogorov-Smirnov.
%
% Usage:
-% [h,p,ks2stat] = kstest2(x,y);
-% [...] = kstest2(.., );
+% [H,p,ks2stat,D] = kstest2(x,y);
+% [...] = kstest2(x, y, [, 'alpha', alpha] [, 'tail', '>'] );
%
% Input:
-% x,y input vectors for comparison
+% x, y input vectors for comparison
+% X matrix whos colums are pairwise compared, such
%
% Output:
+% H 1: statistical significance (p < alpha)
% D maximum absolute difference between sample data
% D(k,l) is the m.a.d. from X(:,k) and X(:,l)
% df is the degree-of freedom
% df(k,l) = n(k)*n(l)/(n(k)+n(l)) with n samples of corresponding
% column X.
-% pval p-value, it's also a matrix where
-% pval(k,l) is the p-value from column k and l,
+% p p-value, it's also a matrix where
+% pval(k,l) is the p-value from column k and l
%
% see also:
% kolmogorov_smirnov
-
-% Copyright (C) 2019 by Alois Schloegl <[email protected]>
+% Copyright (C) 2019,2020 by Alois Schloegl <[email protected]>
% This is part of the NaN-toolbox
% https://octave.sourceforge.io/nan/index.html
% https://pub.ist.ac.at/~schloegl/matlab/NaN/
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/nan-3.4.5/inst/ttest.m new/nan-3.5.0/inst/ttest.m
--- old/nan-3.4.5/inst/ttest.m 2019-11-21 13:54:16.000000000 +0100
+++ new/nan-3.5.0/inst/ttest.m 2020-07-12 23:58:03.000000000 +0200
@@ -1,4 +1,4 @@
-function [h, pval, ci, stats] = ttest (x, m, alpha, tail, vartype, DIM)
+function [h, pval, ci, stats] = ttest (x, m, varargin)
% TTEST (paired) t-test
% For a sample X from a normal distribution with unknown mean and
% variance, perform a t-test of the null hypothesis `mean (X) == M'.
@@ -16,6 +16,8 @@
% H = ttest(x,y,alpha,tail)
% H = ttest(x,y,alpha,tail,DIM)
% [H,PVAL] = ttest(...)
+% [H,PVAL,CI] = ttest(...)
+% [H,PVAL,CI,stats] = ttest(...)
%
% H=1 indicates a rejection of the Null-hypothesis at a significance
% level of alpha (default alpha = 0.05).
@@ -36,14 +38,8 @@
% displayed.
%
-%%% not supported yet
-% [h,p,ci] = ttest(...)
-% [h,p,ci,stats] = ttest(...)
-
-% $Id$
-% Copyright (C) 1995, 1996, 1997, 1998, 2000, 2002, 2005, 2006, 2007
-% Kurt Hornik
-% Copyright (C) 2010 by Alois Schloegl <[email protected]>
+% Copyright (C) 2014 Tony Richardson
+% Copyright (C) 2010,2020 by Alois Schloegl <[email protected]>
% This function is part of the NaN-toolbox
% http://pub.ist.ac.at/~schloegl/matlab/NaN/
@@ -60,66 +56,106 @@
% You should have received a copy of the GNU General Public License
% along with this program. If not, see <http://www.gnu.org/licenses/>.
- if ((nargin < 2) || (nargin > 5) || nargout > 4)
- print_usage ;
- end
+ % Set default arguments
+ my_default = 0;
+ alpha = 0.05;
+ tail = 'both';
+
+ % Find the first non-singleton dimension of x
+ DIM = min(find(size(x)~=1));
+ if isempty(DIM), DIM = 1; end
- if (nargin == 2)
- alt = '~=';
+ if (nargin == 1)
+ m = my_default;
end
- if (nargin < 3) || isempty(alpha)
- alpha = .05;
+
+ i = 1;
+ while ( i <= length(varargin) )
+ switch lower(varargin{i})
+ case 'alpha'
+ i = i + 1;
+ alpha = varargin{i};
+ case 'tail'
+ i = i + 1;
+ tail = varargin{i};
+ case 'dim'
+ i = i + 1;
+ DIM = varargin{i};
+ otherwise
+ error('Invalid Name argument.',[]);
+ end
+ i = i + 1;
end
- if (nargin < 4) || isempty(tail)
- tail = '~=';
+ if ~isa(tail, 'char')
+ error('tail argument to ttest must be a string\n',[]);
end
- if (~ ischar (tail))
- error ('ttest: tail must be a string');
+
+ if any(and(~isscalar(m),size(x)~=size(m)))
+ error('Arrays in paired test must be the same size.');
end
- if (nargin < 5) || isempty(vartype)
- vartype = 'equal';
+
+ % Set default values if arguments are present but empty
+ if isempty(m)
+ m = my_default;
end
- if ~strcmp(vartype,'equal')
- error ('test: vartype not supported')
- end
- if nargin<6,
- DIM = find(size(x)>1,1);
- end;
- if isempty(DIM), DIM=1; end;
+ % This adjustment allows everything else to remain the
+ % same for both the one-sample t test and paired tests.
+ x = x - m;
szx = size(x);
szm = size(m);
szx(DIM) = 1;
szm(DIM) = 1;
- if size(m,DIM)==1
- ;
- elseif size(x,DIM) == size(m,DIM)
- x = x-m;
- m = zeros(szm);
- else
- error ('ttest: dimension of X and Y do not fit');
- end
[S, N] = sumskipnan(x, DIM);
+ x_bar = S./N;
stats.df = N - 1;
- stats.sd = std (x);
- stats.tstat = sqrt (N) .* (S./N - m) ./ stats.sd;
- cdf = tcdf (stats.tstat, stats.df);
+ stats.sd = std (x, 0, DIM);
+ x_bar_std = stats.sd./sqrt(N);
+ tval = (x_bar)./x_bar_std;
+ stats.tstat = tval;
if (strcmp (tail, '~=') || strcmp (tail, '!=') || strcmp (tail, '<>')) ||
strcmp(tail,'both'),
- pval = 2 * min (cdf, 1 - cdf);
+ pval = 2*(1 - tcdf(abs(tval), N-1));
+ tcrit = -tinv(alpha/2,N-1);
+ ci = [x_bar-tcrit.*x_bar_std; x_bar+tcrit.*x_bar_std] + m;
elseif strcmp (tail, '>') || strcmp(tail,'right'),
- pval = 1 - cdf;
+ pval = tcdf(tval, N-1);
+ tcrit = -tinv(alpha, N-1);
+ ci = [m+x_bar-tcrit.*x_bar_std; inf*ones(size(x_bar))];
elseif strcmp (tail, '<') || strcmp(tail,'left'),
- pval = cdf;
+ pval = tcdf(tval, N-1);
+ tcrit = -tinv(alpha,N-1);
+ ci = [-inf*ones(size(x_bar)); m+x_bar+tcrit.*x_bar_std];
else
error ('ttest: option %s not recognized', tail);
end
- h = pval < alpha;
+ % Reshape the ci array to match MATLAB shaping
+ if and(isscalar(x_bar), DIM==2)
+ ci = ci(:)';
+ elseif size(x_bar,2)<size(x_bar,1)
+ ci = reshape(ci(:),length(x_bar),2);
+ end
+
+ h = double(pval < alpha);
if (nargout == 0)
fprintf(1,' pval: %g\n', pval);
end
+%!test
+%! x = 8:0.1:12;
+%! [h, pval, ci] = ttest (x, 10);
+%! assert (h, 0)
+%! assert (pval, 1, 10*eps)
+%! assert (ci, [9.6219 10.3781], 1E-5)
+%! [h, pval, ci0] = ttest (x, 0);
+%! assert (h, 1)
+%! assert (pval, 0)
+%! assert (ci0, ci, 2e-15)
+%! [h, pval, ci] = ttest (x, 10, "tail", "right", "dim", 2, "alpha", 0.05);
+%! assert (h, 0)
+%! assert (pval, 0.5, 10*eps)
+%! assert (ci, [9.68498 Inf], 1E-5)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/nan-3.4.5/src/configure new/nan-3.5.0/src/configure
--- old/nan-3.4.5/src/configure 2019-12-08 19:21:34.000000000 +0100
+++ new/nan-3.5.0/src/configure 2020-07-12 23:58:03.000000000 +0200
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for nan-toolbox 3.4.5.
+# Generated by GNU Autoconf 2.69 for nan-toolbox 3.2.0.
#
# Report bugs to <[email protected]>.
#
@@ -580,8 +580,8 @@
# Identity of this package.
PACKAGE_NAME='nan-toolbox'
PACKAGE_TARNAME='nan-toolbox'
-PACKAGE_VERSION='3.4.5'
-PACKAGE_STRING='nan-toolbox 3.4.5'
+PACKAGE_VERSION='3.2.0'
+PACKAGE_STRING='nan-toolbox 3.2.0'
PACKAGE_BUGREPORT='[email protected]'
PACKAGE_URL=''
@@ -1245,7 +1245,7 @@
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures nan-toolbox 3.4.5 to adapt to many kinds of systems.
+\`configure' configures nan-toolbox 3.2.0 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1307,7 +1307,7 @@
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of nan-toolbox 3.4.5:";;
+ short | recursive ) echo "Configuration of nan-toolbox 3.2.0:";;
esac
cat <<\_ACEOF
@@ -1389,7 +1389,7 @@
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-nan-toolbox configure 3.4.5
+nan-toolbox configure 3.2.0
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -1980,7 +1980,7 @@
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by nan-toolbox $as_me 3.4.5, which was
+It was created by nan-toolbox $as_me 3.2.0, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@@ -5249,7 +5249,7 @@
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by nan-toolbox $as_me 3.4.5, which was
+This file was extended by nan-toolbox $as_me 3.2.0, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -5311,7 +5311,7 @@
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //;
s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-nan-toolbox config.status 3.4.5
+nan-toolbox config.status 3.2.0
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/nan-3.4.5/src/configure.ac
new/nan-3.5.0/src/configure.ac
--- old/nan-3.4.5/src/configure.ac 2019-12-08 19:21:01.000000000 +0100
+++ new/nan-3.5.0/src/configure.ac 2020-07-12 23:58:03.000000000 +0200
@@ -2,7 +2,7 @@
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.69])
-AC_INIT([nan-toolbox], [3.4.5], [[email protected]])
+AC_INIT([nan-toolbox], [3.5.0], [[email protected]])
AC_CONFIG_SRCDIR([train.c])
AC_CONFIG_HEADERS([config.h])