-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain_MixFHMM.m
88 lines (70 loc) · 2.28 KB
/
main_MixFHMM.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Clustering and segmentation of time series (including with regime
% changes) by mixture of gaussian Hidden Markov Models (MixFHMMs) and the EM algorithm; i.e functional data
% clustering and segmentation
%
%
%
%
% by Faicel Chamroukhi, 2009
%
%% Please cite the following references for this code
%
% @InProceedings{Chamroukhi-IJCNN-2011,
% author = {F. Chamroukhi and A. Sam\'e and P. Aknin and G. Govaert},
% title = {Model-based clustering with Hidden Markov Model regression for time series with regime changes},
% Booktitle = {Proceedings of the International Joint Conference on Neural Networks (IJCNN), IEEE},
% Pages = {2814--2821},
% Adress = {San Jose, California, USA},
% year = {2011},
% month = {Jul-Aug},
% url = {https://chamroukhi.com/papers/Chamroukhi-ijcnn-2011.pdf}
% }
%
% @PhdThesis{Chamroukhi_PhD_2010,
% author = {Chamroukhi, F.},
% title = {Hidden process regression for curve modeling, classification and tracking},
% school = {Universit\'e de Technologie de Compi\`egne},
% month = {13 december},
% year = {2010},
% type = {Ph.D. Thesis},
% url ={https://chamroukhi.com/papers/FChamroukhi-Thesis.pdf}
% }
%
% @article{Chamroukhi-FDA-2018,
% Journal = {Wiley Interdisciplinary Reviews: Data Mining and Knowledge Discovery},
% Author = {Faicel Chamroukhi and Hien D. Nguyen},
% Note = {DOI: 10.1002/widm.1298.},
% Volume = {},
% Title = {Model-Based Clustering and Classification of Functional Data},
% Year = {2019},
% Month = {to appear},
% url = {https://chamroukhi.com/papers/MBCC-FDA.pdf}
% }
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
clear
close all;
clc;
%% Model specification
K = 3;% number of clusters
R = 3;% number of regimes (HMM states)
% % options
%variance_type = 'common';
variance_type = 'free';
ordered_states = 1;
total_EM_tries = 1;
max_iter_EM = 1000;
init_kmeans = 1;
threshold = 1e-6;
verbose = 1;
%% toy time series with regime changes
load simulated_data.mat
Y; %
% [n, m] = size(Y);
% n: nbr of time sries
% m: number of observations
%%
mixFHMM = learn_MixFHMM(Y, K , R, ...
variance_type, ordered_states, total_EM_tries, max_iter_EM, init_kmeans, threshold, verbose);
%%
show_mixFHMM_results(Y, mixFHMM)