a b/Supporting Functions/HjorthParameters.m
1
function [mobility,complexity] = HjorthParameters(xV)
2
% [mobility,complexity] = HjorthParameters(xV)
3
% HJORTHPARAMETERS computes the Hjorth parameters mobility and complexity.
4
% INPUTS:
5
% - xV          : The given scalar time series (vector of size n x 1).
6
% OUTPUTS
7
% - mobility
8
%========================================================================
9
%     <HjorthParameters.m>, v 1.0 2010/02/11 22:09:14  Kugiumtzis & Tsimpiris
10
%     This is part of the MATS-Toolkit http://eeganalysis.web.auth.gr/
11
12
%========================================================================
13
% Copyright (C) 2010 by Dimitris Kugiumtzis and Alkiviadis Tsimpiris 
14
%                       <dkugiu@gen.auth.gr>
15
16
%========================================================================
17
% Version: 1.0
18
19
% LICENSE:
20
%     This program is free software; you can redistribute it and/or modify
21
%     it under the terms of the GNU General Public License as published by
22
%     the Free Software Foundation; either version 3 of the License, or
23
%     any later version.
24
%
25
%     This program is distributed in the hope that it will be useful,
26
%     but WITHOUT ANY WARRANTY; without even the implied warranty of
27
%     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
28
%     GNU General Public License for more details.
29
%
30
%     You should have received a copy of the GNU General Public License
31
%     along with this program. If not, see http://www.gnu.org/licenses/>.
32
33
%=========================================================================
34
% Reference : D. Kugiumtzis and A. Tsimpiris, "Measures of Analysis of Time Series (MATS): 
35
%             A Matlab  Toolkit for Computation of Multiple Measures on Time Series Data Bases",
36
%             Journal of Statistical Software, in press, 2010
37
38
% Link      : http://eeganalysis.web.auth.gr/
39
%========================================================================= 
40
n = length(xV);
41
dxV = diff([0;xV]);
42
ddxV = diff([0;dxV]);
43
mx2 = mean(xV.^2);
44
mdx2 = mean(dxV.^2);
45
mddx2 = mean(ddxV.^2);
46
47
mob = mdx2 / mx2;
48
complexity = sqrt(mddx2 / mdx2 - mob);
49
mobility = sqrt(mob);