數(shù)據(jù)的預(yù)處理

平滑處理

x = xlsread('examp03_02.xls');%從文件讀取數(shù)據(jù)
price = x(:,4)';              %提取矩陣x的第四列數(shù)據(jù),即收盤價數(shù)據(jù)
figure;                       %新建一個圖形窗口
plot(price,'k','LineWidth',2);%繪制收盤價曲線圖,黑色實線,線寬為2

xlabel('觀測序號'); ylabel('上海股市日收盤價');%x軸y軸標(biāo)簽

output1 = smoothts(price,'b',30);
output2 = smoothts(price,'b',100);
figure;
plot(price,'.');
hold on
plot(output1,'k','LineWidth',2);
plot(output2,'k-.','LineWidth',2);
xlabel('觀測序號'); ylabel('Box method');
legend('原始散點','平滑曲線(窗寬30)','平滑曲線(窗寬100)','location','northwest');

output3 = smoothts(price,'g',30);
output4 = smoothts(price,'g',100,100);
figure;
plot(price,'.');
hold on
plot(output3,'k','LineWidth',2);
plot(output4,'k-.','LineWidth',2);
xlabel('觀測序號'); ylabel('Gaussian window method');
legend('原始散點','平滑曲線(窗寬30,標(biāo)準(zhǔn)差0.65)',...
          '平滑曲線(窗寬100,標(biāo)準(zhǔn)差100)','location','northwest');

output5 = smoothts(price,'e',30);
output6 = smoothts(price,'e',100);
figure;
plot(price,'.');
hold on
plot(output5,'k','LineWidth',2);
plot(output6,'k-.','LineWidth',2);
xlabel('觀測序號'); ylabel('Exponential method');
legend('原始散點','平滑曲線(窗寬30)','平滑曲線(窗寬100)','location','northwest');

數(shù)據(jù)的標(biāo)準(zhǔn)化變換

對于多元數(shù)據(jù),當(dāng)各變量的量綱和數(shù)量級不一致時,往往需要對數(shù)據(jù)進行變換處理,以消除對量綱和數(shù)量級的限制,以便進行后續(xù)的統(tǒng)計分析。
極差歸一化變換rscore函數(shù)[r,xmin,xrange]=rscore(X)、標(biāo)準(zhǔn)化變換函數(shù)zscore函數(shù)[Z,mu,siga]=zscore(X)

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容