資源簡介
經典的時間序列符號化算法SAX,該算法通過將一條時間序列等區間劃分,利用每個區間的均值代表該區間序列,進而采用相應的符號進行描述,該算法可以實現時間序列的符號化表示,達到降維的目的,并能夠通過MATLAB進行可視化描述

代碼片段和文件信息
%?Copyright?and?terms?of?use?(DO?NOT?REMOVE):
%?The?code?is?made?freely?available?for?non-commercial?uses?only?provided?that?the?copyright?
%?header?in?each?file?not?be?removed?and?suitable?citation(s)?(see?below)?be?made?for?papers?
%?published?based?on?the?code.
%
%?The?code?is?not?optimized?for?speed?and?we?are?not?responsible?for?any?errors?that?might
%?occur?in?the?code.
%
%?The?copyright?of?the?code?is?retained?by?the?authors.??By?downloading/using?this?code?you
%?agree?to?all?the?terms?stated?above.
%
%???[1]?Lin?J.?Keogh?E.?Lonardi?S.?&?Chiu?B.?
%???“A?Symbolic?Representation?of?Time?Series?with?Implications?for?Streaming?Algorithms.“?
%???In?proceedings?of?the?8th?ACM?SIGMOD?Workshop?on?Research?Issues?in?Data?Mining?and?
%???Knowledge?Discovery.?San?Diego?CA.?June?13?2003.?
%
%
%???[2]?Lin?J.?Keogh?E.?Patel?P.?&?Lonardi?S.?
%???“Finding?Motifs?in?Time?Series“.?In?proceedings?of?the?2nd?Workshop?on?Temporal?Data?Mining?
%???at?the?8th?ACM?SIGKDD?International?Conference?on?Knowledge?Discovery?and?Data?Mining.?
%???Edmonton?Alberta?Canada.?July?23-26?2002
%
%?This?function?demonstrates?that?mindist?lower-bounds?the?true?euclidean?distance
%
%?Copyright?(c)?2003?Eamonn?Keogh?Jessica?Lin?Stefano?Lonardi?Pranav?Patel?Li?Wei.??All?rights?reserved.
%
function?mindist_demo
temp?=?sin(0:0.32:20)‘;??????????????????%?make?a?long?sine?wave
time_series_A?=?temp([1:32]);???????????%?make?one?test?time?series?from?the?sine?wave
time_series_B?=?temp([12:43]);??????????%?make?another?test?time?series?from?the?sine?wave
time_series_A?=?(time_series_A?-?mean(time_series_A))?/?std(time_series_A);
time_series_B?=?(time_series_B?-?mean(time_series_B))?/?std(time_series_B);
alphabet_size?=?4;?%?Choose?an?alphabet?size
plot(?[time_series_A??time_series_B])?%?View?the?test?time?series
%?Now?let?us?create?a?SAX?representation?of?the?time?series
sax_version_of_A?=?timeseries2symbol(time_series_A328?alphabet_size)
sax_version_of_B?=?timeseries2symbol(time_series_B328?alphabet_size)
%?compute?the?euclidean?distance?between?the?time?series
euclidean_distance_A_and_B?=?sqrt(sum((time_series_A?-?time_series_B).^2))
%?compute?the?lower?bounding?distance?between?the?time?series
min_dist(sax_version_of_A?sax_version_of_B?alphabet_size4)
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件????????4382??2006-04-21?12:23??SAX\min_dist.m
?????文件????????2344??2006-04-21?12:23??SAX\mindist_demo.m
?????文件????????8454??2003-11-26?12:28??SAX\README.txt
?????文件???????33280??2006-04-22?14:19??SAX\SAX.doc
?????文件????????5432??2015-09-25?09:11??SAX\sax_demo.m
?????文件???????17408??2006-04-21?11:57??SAX\sax_to_20.xls
?????文件????????6082??2006-04-21?12:24??SAX\symbolic_visual.m
?????文件????????8033??2006-04-21?12:17??SAX\timeseries2symbol.m
評論
共有 條評論