test_ks.m
来自「wave cluster for biomedical signal proce」· M 代码 · 共 22 行
M
22 行
function [KSmax] = test_ks(x)
%
% Calculates the CDF (expcdf)
[y_expcdf,x_expcdf]=cdfcalc(x);
%
% The theoretical CDF (theocdf) is assumed to be normal
% with unknown mean and sigma
zScores = (x_expcdf - mean(x))./std(x);
theocdf = normcdf(zScores , 0 , 1);
%
% Compute the Maximum distance: max|S(x) - theocdf(x)|.
%
delta1 = y_expcdf(1:end-1) - theocdf; % Vertical difference at jumps approaching from the LEFT.
delta2 = y_expcdf(2:end) - theocdf; % Vertical difference at jumps approaching from the RIGHT.
deltacdf = abs([delta1 ; delta2]);
KSmax = max(deltacdf);
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?