NaN-Tb: A statistics toolbox
------------------------------------------------------------
Copyright (C) 2000-2006 Alois Schloegl <a.schloegl@ieee.org>
FEATURES of the NaN-tb:
-----------------------
- implements statistical tools
- NaN's are treated as missing values
- less but more powerful functions (no nan-FUN needed)
- fixes known bugs
- compatible to Matlab and Octave
- easy to use
- supports DIM argument
- supports unbiased estimation;
- The toolbox was tested with
Matlab 5.2, 5.3, 6.1, 6.5, 7.0 and Octave 2.1.x, 2.9.x
Currently are implemented:
--------------------------
level 1: basic functions (not derived)
SUMSKIPNAN SUM is a built-in function and cannot not be replaced,
For this reason, a different name (than SUM) had to be chosen.
SUMSKIPNAN is central, it implements skipping NaN's, the
DIM-argument and returns the number of valid elements, too.
COVM covariance estimation (several modes)
XCOVF cross-correlation function
NANFILTER filter function
CONVSKIPNAN convolution
CONV2SKIPNAN (CONV2NAN) 2-dimensional convolution
MOD modulus
REM remainder
level 2: derived functions
MEAN mean (options: arithmetic, geometric, harmonic)
SEM standard error of the mean (does not depend on distribution)
VAR variance
STD standard deviation
MEDIAN median (currently only for 2-dim matrices)
MEANSQ mean square
RMS root mean square
STATISTIC estimates various statistics at once
MOMENT moment
SKEWNESS skewness
KURTOSIS excess
MAD mean absolute deviation
CENTER removes mean
ZSCORE normalizes x with z = (x-mean)/std
HARMMEAN harmonic mean
GEOMEAN geometric mean
NANTEST checks whether all functions have been replaced
DETREND detrending of data with missing values and non-equidistant sampled data
COR correlation matrix
CORRCOEF correlation coefficient, inluding rank correlation,
significance test and confidence intervals
SPEARMAN, RANKCORR spearman's rank correlation coefficient. They might be replaced by CORRCOEF.
COV covariance matrix
RANKS calculates ranks for non-parametric statistics
TRIMEAN trimean
QUANTILE q-th quantile
PERCENTILE p-th percentile
NORMPDF normal probability distribution
NORMCDF normal cumulative distribution
NORMINV inverse of the normal cumulative distribution
TPDF student probability distribution
TCDF student cumulative distribution
TINV inverse of the student cumulative distribution
NANSUM, NANSTD fixes for buggy versions included
REFERENCE(S):
----------------------------------
[1] http://www.itl.nist.gov/
[2] http://mathworld.wolfram.com/
What is the difference to previous implementations?
===================================================
1) The default behavior of previous implementations is that NaNs in the input
data results in NaNs in the output data. In many applications is this behavior
quite borring. In this implementation, NaNs are handled as missing values and
are skipped.
2) In previous implementations the workaround was using different functions
like NANSUM, NANMEAN etc. In this toolbox, the same routines can be applied to
data with and without NaNs. This enables more natural (better read- and
understandable) applications.
3) SUMSKIPNAN is central to the other functions.
It implements
- the DIMENSION-argument,
- handles NaNs as missing values or as exception signal (depending on a
hidden FLAG),
- and returns the number of valid elements (which are not NaNs) in the
second output argument.
(Note, NANSUM from Matlab does not support the DIM-argument, and NANSUM(NaN)
gives NaN instead of 0);
4) Defining the estimation mode (biased or unbiased)
This feature is removed.
Unbiased estimates are provided.
5) The DIMENSION argument is implemented in most routines.
These should work in all Matlab and Octave versions. A workaround for a bug in
Octave versions <=2.1.35 is implemented. Also several functions from Matlab
have no support for the DIM argument (e.g. SKEWNESS, KURTOSIS, VAR)
6) Compatible to previous Octave implementation
MEAN implements also the GEOMETRIC and HARMONIC mean. Handling of some special
cases has been removed because its not necessary, anymore.
MOMENT implements Mode 'ac' (absolute and/or central) moment as implemented
in Octave.
7) Performance increase
In most numerical applications, NaN's should be simply skipped. Therefore,
it is efficient to skip NaN's in the default case.
In case an explicit check for NaN's is necessary, implicit exception
handling could be avoided. Eventually the overall performance could increase.
8) More readable code
An explicit check for NaN's display the importance of this special case.
Therefore, the application program might be more readable.
9) ZSCORE, MAD, HARMMEAN and GEOMEAN
DIM-argument and skipping of NaN's implemented. None of these features is
implemented in the Matlab versions.
10a) NANMEAN, NANVAR, NANMEDIAN
These are not necessary anymore. They are implemented in SUMSKIPNAN, MEAN,
VAR, STD and MEDIAN, respectively.
10b) NANSUM, NANSTD
These functions are obsolete, too. However, previous implementations
do not always provide the expected result. Therefore, a correct
version is included for backward compatibility.
11) GPL license
Permits to implement useful modifications.
12) NORMPDF, NORMCDF, NORMINV
In the Matlab statistics toolbox V 3.0, NORMPDF, NORMCDF and NORMINV give
incorrect results for SIGMA=0; A Similar problem was observed in Octave
with NORMAL_INV, NORMAL_PDF, and NORMALCDF.
The problem is fixed with this version. Furthermore, the check of the input
arguments is implemented simpler and easier in this versions.
13) TPDF, TCDF, TINV
In the Matlab statistics toolbox V3.0(12.1) and V4.0(13), TCDF and TINV do not handle NaNs
correctly. TINV returns 0 instead of NaN, TCDF stops with an error message.
In Stats-tb V2.2(R11) TINV has also the same problem.
For these reasons, the NaN-tb is a bug fix. Furthermore, the check of the input
arguments is implemented simpler. Overall, the code is cleaner and leaner.
Q: WHY SKIPPING NaN's?:
------------------------
A: Usually, NaN means that the value is not available. This meaning is most
common, even many different reasons might cause NaN's. In statistics, NaN's
represent missing values, in biosignal processing such missing values might
have been caused by some recording error. Other reasons for NaN's are,
indetermined expressions like e.g. 0/0, data not available, unknown value,
not a numeric value, etc.
If NaN has the meaning of a missing value, it is only consequent to say, the
sum of NaN's should be zero. Similar arguments hold for the other functions.
The mean of X is undefined if and only if X contains no numbers. The
implementation sum(X)/sum(~isnan(X)) gives 0/0=NaN, which is the desired
result. The variance of X is undefined if and only if X contains less than
2 numbers.
In most numerical applications, NaN's should be simply skipped. Therefore,
it is efficient to skip NaN's in the default case. In the other cases, the
NaN's can still be checked explicitely. This could eventually result in a
more readable code and in improved performance, too.
Installing the NaN-tb with Octave:
----------------------------------
a) You need repmat.m (e.g. from P.Kienzle's MATCOMPAT)
If you havenot installed it yet, you should do it now.
b) extract files from NaNnnn.tar.gz and move them into
.../octave/.../m/statistics/base/
c) Alternatively, the files can be moved into any other directory; but you
must remove from .../octave/.../m/statistics/base/
mean.m, meansq.m, median.m, moment.m, skewness.m, kurtosis.m, std.m, var.m
and from .../source_forge/.../statistics/*
zscore.m, mad.m, geomean.m, harmmean.m
d) (re-)start Octave and run NANINSTTEST.
This checks whether all previous functions have been replaced
Installing the NaN-tb for Matlab:
----------------------------------
Ensure that the NaN-directory
没有合适的资源?快使用搜索试试~ 我知道了~
biosig4octmat-1.80.zip
共428个文件
m:342个
png:23个
txt:8个
需积分: 13 3 下载量 47 浏览量
2021-04-27
10:54:59
上传
评论
收藏 4.19MB ZIP 举报
温馨提示
BioSig是一个用于处理生物医学信号(EEG, ECG等)的软件库,使用Matlab, Octave, C/ c++和Python。大约支持50种不同的数据格式。
资源推荐
资源详情
资源评论
收起资源包目录
biosig4octmat-1.80.zip (428个子文件)
xmldata.c 5KB
xml_findstr.c 3KB
regexp.cc 28KB
regexprep.cc 9KB
mat2cell.cc 6KB
__xmldata__.cc 5KB
bitand.cc 5KB
sum1skipnan.cc 5KB
sumskipnan.cc 5KB
CHANGELOG 39KB
sum1skipnan.cpp 7KB
sumskipnan.cpp 7KB
CREDITS 1KB
units.csv 11KB
xml_findstr.dll 8KB
FAQ 121B
sviewer.fig 82KB
sviewer_fileinfo.fig 35KB
sviewer_display.fig 34KB
sviewer_channel_conf.fig 22KB
sviewer_channel.fig 12KB
GPL 15KB
HISTORY 188B
sviewer.htm 10KB
detection.htm 4KB
shortcuts.htm 3KB
introduction.htm 3KB
loadevent.htm 975B
menu.htm 780B
index.htm 472B
INDEX 3KB
INDEX 651B
INDEX 381B
INSTALL 2KB
INSTALL 1KB
INSTALL 697B
LICENSE 18KB
LICENSE 794B
sopen.m 379KB
plota.m 84KB
sviewer.m 76KB
viewedf.m 74KB
sread.m 62KB
scpopen.m 53KB
getfiletype.m 51KB
iopen.m 47KB
mvar.m 29KB
sload.m 28KB
cntopen.m 28KB
findclassifier2.m 24KB
mwfopen.m 24KB
bkropen.m 21KB
opendicom.m 19KB
save2bkr.m 17KB
tfmvar.m 15KB
train_sc.m 15KB
sinvest1.m 14KB
sinvest1.m 14KB
xml_parser.m 14KB
findclassifier1.m 14KB
corrcoef.m 12KB
nqrsdetect.m 12KB
aar.m 11KB
aar.m 11KB
iread.m 11KB
sclose.m 11KB
qrscorr.m 11KB
detpatch.m 11KB
matread.m 10KB
interp1.m 10KB
bci4eval.m 9KB
save2txt.m 9KB
fc0.m 9KB
sviewer_channel_conf.m 9KB
save2gdf.m 9KB
openxml.m 9KB
str2double.m 9KB
desatur.m 8KB
str2double.m 8KB
swrite.m 8KB
make_cc7.m 8KB
nantest.m 8KB
sxmlread.m 8KB
aarmam.m 8KB
ectbcorr.m 8KB
aarmam.m 8KB
sviewer_display.m 8KB
view_ui.m 8KB
sview.m 7KB
make_cc_tc2004.m 7KB
findclassifier.m 7KB
datestr.m 7KB
criteria4asyncbci.m 7KB
sviewer_channel.m 7KB
test_sc.m 7KB
gdbc.m 7KB
amarma.m 7KB
physicalunits.m 6KB
tlvread.m 6KB
heartratevariability.m 6KB
共 428 条
- 1
- 2
- 3
- 4
- 5
资源评论
lyswp
- 粉丝: 3
- 资源: 27
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功