资源简介
SAX符号化序列范例源码
--------------------
timeseries2symbol.m:
--------------------
This function takes in a time series and convert it to string(s).
There are two options:
1. Convert the entire time series to ONE string
2. Use sliding windows, extract the subsequences and convert these subsequences to strings
For the first option, simply enter the length of the time series as "N"
ex. We have a time series of length 32 and we want to convert it to a 8-symbol string,
with alphabet size 3:
timeseries2symbol(data, 32, 8, 3)
For the second option, enter the desired sliding window length as "N"
ex. We have a time series of length 32 and we want to extract subsequences of length 16 using
sliding windows, and convert the subsequences to 8-symbol strings, with alphabet size 3:
timeseries2symbol(data, 16, 8, 3)
Input:
data is the raw time series.
N is the length of sliding window (use the length of the raw time series
instead if you don't want to have sliding windows)
n is the number of symbols in the low dimensional approximation of the sub sequence.
alphabet_size is the number of discrete symbols. 2 <= alphabet_size <= 10, although alphabet_size = 2 is a
special "useless" case.
Output:
symbolic_data: matrix of symbolic data (no-repetition). If consecutive subsequences
have the same string, then only the first occurrence is recorded, with
a pointer to its location stored in "pointers"
pointers: location of the first occurrences of the strings
N/n must be an integer, otherwise the program will give a warning, and abort.
The variable "win_size" is assigned to N/n, this is the number of data points on the raw
time series that will be mapped to a single symbol, and can be imagined as the
"compression rate".
The symbolic data is returned in "symbolic_data", with pointers to th
代码片段和文件信息
% 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)
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 2344 2006-04-21 12:23 SAX_2006_ver\mindist_demo.m
文件 4382 2006-04-21 12:23 SAX_2006_ver\min_dist.m
文件 8454 2003-11-26 12:28 SAX_2006_ver\README.txt
文件 33280 2006-04-22 14:19 SAX_2006_ver\SAX.doc
文件 5249 2006-04-21 13:32 SAX_2006_ver\sax_demo.m
文件 17408 2006-04-21 11:57 SAX_2006_ver\sax_to_20.xls
文件 6082 2006-04-21 12:24 SAX_2006_ver\symbolic_visual.m
文件 8033 2006-04-21 12:17 SAX_2006_ver\timeseries2symbol.m
目录 0 2006-04-22 14:20 SAX_2006_ver\
- 上一篇:周立功 液晶转LVDS信号板
- 下一篇:CNN VivadoHLS
相关资源
- 对任意输入的一段英文,为每个字符
- 傅里叶特征描述子图像匹配
- 光伏三相逆变的有功无功调节锁相环
- visual foxpro 9序列号
- 网格序列法_三角剖分_插值光滑_等高
- 光流图像配准
- SVM with mosek for banana
- 应用牛顿法求方程cos(x)cosh(x)-
- 电动汽车有序充放电.rar
- 二自由度机械臂模糊PID控制.zip
- Unity相机画面渲染序列帧插件
- vmware workstations 15 pro序列号
- ldpc完整的系统编译仿真
- 降维的相关方法
- 天宝GPS解算软件TGO1.62序列号
- 图像融合代码
- attachment_1487958_16b_win64_2017-05-10
- FMCW Waveform Design.rar
- 基于quartus的m序列产生
- e2esoft VCam最新可用的注册码/序列号
- 自适应信号 利用自适应信号分离器,
- 车牌识别.rar
- 2011经典EPSDE文章源代码
- 动态避障仿真.rar
- 群晖序列号 MAC 算号 Synology-mod-new
- Neural Network Design Demonstration
- SharePointServer2016企业版Enterprise序列号
- Bursa 7参数的精确算法
- Think Cell Key 序列号 有效期至2019-01-1
- 小鸟飞行序列帧动画
评论
共有 条评论