📄 eda.m
字号:
function eda(sp)
%EDA Exploratory Data Analysis
% eda(sp) : sp is the time-series data
%
& Author: A. Swami, Jan 1995
disp('-------- 1 – data and histogram')
figure(1)
subplot(211), plot(1:length(sp),sp),grid,
subplot(212), hist(sp), grid
disp('-------- 2 – Summary stats')
c1 = mean(sp);
c2 = cumest(sp,2);
c3 = cumest(sp,3) / c2^(3/2);
c4 = cumest(sp,4) / c2^2;
fprintf(' Mean %g\n',c1);
fprintf(' Variance %g\n',c2);
fprintf(' Skewness (normalized) %g\n', c3);
fprintf(' Kurtosis (normalized) %g\n', c4);
disp('-------- 3 – power spectra and harmonic models')
figure(2)
[p2,a2,b2] = harmest(sp, 30, 0, 'u', 256, 2);
r = cplxpair(roots(a2));
disp('Estimated cycles')
a = angle(r);
yest = a*0;
ind = find(a ~= 0) ;
yest(ind) = (2*pi) * ones(size(ind)) ./ angle(r(ind)) ;
yest
disp('-------- 4 – gaussianity and linearity tests')
glstat(sp, .51, length(sp) ) ;
disp('-------- 5 – the bispectrum')
figure(3)
[Bspec, w] = bispeci(sp, 25); % 25 lags
%pcolor(w,w,abs(Bspec)), shading('interp') % nice, slow
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -