Mercurial > forge
changeset 9422:48fcba9e9a29 octave-forge
improve docu
author | schloegl |
---|---|
date | Fri, 10 Feb 2012 09:56:25 +0000 |
parents | 8d2b4cc5c0a1 |
children | 1aba1694a5bd |
files | extra/NaN/inst/kappa.m extra/NaN/inst/xcovf.m |
diffstat | 2 files changed, 17 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/extra/NaN/inst/kappa.m Fri Feb 10 09:50:15 2012 +0000 +++ b/extra/NaN/inst/kappa.m Fri Feb 10 09:56:25 2012 +0000 @@ -21,7 +21,8 @@ % MI Mutual information or transfer information (in [bits]) % X is a struct containing all the fields above % For two classes, a number of additional summary statistics including -% TPR, FPR, FDR, PPV, NPF, F1, dprime, Matthews Correlation coefficient (MCC), Specificity and Sensitivity +% TPR, FPR, FDR, PPV, NPF, F1, dprime, Matthews Correlation coefficient (MCC) or +% Phi coefficient (PHI=MCC), Specificity and Sensitivity % are provided. Note, the positive category must the larger label (in d and c), otherwise % the confusion matrix becomes transposed and the summary statistics are messed up. % @@ -177,6 +178,7 @@ X.NPV = H(1,1) / sum(H(:,1)); X.FDR = H(1,2) / sum(H(:,2)); X.MCC = det(H) / sqrt(prod([sum(H), sum(H')])); + X.PHI = X.MCC; X.F1 = 2 * X.TP / (sum(H(2,:)) + sum(H(:,2))); X.Sensitivity = X.TPR; %% hit rate, recall X.Specificity = 1 - X.FPR;
--- a/extra/NaN/inst/xcovf.m Fri Feb 10 09:50:15 2012 +0000 +++ b/extra/NaN/inst/xcovf.m Fri Feb 10 09:56:25 2012 +0000 @@ -10,10 +10,22 @@ % [C,N,LAGS] = xcovf(X,Y,MAXLAG,SCALEOPT); % calculates the crosscorrelation function between X and Y % +% SCALEOPT [character string] specifies the type of scaling applied +% to the correlation vector (or matrix). is one of: +% 'none' return the unscaled correlation, R, +% 'biased' return the biased average, R/N, +% 'unbiased' return the unbiassed average, R(k)/(N-|k|), +% 'coeff' return the correlation coefficient, R/(rms(x).rms(y)), +% where "k" is the lag, and "N" is the length of X. +% If omitted, the default value is "none". +% If Y is supplied but does not have the ame length as X, +% scale must be "none". +% +% % see also: COVM, XCORR % $Id$ -% Copyright (C) 2005,2010 by Alois Schloegl <alois.schloegl@gmail.com> +% Copyright (C) 2005,2010,2011 by Alois Schloegl <alois.schloegl@gmail.com> % This function is part of the NaN-toolbox % http://pub.ist.ac.at/~schloegl/matlab/NaN/ @@ -103,3 +115,4 @@ else warning('invalid SCALEOPT - not supported'); end; +