[Pkg-octave-commit] [SCM] Debian packaging for octave-nan branch, master, updated. debian/2.5.5-1
Sébastien Villemot
sebastien.villemot at ens.fr
Tue Apr 3 18:05:14 UTC 2012
The following commit has been merged in the master branch:
commit 58941973abfbc76e1ec1ddf25eef9e92ba23fb5b
Author: Sébastien Villemot <sebastien.villemot at ens.fr>
Date: Tue Apr 3 19:38:38 2012 +0200
Imported Upstream version 2.5.5
diff --git a/DESCRIPTION b/DESCRIPTION
index 81cc254..704970c 100644
--- a/DESCRIPTION
+++ b/DESCRIPTION
@@ -1,10 +1,11 @@
Name: NaN
-Version: 2.5.2
-Date: 2012-02-10
+Version: 2.5.5
+Date: 2012-04-03
Author: Alois Schloegl <alois.schloegl at gmail.com>
Maintainer: Alois Schloegl
Title: The NaN-toolbox
Description: A statistics and machine learning toolbox for Octave and Matlab for data with and w/o missing values.
-Depends: octave (> 3.2.4)
+Depends: octave (> 3.2.0)
License: GPL version 3 or later
Url: http://pub.ist.ac.at/~schloegl/matlab/NaN
+Autoload: no
diff --git a/INDEX b/INDEX
index 249d009..cc9ce9b 100644
--- a/INDEX
+++ b/INDEX
@@ -3,11 +3,11 @@ A statistics and machine learning toolbox for data with and w/o missing values
coefficient_of_variation geomean meansq skewness
covm cor cov corrcoef harmmean median statistic
detrend kurtosis moment std mad naninsttest nantest
- nansum nanstd nanconv nanconv2 nanfft nanfilter
+ nansum nanstd nanconv nanfft nanfilter
nanfilter1uc normpdf normcdf norminv meandev
percentile quantile rankcorr ranks rms sumskipnan
var mean sem spearman trimean tpdf tcdf tinv zscore
- conv2nan flag_implicit_significance xcovf train_sc test_sc
+ flag_implicit_significance xcovf train_sc test_sc
xval classify train_lda_sparse decovm gscatter mahal
cdfplot hist2res fss cat2bin ttest ttest2 xptopen
bland_altman cumsumskipnan range
diff --git a/VERSION b/VERSION
index be25a94..d968324 100644
--- a/VERSION
+++ b/VERSION
@@ -1,3 +1,3 @@
# NaN-toolbox http://pub.ist.ac.at/~schloegl/matlab/NaN
-# Version: 2.5.2
-# Date: 2012-02-10
+# Version: 2.5.5
+# Date: 2012-04-03
diff --git a/inst/cov.m b/inst/cov.m
index 3c2e9d5..49de763 100644
--- a/inst/cov.m
+++ b/inst/cov.m
@@ -4,6 +4,14 @@ function CC = cov(X,Y,Mode)
% NaN's are skipped, NaN do not result in a NaN output.
% The output gives NaN only if there are insufficient input data
% The mean is removed from the data.
+%
+% Remark: for data contains missing values, the resulting
+% matrix might not be positiv definite, and its elements have magnitudes
+% larger than one. This ill-behavior is more likely for small sample
+% sizes, but there is no garantee that the result "behaves well" for larger
+% sample sizes. If you want the a "well behaved" result (i.e. positive
+% definiteness and magnitude of elements not larger than 1), use CORRCOEF.
+% However, COV is faster than CORRCOEF and might be good enough in some cases.
%
% C = COV(X [,Mode]);
% calculates the (auto-)correlation matrix of X
@@ -25,8 +33,8 @@ function CC = cov(X,Y,Mode)
% REFERENCES:
% http://mathworld.wolfram.com/Covariance.html
-% $Id: cov.m 8223 2011-04-20 09:16:06Z schloegl $
-% Copyright (C) 2000-2003,2005,2009 by Alois Schloegl <alois.schloegl at gmail.com>
+% $Id: cov.m 9803 2012-03-09 20:03:49Z schloegl $
+% Copyright (C) 2000-2003,2005,2009,2011,2012 by Alois Schloegl <alois.schloegl at ist.ac.at>
% This function is part of the NaN-toolbox
% http://pub.ist.ac.at/~schloegl/matlab/NaN/
diff --git a/inst/ttest2.m b/inst/ttest2.m
index b4607d8..51754cf 100644
--- a/inst/ttest2.m
+++ b/inst/ttest2.m
@@ -9,6 +9,7 @@ function [h, pval, ci, stats, df] = ttest2 (x, y, alpha, tail, vartype, DIM)
% TTEST2 treads NaNs as "Missing values" and ignores these.
%
% H = ttest2(x,y)
+% H = ttest2([x;y],C,W)
% H = ttest2(x,y,alpha)
% H = ttest2(x,y,alpha,tail)
% H = ttest2(x,y,alpha,tail,vartype)
@@ -67,6 +68,14 @@ function [h, pval, ci, stats, df] = ttest2 (x, y, alpha, tail, vartype, DIM)
if (nargin < 3) || isempty(alpha)
alpha = .05;
+ W = [];
+ elseif size(x,1)==size(y,1) && size(x,1)==size(alpha,1) && size(y,2)==1 && all(y==1 | y==2)
+ c = y;
+ y = x(c==2,:);
+ x = x(c==1,:);
+ Wy = alpha(c==2);
+ Wx = alpha(c==1);
+ alpha = .05;
end
if (nargin < 4) || isempty(tail)
@@ -81,13 +90,13 @@ function [h, pval, ci, stats, df] = ttest2 (x, y, alpha, tail, vartype, DIM)
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;
+ if nargin<6,
+ DIM = find(size(x)>1,1);
+ end;
+ if isempty(DIM), DIM=1; end;
- szx = size(x);
- szy = size(y);
+ szx = size(x);
+ szy = size(y);
szy(DIM) = 1;
szx(DIM) = 1;
@@ -95,8 +104,8 @@ function [h, pval, ci, stats, df] = ttest2 (x, y, alpha, tail, vartype, DIM)
error ('ttest2: dimension of X and Y do not fit');
end
- [SX, NX] = sumskipnan(x, DIM);
- [SY, NY] = sumskipnan(y, DIM);
+ [SX, NX] = sumskipnan(x, DIM, Wx);
+ [SY, NY] = sumskipnan(y, DIM, Wy);
stats.df = NX + NY - 2;
MX = SX ./ NX;
MY = SY ./ NY;
diff --git a/inst/xptopen.m b/inst/xptopen.m
new file mode 100644
index 0000000..fd9f614
--- /dev/null
+++ b/inst/xptopen.m
@@ -0,0 +1,41 @@
+% XPTOPEN read of several file formats and writing of the SAS Transport Format (*.xpt)
+% Supported are ARFF, SAS-XPT and STATA files.
+% XPTOPEN is a mex-file and must be compiled before use.
+% More detailed help can be obtained by the command
+% xptopen
+% without an additional argument
+%
+% X = xptopen(filename)
+% X = xptopen(filename,'r')
+% read file with filename and return variables in struct X
+%
+% X = xptopen(filename,'w',X)
+% save fields of struct X in filename.
+%
+% The fields of X must be column vectors of equal length.
+% Each vector is either a numeric vector or a cell array of strings.
+% The SAS-XPT format stores Date/Time as numeric value counting the number of days since 1960-01-01.
+
+% This program is free software; you can redistribute it and/or modify
+% it under the terms of the GNU General Public License as published by
+% the Free Software Foundation; either version 3 of the License, or
+% (at your option) any later version.
+%
+% This program is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU General Public License for more details.
+%
+% You should have received a copy of the GNU General Public License
+% along with this program; If not, see <http://www.gnu.org/licenses/>.
+
+
+% $Id$
+% Copyright (C) 2010,2011,2012 by Alois Schloegl <alois.schloegl at ist.ac.at>
+% This is part of the NaN-toolbox. For more details see
+% http://pub.ist.ac.at/~schloegl/matlab/NaN/
+
+
+if exist('xptopen','file')~=3
+ error('xptopen.mex is not compiled')
+end;
diff --git a/test/test_xval.m b/test/test_xval.m
index 9729423..1a7bfc8 100644
--- a/test/test_xval.m
+++ b/test/test_xval.m
@@ -26,16 +26,17 @@ N=100; % number of samples
M=10; % number of features
classifier= {'SVM:LIB','REG','MDA','MD2','QDA','QDA2','LD2','LD3','LD4','LD5','LD6','NBC','aNBC','WienerHopf','LDA/GSVD','MDA/GSVD', 'LDA/sparse','MDA/sparse', 'PLA', 'LMS','LDA/DELETION','MDA/DELETION','NBC/DELETION','RDA/DELETION','REG/DELETION','RDA','GDBC','SVM','RBF','PSVM','SVM11','SVM:LIN4','SVM:LIN0','SVM:LIN1','SVM:LIN2','SVM:LIN3','WINNOW'};
classifier= {'SVM:RBF'};
+classifier= {'SVM11','SVM:RBF','LDA'};
x = randn(N,M); % data
-c = ([1:N]'>(N/2))+1; % classlabel
+c = mod([1:N]',4); % classlabel
%w = [ones(1,N/2)/5,ones(1,N/10),zeros(1,4*N/10)];
w = []; % no weightening
x = randn(N,M);
x = x+c*ones(1,M);
-if 1,
+if 0,
%x(2:2:N/2,2) = NaN;
x(2:2:N,2) = NaN;
x(3,2:2:end) = NaN;
@@ -43,15 +44,16 @@ end;
end;
for k = 1:length(classifier);
- try,
+if 1,% try,
[R{k},CC{k}] = xval(x, {c,w}, classifier{k});
- fprintf(1,'%8s\t%i\t%5.2f\t%5.2f+-%5.2f\n',classifier{k},sum(R{k}.data(:)),R{k}.ACC*100,R{k}.kappa,R{k}.kappa_se);
+ % fprintf(1,'%8s\t%i\t%5.2f\t%5.2f+-%5.2f\n',classifier{k},sum(R{k}.data(:)),R{k}.ACC*100,R{k}.kappa,R{k}.kappa_se);
save -v6 debug.mat
- catch,
+else % catch,
R{k} = [];
- end;
+ end;
end;
+
for k = 1:length(R)
if isempty(R{k})
fprintf(1,'%8s \t failed\n',classifier{k});
--
Debian packaging for octave-nan
More information about the Pkg-octave-commit
mailing list