├── HCTSA_generation ├── .gitignore ├── _skipUserInput │ └── input.m ├── createDataAndHCTSAMat.m ├── runScript.m ├── systemConfigs │ ├── generateAutoregressiveConfigs.m │ ├── generateAutoregressiveConfigs2.m │ ├── generateBimodalConfigs.m │ ├── generateLogisticMapConfigs.m │ ├── generateLorenzConfigs.m │ ├── generateLorenzConfigs2.m │ ├── generateMackeyGlassConfigs.m │ ├── generateNoisySineWithLinearTrendConfigs.m │ ├── generateNoisySineWithLinearTrendConfigs2.m │ ├── generateNoisySineWithLinearTrendConfigs3.m │ ├── generateNoisySineWithMeanShiftConfigs.m │ ├── generatePopulationGrowthConfigs.m │ ├── generatePopulationGrowthConfigs2.m │ ├── generatePowernoiseConfigs.m │ ├── generatePredatorPreyConfigs.m │ ├── generatePredatorPreyConfigs2.m │ ├── generateRosslerConfigs.m │ ├── generateRosslerConfigs2.m │ ├── generateStochasticSineMapConfigs.m │ ├── generateStochasticSineMapConfigs2.m │ ├── generateVanDerPolConfigs.m │ └── generateVanDerPolConfigs_varyLenFsEta.m └── systemFunctions │ ├── autoregressive.m │ ├── bimodal.m │ ├── logisticMap.m │ ├── lorenzAtt.m │ ├── mackeyglass │ ├── mackeyglass.m │ ├── mackeyglass_eq.m │ └── mackeyglass_rk4.m │ ├── noisySineWithLinearTrend.m │ ├── noisySineWithMeanShift.m │ ├── populationGrowth.m │ ├── postProcessing │ ├── PP_LyapunovExponent.m │ ├── PP_addNoise.m │ ├── PP_downsample.m │ └── PP_removeTransients.m │ ├── predatorPrey.m │ ├── rossler.m │ ├── stochasticSineMap.m │ ├── vanDerPol.m │ └── vanDerPol_L.m ├── LICENSE.txt ├── MkSg_AR.m ├── MkSg_Flow.m ├── MkSg_SelfAffine.m ├── MkSg_map.m ├── MkSg_noise.m ├── MkSg_sine.m ├── README.md ├── functions ├── BF_thetime.m ├── F_ACT.m ├── F_DHO.m ├── F_DPend.m ├── F_Dufftwell.m ├── F_Dufftwowell.m ├── F_DvdP.m ├── F_FBruss.m ├── F_Jerk1.m ├── F_Jerk2.m ├── F_Jerk3.m ├── F_ShawvdP.m ├── F_Sprott3dcf_A.m ├── F_Sprott3dcf_B.m ├── F_Sprott3dcf_C.m ├── F_Sprott3dcf_D.m ├── F_Sprott3dcf_E.m ├── F_Sprott3dcf_F.m ├── F_Sprott3dcf_G.m ├── F_Sprott3dcf_H.m ├── F_Sprott3dcf_I.m ├── F_Sprott3dcf_J.m ├── F_Sprott3dcf_K.m ├── F_Sprott3dcf_L.m ├── F_Sprott3dcf_M.m ├── F_Sprott3dcf_N.m ├── F_Sprott3dcf_O.m ├── F_Sprott3dcf_P.m ├── F_Sprott3dcf_Q.m ├── F_Sprott3dcf_R.m ├── F_Sprott3dcf_S.m ├── F_VanderPol.m ├── F_burkeshaw.m ├── F_chen.m ├── F_chua.m ├── F_complxbutfly.m ├── F_dblscroll.m ├── F_ddp.m ├── F_diffnlorenz.m ├── F_drivenpend.m ├── F_duffvdp.m ├── F_hadley.m ├── F_halvorsencsa.m ├── F_henonheiles.m ├── F_labyrinth.m ├── F_lfrbms.m ├── F_lorenz.m ├── F_moorespiegel.m ├── F_nosehoover.m ├── F_powernoise.m ├── F_rabfab.m ├── F_rayduff.m ├── F_rmpnoise.m ├── F_rossler.m ├── F_rucklidge.m ├── F_simpccf.m ├── F_simpdcf.m ├── F_simpplcf.m ├── F_simpqcf.m ├── F_sprottJD0.m ├── F_sprottJD1.m ├── F_sprottJD2.m ├── F_sprottJD3.m ├── F_sprottJD4.m ├── F_sprottJD5.m ├── F_sprottJD6.m ├── F_sprottJD7.m ├── F_thomascsa.m ├── F_ueda.m ├── F_vdp.m └── F_windmi.m └── startup.m /HCTSA_generation/.gitignore: -------------------------------------------------------------------------------- 1 | data -------------------------------------------------------------------------------- /HCTSA_generation/_skipUserInput/input.m: -------------------------------------------------------------------------------- 1 | function out = input(str, keyword) 2 | % Dummy function to let all calculations run through without user 3 | % intervention. 4 | 5 | out = 'y'; 6 | end -------------------------------------------------------------------------------- /HCTSA_generation/createDataAndHCTSAMat.m: -------------------------------------------------------------------------------- 1 | function createDataAndHCTSAMat(config) 2 | 3 | % createDataAndHCTSAMat 4 | % 5 | % Given information on which time series generator to use, now many time 6 | % series to generate of which length, etc., createDataAndHCTSAMat 7 | % generates the time series. It then generates the files initialisation 8 | % files for HCTSA and an initialised HCTSA which are both saved into a 9 | % folder inside the data folder specified in /config/globalParameters.mat. 10 | % HCTSA is _not_ run here. 11 | % 12 | %---INPUTS: 13 | % variableName, description 14 | % 15 | % ------------------------------------------------------------------------------ 16 | % Copyright (C) 2017 17 | % Carl H. Lubba 18 | % Ben D. Fulcher 19 | % 20 | % If you use this code for your research, please cite: 21 | % B. D. Fulcher, M. A. Little, N. S. Jones, "Highly comparative time-series 22 | % analysis: the empirical structure of time series and their methods", 23 | % J. Roy. Soc. Interface 10(83) 20130048 (2013). DOI: 10.1098/rsif.2013.0048 24 | % 25 | % This work is licensed under the Creative Commons 26 | % Attribution-NonCommercial-ShareAlike 4.0 International License. To view a copy of 27 | % this license, visit http://creativecommons.org/licenses/by-nc-sa/4.0/ or send 28 | % a letter to Creative Commons, 444 Castro Street, Suite 900, Mountain View, 29 | % California, 94041, USA. 30 | % ------------------------------------------------------------------------------ 31 | 32 | % get save locations and some other global directions 33 | dataFolder = 'data'; 34 | if exist(dataFolder, 'dir') ~= 7 35 | mkdir(dataFolder); 36 | end 37 | 38 | %---------------------------------------------------------------------- 39 | % Execute stuff ------------------------------------------------------- 40 | %---------------------------------------------------------------------- 41 | 42 | % time series parameters----------------------------------------------- 43 | 44 | functionName = config.functionName; 45 | signalNames = config.signalNames; 46 | 47 | nRealizations = config.nRealizations; 48 | 49 | paramNames = config.paramNames; 50 | params = config.params; 51 | 52 | timeParamNames = config.timeParamNames; 53 | timeParams = config.timeParams; 54 | 55 | % create folder to save into------------------------------------------- 56 | 57 | paramsFolderName = []; 58 | for paramInd = 1:length(params) 59 | 60 | paramVals = params{paramInd}; 61 | 62 | switch (length(paramVals)) 63 | case 1 64 | paramsFolderName = [paramsFolderName, ... 65 | paramNames{paramInd}, '=', ... 66 | num2str(paramVals), '_']; 67 | case 2 68 | paramsFolderName = [paramsFolderName, ... 69 | paramNames{paramInd}, '=', ... 70 | num2str(paramVals(1)), '-', ... 71 | num2str(paramVals(2)), '_']; 72 | otherwise 73 | paramsFolderName = [paramsFolderName, ... 74 | paramNames{paramInd}, '=']; 75 | if length(paramVals) <= 5 76 | for paramValInd = 1:length(paramVals) 77 | paramsFolderName = [paramsFolderName, ... 78 | num2str(paramVals(paramValInd)), ',']; 79 | end 80 | else 81 | paramsFolderName = [paramsFolderName, ... 82 | 'discreteSetInRange', ... 83 | num2str(paramVals(1)), ',...,', ... 84 | num2str(paramVals(end))]; 85 | end 86 | paramsFolderName = [paramsFolderName, '_']; 87 | end 88 | 89 | end 90 | 91 | timeParamsFolderName = []; 92 | for timeParamInd = 1:length(timeParams) 93 | timeParamsFolderName = [timeParamsFolderName, ... 94 | cell2mat(timeParamNames(timeParamInd)), '=', ... 95 | num2str(timeParams(timeParamInd))]; 96 | 97 | if timeParamInd < length(timeParams) 98 | timeParamsFolderName = [timeParamsFolderName, '_']; 99 | end 100 | end 101 | 102 | if ~exist(dataFolder,'dir') 103 | mkdir(dataFolder) 104 | end 105 | 106 | numSignals = numel(signalNames); 107 | for signalInd =1:numSignals 108 | 109 | outputFolder{signalInd} = [dataFolder, '/', functionName, ... 110 | '_variable_', signalNames{signalInd}, '_', ... 111 | '_realizations=', num2str(nRealizations), '_', ... 112 | '_params_', paramsFolderName, ... 113 | '_timeParams_', timeParamsFolderName]; 114 | 115 | end 116 | 117 | % compose function call------------------------------------------------ 118 | 119 | % simulation time parameters 120 | timeParamsString = ''; 121 | for timeParamsInd = 1:length(timeParams) 122 | 123 | timeParamsString = [timeParamsString, ... 124 | num2str(timeParams(timeParamsInd))]; 125 | if timeParamsInd < length(timeParams) 126 | timeParamsString = [timeParamsString, ',']; 127 | end 128 | 129 | end 130 | 131 | % output variable 132 | timeSeriesDataCell = cell(numSignals, nRealizations); 133 | labelsCell = cell(numSignals, nRealizations); 134 | keywordsCell = cell(numSignals, nRealizations); 135 | 136 | % create nRealizations time series 137 | index = 1; 138 | for i = 1:nRealizations 139 | 140 | fprintf('generating %i th time series.\n', i); 141 | 142 | paramsString = ''; 143 | paramValues = []; 144 | for paramInd = 1:length(params) 145 | 146 | paramVals = params{paramInd}; 147 | 148 | switch (length(paramVals)) 149 | case 1 150 | paramVal = paramVals; 151 | case 2 152 | paramVal = paramVals(1) + ... 153 | rand * (paramVals(2) - paramVals(1)); 154 | otherwise 155 | paramVal = datasample(paramVals, 1); 156 | end 157 | 158 | %save parameter value to add it as a keyword 159 | paramValues = [paramValues, paramVal]; 160 | 161 | % compose function call substring 162 | paramsString = [paramsString, num2str(paramVal), ',']; 163 | 164 | end 165 | 166 | command = ['signal1 = ', functionName, '(', ... 167 | paramsString, timeParamsString, ');']; 168 | 169 | % run single signal generation 170 | eval(command); 171 | 172 | % check if orientation right, transpose if not 173 | if size(signal1,1) > size(signal1,2) 174 | signal1 = signal1'; 175 | end 176 | 177 | % add to signal, keyword and label cells 178 | nSignals = size(signal1,1); 179 | for signalInd = 1:nSignals 180 | 181 | % prepare addition to keyword and label cells 182 | labelString = [functionName, ',', cell2mat(signalNames(signalInd))]; 183 | keywordString = labelString; 184 | for paramInd = 1:length(params) 185 | keywordString = [keywordString, ',', ... 186 | paramNames{paramInd}, '=', ... 187 | num2str(paramValues(paramInd))]; 188 | end 189 | 190 | % add to cells 191 | timeSeriesDataCell{i, signalInd} = signal1(signalInd, :); 192 | labelsCell{i, signalInd} = [functionName, ',', ... 193 | cell2mat(signalNames(signalInd)), ',', num2str(index)]; 194 | keywordsCell{i, signalInd} = keywordString; 195 | 196 | index = index + 1; 197 | end 198 | 199 | end 200 | 201 | % potential post processing ------------------------------------------- 202 | if ismember('postprocessing', fieldnames(config)) 203 | 204 | numberOfPostprocessingSteps = numel(config.postprocessing); 205 | for signalInd = 1:numSignals 206 | 207 | tsd_temp = timeSeriesDataCell(:, signalInd); 208 | kw_temp = keywordsCell(:, signalInd); 209 | l_temp = labelsCell(:, signalInd); 210 | 211 | if numel(config.postprocessing) == 1 212 | [tsd_temp, l_temp, kw_temp] = ... 213 | config.postprocessing{1}(tsd_temp, l_temp, kw_temp); 214 | 215 | % try to get an additional info to add to folder name 216 | try 217 | [~, ~, ~, folderAdd] = config.postprocessing{1}(tsd_temp, l_temp, kw_temp); 218 | outputFolder{signalInd} = [outputFolder{signalInd}, folderAdd]; 219 | catch 220 | end 221 | else 222 | for ppStep = 1:numberOfPostprocessingSteps 223 | [tsd_temp, l_temp, kw_temp] = ... 224 | config.postprocessing{ppStep}(tsd_temp, l_temp, kw_temp); 225 | 226 | % try to get an additional info to add to folder name 227 | try 228 | [~, ~, ~, folderAdd] = config.postprocessing{1}(tsd_temp, l_temp, kw_temp); 229 | outputFolder{signalInd} = [outputFolder{signalInd}, folderAdd]; 230 | catch 231 | end 232 | 233 | end 234 | end 235 | 236 | timeSeriesDataCell(:, signalInd) = tsd_temp; 237 | keywordsCell(:, signalInd) = kw_temp; 238 | labelsCell(:, signalInd) = l_temp; 239 | 240 | end 241 | 242 | end 243 | 244 | % save things---------------------------------------------------------- 245 | % dataTrackerLocation = [dataFolder, '/', datasetTracker]; 246 | % try 247 | % outputFolders = importdata(dataTrackerLocation); 248 | % outputFolders = [outputFolders; outputFolder]; 249 | % outputFolders = unique(outputFolders, 'rows'); 250 | % catch 251 | % outputFolders = [outputFolder]; 252 | % end 253 | % save(dataTrackerLocation, 'outputFolders'); 254 | 255 | workingDir = pwd(); 256 | 257 | for signalInd = 1:numSignals 258 | 259 | % check if target directory exists 260 | if exist(outputFolder{signalInd},'dir') 261 | x = input('Same parameters already run, overwriting results? (Y/n)', 's'); 262 | if ~(isempty (x) || x == 'y' || x == 'Y') 263 | return 264 | end 265 | else 266 | mkdir(outputFolder{signalInd}) 267 | end 268 | 269 | chdir(outputFolder{signalInd}) 270 | 271 | timeSeriesData = timeSeriesDataCell(:, signalInd); 272 | keywords = keywordsCell(:, signalInd); 273 | labels = labelsCell(:, signalInd); 274 | 275 | save('INP_test.mat','timeSeriesData','keywords','labels'); 276 | save('TSconfig.mat','config'); 277 | 278 | % do HCTSA work-------------------------------------------------------- 279 | 280 | TS_Init('INP_test.mat'); 281 | 282 | % remove stochastic, pos-only, length dependent features 283 | TS_LocalClearRemove('raw', 'ops',[ ... 284 | % TS_GetIDs('tisean','raw','ops'), ... 285 | % TS_GetIDs('locdep','raw','ops'), ... 286 | % TS_GetIDs('posOnly','raw','ops'), ... 287 | TS_GetIDs('stochastic','raw','ops')],1); 288 | 289 | %go back to main dir--------------------------------------------------- 290 | chdir(workingDir); 291 | 292 | end 293 | 294 | end 295 | 296 | function runHCTSA(config) 297 | 298 | TS_compute(true,config.ts_ids,config.op_ids); 299 | 300 | end 301 | 302 | -------------------------------------------------------------------------------- /HCTSA_generation/runScript.m: -------------------------------------------------------------------------------- 1 | % Script to generate one specific dataset that can then be calculated. The 2 | % TSconfig struct points to one time series generator and includes the 3 | % desired parameters such as number of TS, parameter values, etc. 4 | % 5 | % ------------------------------------------------------------------------------ 6 | % Copyright (C) 2018 7 | % Carl H. Lubba 8 | % Ben D. Fulcher 9 | % 10 | % If you use this code for your research, please cite: 11 | % B. D. Fulcher, M. A. Little, N. S. Jones, "Highly comparative time-series 12 | % analysis: the empirical structure of time series and their methods", 13 | % J. Roy. Soc. Interface 10(83) 20130048 (2013). DOI: 10.1098/rsif.2013.0048 14 | % 15 | % This work is licensed under the Creative Commons 16 | % Attribution-NonCommercial-ShareAlike 4.0 International License. To view a copy of 17 | % this license, visit http://creativecommons.org/licenses/by-nc-sa/4.0/ or send 18 | % a letter to Creative Commons, 444 Castro Street, Suite 900, Mountain View, 19 | % California, 94041, USA. 20 | % ------------------------------------------------------------------------------ 21 | 22 | % time series and HCTSA configuration 23 | TSconfigs = {}; 24 | 25 | % deterministic oscillator 26 | % TSconfigs = horzcat(TSconfigs, generateVanDerPolConfigs()); 27 | 28 | % % generate one set of ridiculously long ts with high sampling rate. Cut/ 29 | % % downsample/ add noise later. 30 | % tsLens = [10000]; % [100, 300, 1000, 3000]; % [100, 300, 1000, 3000, 10000]; 31 | % FSs = [100]; % [1, 3, 10, 30, 100]; 32 | % etas = [0]; % [0.1, 0.3, 1, 3, 10]; % [0.1, 0.3, 1] 33 | % for tsLen = tsLens 34 | % for Fs = FSs 35 | % for eta = etas 36 | % TSconfigs = horzcat(TSconfigs, generateVanDerPolConfigs_varyLenFsEta(tsLen, Fs, eta)); 37 | % end 38 | % end 39 | % end 40 | 41 | % % stochastic 42 | % TSconfigs = horzcat(TSconfigs, generateNoisySineWithLinearTrendConfigs()); 43 | % TSconfigs = horzcat(TSconfigs, generateNoisySineWithLinearTrendConfigs2()); 44 | % TSconfigs = horzcat(TSconfigs, generateNoisySineWithLinearTrendConfigs3()); 45 | % TSconfigs = horzcat(TSconfigs, generateNoisySineWithMeanShiftConfigs()); 46 | % TSconfigs = horzcat(TSconfigs, generateAutoregressiveConfigs()); 47 | TSconfigs = horzcat(TSconfigs, generateAutoregressiveConfigs2()); 48 | % TSconfigs = horzcat(TSconfigs, generateBimodalConfigs()); 49 | % TSconfigs = horzcat(TSconfigs, generatePopulationGrowthConfigs()); 50 | % TSconfigs = horzcat(TSconfigs, generatePopulationGrowthConfigs2()); % increased beta-rage 51 | 52 | % % low dimensional chaos: maps 53 | % TSconfigs = horzcat(TSconfigs, generateLogisticMapConfigs()); 54 | % TSconfigs = horzcat(TSconfigs, generateStochasticSineMapConfigs()); 55 | TSconfigs = horzcat(TSconfigs, generateStochasticSineMapConfigs2()); 56 | % TSconfigs = horzcat(TSconfigs, generatePredatorPreyConfigs()); 57 | TSconfigs = horzcat(TSconfigs, generatePredatorPreyConfigs2()); % no alpha 58 | 59 | % % low dimensional chaos: flows 60 | % TSconfigs = horzcat(TSconfigs, generateLorenzConfigs()); 61 | TSconfigs = horzcat(TSconfigs, generateLorenzConfigs2()); 62 | % TSconfigs = horzcat(TSconfigs, generateRosslerConfigs()); 63 | % TSconfigs = horzcat(TSconfigs, generateRosslerConfigs2()); 64 | 65 | % % high dimensional chaos 66 | % TSconfigs = horzcat(TSconfigs, generateMackeyGlassConfigs()); % tau 10:40 now! 67 | 68 | % misc 69 | % TSconfigs = horzcat(TSconfigs, generatePowernoiseConfigs()); 70 | 71 | % jump to main dir and start computations 72 | for i = 1:length(TSconfigs) 73 | createDataAndHCTSAMat(TSconfigs{i}); 74 | end -------------------------------------------------------------------------------- /HCTSA_generation/systemConfigs/generateAutoregressiveConfigs.m: -------------------------------------------------------------------------------- 1 | function TSconfigs = generateAutoregressiveConfigs() 2 | % parameter values to generate the TSconfig for 3 | % tau [1:10] or 2 4 | % alpha [0.8, 0.999] or 0.9 5 | 6 | paramsCell = { ... 7 | {[1:10]; 0.9}, ... 1D tau 8 | {2; [0.8, 0.999]}, ... 1D alpha 9 | {[1:10]; [0.8, 0.999]}, ... 2D tau, alpha 10 | }; 11 | 12 | Ns = [ ... 13 | 100, ... 14 | 100, ... 15 | 400, ... 16 | ]; 17 | 18 | TSconfigs = {}; 19 | for paramsInd = 1:length(paramsCell) 20 | TSconfigs = horzcat(TSconfigs, generateAutoregressiveConfig(paramsCell{paramsInd}, Ns(paramsInd))); 21 | end 22 | 23 | end 24 | 25 | function config = generateAutoregressiveConfig(params, N) 26 | 27 | config.functionName = 'autoregressive'; 28 | config.signalNames = {'x'}; 29 | 30 | config.nRealizations = N; 31 | 32 | config.paramNames = {'tau', 'alpha'}; 33 | config.params = params; 34 | 35 | config.timeParamNames = {'steps'}; 36 | config.timeParams = [... 37 | 3500; ... signal steps 38 | ]; 39 | 40 | % config.postprocessing = ... 41 | % {@(timeSeriesData, labels, keywords) ... 42 | % PP_removeTransients(timeSeriesData, labels, keywords, 500)}; 43 | 44 | end -------------------------------------------------------------------------------- /HCTSA_generation/systemConfigs/generateAutoregressiveConfigs2.m: -------------------------------------------------------------------------------- 1 | function TSconfigs = generateAutoregressiveConfigs2() 2 | % parameter values to generate the TSconfig for 3 | % tau [1:10] or 2 4 | % alpha [0.8, 0.999] or 0.9 5 | 6 | paramsCell = { ... 7 | {[2:10]; 0.9}, ... 1D tau 8 | {2; [0.8, 0.999]}, ... 1D alpha 9 | {[2:10]; [0.8, 0.999]}, ... 2D tau, alpha 10 | }; 11 | 12 | Ns = [ ... 13 | 100, ... 14 | 100, ... 15 | 400, ... 16 | ]; 17 | 18 | TSconfigs = {}; 19 | for paramsInd = 1:length(paramsCell) 20 | TSconfigs = horzcat(TSconfigs, generateAutoregressiveConfig(paramsCell{paramsInd}, Ns(paramsInd))); 21 | end 22 | 23 | end 24 | 25 | function config = generateAutoregressiveConfig(params, N) 26 | 27 | config.functionName = 'autoregressive'; 28 | config.signalNames = {'x'}; 29 | 30 | config.nRealizations = N; 31 | 32 | config.paramNames = {'tau', 'alpha'}; 33 | config.params = params; 34 | 35 | config.timeParamNames = {'steps'}; 36 | config.timeParams = [... 37 | 3500; ... signal steps 38 | ]; 39 | 40 | % config.postprocessing = ... 41 | % {@(timeSeriesData, labels, keywords) ... 42 | % PP_removeTransients(timeSeriesData, labels, keywords, 500)}; 43 | 44 | end -------------------------------------------------------------------------------- /HCTSA_generation/systemConfigs/generateBimodalConfigs.m: -------------------------------------------------------------------------------- 1 | function TSconfigs = generateBimodalConfigs() 2 | % parameter values to generate the TSconfig for 3 | % delta [0 6] or 3 4 | % alpha [0 1] or 0.5 5 | 6 | paramsCell = { ... 7 | {[0 6]; 0.5}, ... 1D delta 8 | {3; [0 1]}, ... 1D alpha 9 | {[0 6]; [0 1]}, ... 2D delta, alpha 10 | }; 11 | 12 | Ns = [ ... 13 | 100, ... 14 | 100, ... 15 | 400, ... 16 | ]; 17 | 18 | TSconfigs = {}; 19 | for paramsInd = 1:length(paramsCell) 20 | TSconfigs = horzcat(TSconfigs, generateBimodalConfig(paramsCell{paramsInd}, Ns(paramsInd))); 21 | end 22 | 23 | end 24 | 25 | function config = generateBimodalConfig(params, N) 26 | 27 | config.functionName = 'bimodal'; 28 | config.signalNames = {'x'}; 29 | 30 | config.nRealizations = N; 31 | 32 | config.paramNames = {'delta', 'alpha'}; 33 | config.params = params; 34 | 35 | config.timeParamNames = {'steps'}; 36 | config.timeParams = [... 37 | 1000; ... signal steps 38 | ]; 39 | 40 | end -------------------------------------------------------------------------------- /HCTSA_generation/systemConfigs/generateLogisticMapConfigs.m: -------------------------------------------------------------------------------- 1 | function TSconfigs = generateLogisticMapConfigs() 2 | % parameter values to generate the TSconfig for 3 | % A [3.5 4] 4 | % x0 0.1 5 | 6 | paramsCell = { ... 7 | {[3.5 4]; 0.1}, ... 1D A 8 | }; 9 | 10 | Ns = [ ... 11 | 100, ... 12 | ]; 13 | 14 | TSconfigs = {}; 15 | for paramsInd = 1:length(paramsCell) 16 | TSconfigs = horzcat(TSconfigs, generateLogisticMapConfig(paramsCell{paramsInd}, Ns(paramsInd))); 17 | end 18 | 19 | end 20 | 21 | function config = generateLogisticMapConfig(params, N) 22 | 23 | config.functionName = 'logisticMap'; 24 | config.signalNames = {'x'}; 25 | 26 | config.nRealizations = N; 27 | 28 | config.paramNames = {'A','x0'}; 29 | config.params = params; 30 | 31 | config.timeParamNames = {'timeSteps'}; 32 | config.timeParams = [... 33 | 2000; ... signal steps 34 | ]; 35 | 36 | % config.postprocessing = {... 37 | % @(timeSeriesData, labels, keywords) ... 38 | % PP_removeTransients(timeSeriesData, labels, keywords, 500)}; %, ... 39 | % @(timeSeriesData, labels, keywords) ... 40 | % PP_LyapunovExponent(timeSeriesData, labels, keywords)}; 41 | 42 | end -------------------------------------------------------------------------------- /HCTSA_generation/systemConfigs/generateLorenzConfigs.m: -------------------------------------------------------------------------------- 1 | function TSconfigs = generateLorenzConfigs() 2 | % parameter values to generate the TSconfig for 3 | sigmaVar = [8, 15]; sigmaFix = 10; 4 | rVar = [27, 60]; rFix = 35; 5 | bVar = [1, 2.5]; bFix = 8/3; 6 | 7 | paramsCell = { ... 8 | {sigmaVar; rFix; bFix}, ... 1D sigma 9 | {sigmaFix; rVar; bFix}, ... 1D r 10 | {sigmaFix; rFix; bVar}, ... 1D b 11 | {sigmaVar; rVar; bFix}, ... 2D sigma, r 12 | {sigmaVar; rFix; bVar}, ... 2D sigma, b 13 | {sigmaFix; rVar; bVar}, ... 2D r, b 14 | {sigmaVar; rVar; bVar}, ... 3D sigma, r, b 15 | }; 16 | 17 | Ns = [ ... 18 | 100, ... 19 | 100, ... 20 | 100, ... 21 | 400, ... 22 | 400, ... 23 | 400, ... 24 | 1000, ... 25 | ]; 26 | 27 | TSconfigs = {}; 28 | for paramsInd = 1:length(paramsCell) 29 | TSconfigs = horzcat(TSconfigs, generateLorenzConfig(paramsCell{paramsInd}, Ns(paramsInd))); 30 | end 31 | 32 | end 33 | 34 | function config = generateLorenzConfig(params, N) 35 | 36 | config.functionName = 'lorenzAtt'; 37 | config.signalNames = {'x', 'y', 'z'}; 38 | 39 | config.nRealizations = N; 40 | 41 | config.paramNames = {'s', 'r', 'b'}; 42 | config.params = params; 43 | 44 | config.timeParamNames = {'timeSteps'}; 45 | config.timeParams = [... 46 | 3000; ... signal steps 47 | ]; 48 | 49 | end -------------------------------------------------------------------------------- /HCTSA_generation/systemConfigs/generateLorenzConfigs2.m: -------------------------------------------------------------------------------- 1 | function TSconfigs = generateLorenzConfigs2() 2 | % parameter values to generate the TSconfig for 3 | sigmaVar = [8, 30]; sigmaFix = 10; 4 | rVar = [35, 60]; rFix = 35; 5 | bVar = [1, 2.8]; bFix = 8/3; 6 | 7 | paramsCell = { ... 8 | {sigmaVar; rFix; bFix}, ... 1D sigma 9 | {sigmaFix; rVar; bFix}, ... 1D r 10 | {sigmaFix; rFix; bVar}, ... 1D b 11 | {sigmaVar; rVar; bFix}, ... 2D sigma, r 12 | {sigmaVar; rFix; bVar}, ... 2D sigma, b 13 | {sigmaFix; rVar; bVar}, ... 2D r, b 14 | {sigmaVar; rVar; bVar}, ... 3D sigma, r, b 15 | }; 16 | 17 | Ns = [ ... 18 | 100, ... 19 | 100, ... 20 | 100, ... 21 | 400, ... 22 | 400, ... 23 | 400, ... 24 | 1000, ... 25 | ]; 26 | 27 | TSconfigs = {}; 28 | for paramsInd = 1:length(paramsCell) 29 | TSconfigs = horzcat(TSconfigs, generateLorenzConfig(paramsCell{paramsInd}, Ns(paramsInd))); 30 | end 31 | 32 | end 33 | 34 | function config = generateLorenzConfig(params, N) 35 | 36 | config.functionName = 'lorenzAtt'; 37 | config.signalNames = {'x', 'y', 'z'}; 38 | 39 | config.nRealizations = N; 40 | 41 | config.paramNames = {'s', 'r', 'b'}; 42 | config.params = params; 43 | 44 | config.timeParamNames = {'timeSteps'}; 45 | config.timeParams = [... 46 | 5000; ... signal steps 47 | ]; 48 | 49 | end -------------------------------------------------------------------------------- /HCTSA_generation/systemConfigs/generateMackeyGlassConfigs.m: -------------------------------------------------------------------------------- 1 | function TSconfigs = generateMackeyGlassConfigs() 2 | % parameter values to generate the TSconfig for 3 | aVar = [0.15, 1.5]; aFix = 0.2; 4 | bVar = []; bFix = 0.1; 5 | tauVar =[10:40]; tauFix =17; 6 | 7 | paramsCell = { ... 8 | % {aVar; bFix; tauFix}, ... 1D a 9 | % {aFix; bVar; tauFix}, ... 1D b 10 | {aFix; bFix; tauVar}, ... 1D tau 11 | % {aVar; bVar; tauFix}, ... 2D a, b 12 | {aVar; bFix; tauVar}, ... 2D a, tau 13 | % {aFix; bVar; tauVar}, ... 2D b, tau 14 | % {aVar; bVar; tauVar}, ... 3D a, b, tau 15 | }; 16 | 17 | Ns = [ ... 18 | % 100, ... 19 | 100, ... 20 | 400, ... 21 | ]; 22 | 23 | TSconfigs = {}; 24 | for paramsInd = 1:length(paramsCell) 25 | TSconfigs = horzcat(TSconfigs, generateMackeyGlassConfig(paramsCell{paramsInd}, Ns(paramsInd))); 26 | end 27 | 28 | end 29 | 30 | 31 | function config = generateMackeyGlassConfig(params, N) 32 | 33 | config.functionName = 'mackeyglass'; 34 | config.signalNames = {'x'}; 35 | 36 | config.nRealizations = N; 37 | 38 | config.paramNames = {'a', 'b', 'tau'}; 39 | config.params = params; 40 | 41 | config.timeParamNames = {'n', 'dt'}; 42 | config.timeParams = [... 43 | 1200000; ... signal steps 44 | 0.01; ... dt 45 | ]; 46 | 47 | config.postprocessing = {... 48 | @(timeSeriesData, labels, keywords)... 49 | PP_removeTransients(timeSeriesData, labels, keywords, 200000), ... 50 | @(timeSeriesData, labels, keywords)... 51 | PP_downsample(timeSeriesData, labels, keywords, 150)}; 52 | 53 | end -------------------------------------------------------------------------------- /HCTSA_generation/systemConfigs/generateNoisySineWithLinearTrendConfigs.m: -------------------------------------------------------------------------------- 1 | function TSconfigs = generateNoisySineWithLinearTrendConfigs() 2 | % parameter values to generate the TSconfig for 3 | %T; [10 100] or 30 4 | %eta; [0 3] or 0 5 | %m; [-5 5] or 0 6 | 7 | paramsCell = { ... 8 | {[10 100]; 0; 0}, ... 1D T 9 | {30; [0 3]; 0}, ... 1D eta 10 | {30; 0; [-5 5]}, ... 1D m 11 | {[10 100]; [0 3]; 0}, ... 2D T, eta 12 | {30; [0 3]; [-5 5]}, ... 2D eta, m 13 | {[10 100]; 0; [-5 5]}, ... 2D T, m 14 | {[10 100]; [0 3]; [-5 5]}, ... 3D T, eta, m 15 | }; 16 | 17 | Ns = [ ... 18 | 100, ... 19 | 100, ... 20 | 100, ... 21 | 400, ... 22 | 400, ... 23 | 400, ... 24 | 1000, ... 25 | ]; 26 | 27 | TSconfigs = {}; 28 | for paramsInd = 1:length(paramsCell) 29 | TSconfigs = horzcat(TSconfigs, generateNoisySineWithLinearTrendConfig(paramsCell{paramsInd}, Ns(paramsInd))); 30 | end 31 | 32 | end 33 | 34 | function config = generateNoisySineWithLinearTrendConfig(params, N) 35 | 36 | config.functionName = 'noisySineWithLinearTrend'; 37 | config.signalNames = {'x'}; 38 | 39 | config.nRealizations = N; 40 | 41 | config.paramNames = {'T', 'eta', 'm'}; 42 | config.params = params; 43 | 44 | config.timeParamNames = {'steps'}; 45 | config.timeParams = [... 46 | 2500; ... signal steps 47 | ]; 48 | 49 | end -------------------------------------------------------------------------------- /HCTSA_generation/systemConfigs/generateNoisySineWithLinearTrendConfigs2.m: -------------------------------------------------------------------------------- 1 | function TSconfigs = generateNoisySineWithLinearTrendConfigs3() 2 | % parameter values to generate the TSconfig for 3 | Tvar = [10 100]; Tfix = 30; 4 | etaVar = [0 0.8]; etaFix = 0; 5 | mVar = [-20 20]; mFix = 0; 6 | 7 | paramsCell = { ... 8 | % {tVar; etaFix; mFix}, ... 1D T 9 | % {Tfix; etaVar; mFix}, ... 1D eta 10 | % {Tfix; etaFix; mVar}, ... 1D m 11 | % {Tvar; etaVar; mFix}, ... 2D T, eta 12 | {Tfix; etaVar; mVar}, ... 2D eta, m 13 | {Tvar; etaFix; mVar}, ... 2D T, m 14 | {Tvar; etaVar; mVar}, ... 3D T, eta, m 15 | }; 16 | 17 | Ns = [ ... 18 | % 100, ... 19 | % 100, ... 20 | % 100, ... 21 | % 400, ... 22 | 400, ... 23 | 400, ... 24 | 1000, ... 25 | ]; 26 | 27 | TSconfigs = {}; 28 | for paramsInd = 1:length(paramsCell) 29 | TSconfigs = horzcat(TSconfigs, generateNoisySineWithLinearTrendConfig(paramsCell{paramsInd}, Ns(paramsInd))); 30 | end 31 | 32 | end 33 | 34 | function config = generateNoisySineWithLinearTrendConfig(params, N) 35 | 36 | config.functionName = 'noisySineWithLinearTrend'; 37 | config.signalNames = {'x'}; 38 | 39 | config.nRealizations = N; 40 | 41 | config.paramNames = {'T', 'eta', 'm'}; 42 | config.params = params; 43 | 44 | config.timeParamNames = {'steps'}; 45 | config.timeParams = [... 46 | 2500; ... signal steps 47 | ]; 48 | 49 | end -------------------------------------------------------------------------------- /HCTSA_generation/systemConfigs/generateNoisySineWithLinearTrendConfigs3.m: -------------------------------------------------------------------------------- 1 | function TSconfigs = generateNoisySineWithLinearTrendConfigs3() 2 | % parameter values to generate the TSconfig for 3 | Tvar = [10 100]; Tfix = 30; 4 | etaVar = [0 0.8]; etaFix = 0; 5 | mVar = [-20 20]; mFix = 0; 6 | 7 | % paramsCell = { ... 8 | % % {tVar; etaFix; mFix}, ... 1D T 9 | % {Tfix; etaVar; mFix}, ... 1D eta 10 | % % {Tfix; etaFix; mVar}, ... 1D m 11 | % {Tvar; etaVar; mFix}, ... 2D T, eta 12 | % {Tfix; etaVar; mVar}, ... 2D eta, m 13 | % % {Tvar; etaFix; mVar}, ... 2D T, m 14 | % {Tvar; etaVar; mVar}, ... 3D T, eta, m 15 | % }; 16 | % 17 | % Ns = [ ... 18 | % % 100, ... 19 | % % 100, ... 20 | % 100, ... 21 | % 400, ... 22 | % % 400, ... 23 | % 400, ... 24 | % 1000, ... 25 | % ]; 26 | 27 | paramsCell = { ... 28 | {Tfix; etaVar; mFix}, ... 1D eta 29 | {Tvar; etaVar; mFix}, ... 2D T, eta 30 | {Tfix; etaVar; mVar}, ... 2D eta, m 31 | {Tvar; etaVar; mVar}, ... 3D T, eta, m 32 | }; 33 | 34 | Ns = [ ... 35 | 100, ... 36 | 400, ... 37 | 400, ... 38 | 1000, ... 39 | ]; 40 | 41 | TSconfigs = {}; 42 | for paramsInd = 1:length(paramsCell) 43 | TSconfigs = horzcat(TSconfigs, generateNoisySineWithLinearTrendConfig(paramsCell{paramsInd}, Ns(paramsInd))); 44 | end 45 | 46 | end 47 | 48 | function config = generateNoisySineWithLinearTrendConfig(params, N) 49 | 50 | config.functionName = 'noisySineWithLinearTrend'; 51 | config.signalNames = {'x'}; 52 | 53 | config.nRealizations = N; 54 | 55 | config.paramNames = {'T', 'eta', 'm'}; 56 | config.params = params; 57 | 58 | config.timeParamNames = {'steps'}; 59 | config.timeParams = [... 60 | 2500; ... signal steps 61 | ]; 62 | 63 | end -------------------------------------------------------------------------------- /HCTSA_generation/systemConfigs/generateNoisySineWithMeanShiftConfigs.m: -------------------------------------------------------------------------------- 1 | function TSconfigs = generateNoisySineWithMeanShiftConfigs() 2 | % parameter values to generate the TSconfig for 3 | %T; [10 100] or 30 4 | %eta; [0 3] or 0 5 | %s; [-5 5] or 0 6 | 7 | paramsCell = { ... 8 | {[10 100]; 0; 0}, ... 1D T 9 | {30; [0 3]; 0}, ... 1D eta 10 | {30; 0; [-5 5]}, ... 1D s 11 | {[10 100]; [0 3]; 0}, ... 2D T, eta 12 | {30; [0 3]; [-5 5]}, ... 2D eta, s 13 | {[10 100]; 0; [-5 5]}, ... 2D T, s 14 | {[10 100]; [0 3]; [-5 5]}, ... 3D T, eta, s 15 | }; 16 | 17 | Ns = [ ... 18 | 100, ... 19 | 100, ... 20 | 100, ... 21 | 400, ... 22 | 400, ... 23 | 400, ... 24 | 1000, ... 25 | ]; 26 | 27 | TSconfigs = {}; 28 | for paramsInd = 1:length(paramsCell) 29 | TSconfigs = horzcat(TSconfigs, generateNoisySineWithMeanShiftConfig(paramsCell{paramsInd}, Ns(paramsInd))); 30 | end 31 | 32 | end 33 | 34 | function config = generateNoisySineWithMeanShiftConfig(params, N) 35 | 36 | config.functionName = 'noisySineWithMeanShift'; 37 | config.signalNames = {'x'}; 38 | 39 | config.nRealizations = N; 40 | 41 | config.paramNames = {'T', 'eta', 's'}; 42 | config.params = params; 43 | 44 | config.timeParamNames = {'steps'}; 45 | config.timeParams = [... 46 | 2500; ... signal steps 47 | ]; 48 | 49 | end -------------------------------------------------------------------------------- /HCTSA_generation/systemConfigs/generatePopulationGrowthConfigs.m: -------------------------------------------------------------------------------- 1 | function TSconfigs = generatePopulationGrowthConfigs() 2 | % parameter values to generate the TSconfig for 3 | rVar = [0.1, 3]; rFix = 0.5; 4 | KVar = [0.5, 5]; KFix = 1; 5 | betaVar = [0.1, 10]; betaFix = 1; 6 | 7 | paramsCell = { ... 8 | {rVar; KFix; betaFix}, ... 1D r 9 | {rFix; KVar; betaFix}, ... 1D K 10 | {rFix; KFix; betaVar}, ... 1D beta 11 | {rVar; KVar; betaFix}, ... 2D r, K 12 | {rVar; KFix; betaVar}, ... 2D r, beta 13 | {rFix; KVar; betaVar}, ... 2D K, beta 14 | {rVar; KVar; betaVar}, ... 3D r, K, beta 15 | }; 16 | 17 | Ns = [ ... 18 | 100, ... 19 | 100, ... 20 | 100, ... 21 | 400, ... 22 | 400, ... 23 | 400, ... 24 | 1000, ... 25 | ]; 26 | 27 | TSconfigs = {}; 28 | for paramsInd = 1:length(paramsCell) 29 | TSconfigs = horzcat(TSconfigs, generateBimodalConfig(paramsCell{paramsInd}, Ns(paramsInd))); 30 | end 31 | 32 | end 33 | 34 | function config = generateBimodalConfig(params, N) 35 | 36 | config.functionName = 'populationGrowth'; 37 | config.signalNames = {'x'}; 38 | 39 | config.nRealizations = N; 40 | 41 | config.paramNames = {'r', 'K', 'beta'}; 42 | config.params = params; 43 | 44 | config.timeParamNames = {'steps'}; 45 | config.timeParams = [... 46 | 3000; ... signal steps 47 | ]; 48 | 49 | end -------------------------------------------------------------------------------- /HCTSA_generation/systemConfigs/generatePopulationGrowthConfigs2.m: -------------------------------------------------------------------------------- 1 | function TSconfigs = generatePopulationGrowthConfigs2() 2 | % parameter values to generate the TSconfig for 3 | rVar = [0.1, 3]; rFix = 0.5; 4 | KVar = [1.5, 5]; KFix = 1; 5 | betaVar = [1, 50]; betaFix = 5; 6 | 7 | paramsCell = { ... 8 | % {rVar; KFix; betaFix}, ... 1D r 9 | % {rFix; KVar; betaFix}, ... 1D K 10 | % {rFix; KFix; betaVar}, ... 1D beta 11 | % {rVar; KVar; betaFix}, ... 2D r, K 12 | % {rVar; KFix; betaVar}, ... 2D r, beta 13 | % {rFix; KVar; betaVar}, ... 2D K, beta 14 | {rVar; KVar; betaVar}, ... 3D r, K, beta 15 | }; 16 | 17 | Ns = [ ... 18 | % 100, ... 19 | % 100, ... 20 | % 100, ... 21 | % 400, ... 22 | % 400, ... 23 | % 400, ... 24 | 1000, ... 25 | ]; 26 | 27 | TSconfigs = {}; 28 | for paramsInd = 1:length(paramsCell) 29 | TSconfigs = horzcat(TSconfigs, generatePopulationGrowthConfig(paramsCell{paramsInd}, Ns(paramsInd))); 30 | end 31 | 32 | end 33 | 34 | function config = generatePopulationGrowthConfig(params, N) 35 | 36 | config.functionName = 'populationGrowth'; 37 | config.signalNames = {'x'}; 38 | 39 | config.nRealizations = N; 40 | 41 | config.paramNames = {'r', 'K', 'beta'}; 42 | config.params = params; 43 | 44 | config.timeParamNames = {'steps'}; 45 | config.timeParams = [... 46 | 3000; ... signal steps 47 | ]; 48 | 49 | end -------------------------------------------------------------------------------- /HCTSA_generation/systemConfigs/generatePowernoiseConfigs.m: -------------------------------------------------------------------------------- 1 | function configs = generatePowernoiseConfigs() 2 | configs = {generatePowernoiseConfig()}; 3 | end 4 | 5 | function config = generatePowernoiseConfig() 6 | 7 | config.functionName = 'F_powernoise'; 8 | config.signalNames = {'x'}; 9 | 10 | config.nRealizations = 200; 11 | 12 | config.paramNames = {'alpha'}; 13 | config.params = {... 14 | [-1, 3]; ... alpha 15 | }; 16 | 17 | config.timeParamNames = {'steps'}; 18 | config.timeParams = [... 19 | 3500; ... signal steps 20 | ]; 21 | end -------------------------------------------------------------------------------- /HCTSA_generation/systemConfigs/generatePredatorPreyConfigs.m: -------------------------------------------------------------------------------- 1 | function TSconfigs = generatePredatorPreyConfigs() 2 | % parameter values to generate the TSconfig for 3 | rVar = [0.3 1]; rFix = 0.3; 4 | KVar = [0.7 1.2]; KFix = 1; 5 | alphaVar = [4.4 5.5]; alphaFix = 5; 6 | 7 | paramsCell = { ... 8 | % {rVar; KFix; alphaFix}, ... 1D r 9 | % {rFix; KVar; alphaFix}, ... 1D K 10 | % {rFix; KFix; alphaVar}, ... 1D alpha 11 | % {rVar; KVar; alphaFix}, ... 2D r, K 12 | % {rVar; KFix; alphaVar}, ... 2D r, alpha 13 | % {rFix; KVar; alphaVar}, ... 2D K, alpha 14 | {rVar; KVar; alphaVar}, ... 3D r, K, alpha 15 | }; 16 | 17 | Ns = [ ... 18 | % 100, ... 19 | % 100, ... 20 | % 100, ... 21 | % 400, ... 22 | % 400, ... 23 | % 400, ... 24 | 1000, ... 25 | ]; 26 | 27 | TSconfigs = {}; 28 | for paramsInd = 1:length(paramsCell) 29 | TSconfigs = horzcat(TSconfigs, generateStochasticSineMapConfig(paramsCell{paramsInd}, Ns(paramsInd))); 30 | end 31 | 32 | end 33 | 34 | function config = generateStochasticSineMapConfig(params, N) 35 | 36 | config.functionName = 'predatorPrey'; 37 | config.signalNames = {'x', 'y'}; 38 | 39 | config.nRealizations = N; 40 | 41 | config.paramNames = {'r', 'K', 'alpha'}; 42 | config.params = params; 43 | 44 | config.timeParamNames = {'steps'}; 45 | config.timeParams = [... 46 | 1000; ... signal steps 47 | ]; 48 | 49 | % config.postprocessing = ... 50 | % {@(timeSeriesData, labels, keywords) ... 51 | % PP_removeTransients(timeSeriesData, labels, keywords, 500)}; 52 | 53 | end -------------------------------------------------------------------------------- /HCTSA_generation/systemConfigs/generatePredatorPreyConfigs2.m: -------------------------------------------------------------------------------- 1 | function TSconfigs = generatePredatorPreyConfigs2() 2 | % parameter values to generate the TSconfig for 3 | rVar = [0.3 1]; rFix = 0.3; 4 | KVar = [0.7 1.2]; KFix = 1; 5 | alphaVar = [4.4 5.5]; alphaFix = 5; 6 | 7 | paramsCell = { ... 8 | {rVar; KFix; alphaFix}, ... 1D r 9 | {rFix; KVar; alphaFix}, ... 1D K 10 | {rVar; KVar; alphaFix}, ... 2D r, K 11 | }; 12 | 13 | Ns = [ ... 14 | 100, ... 15 | 400, ... 16 | 400 17 | ]; 18 | 19 | TSconfigs = {}; 20 | for paramsInd = 1:length(paramsCell) 21 | TSconfigs = horzcat(TSconfigs, generateStochasticSineMapConfig(paramsCell{paramsInd}, Ns(paramsInd))); 22 | end 23 | 24 | end 25 | 26 | function config = generateStochasticSineMapConfig(params, N) 27 | 28 | config.functionName = 'predatorPrey'; 29 | config.signalNames = {'x', 'y'}; 30 | 31 | config.nRealizations = N; 32 | 33 | config.paramNames = {'r', 'K', 'alpha'}; 34 | config.params = params; 35 | 36 | config.timeParamNames = {'steps'}; 37 | config.timeParams = [... 38 | 1000; ... signal steps 39 | ]; 40 | 41 | % config.postprocessing = ... 42 | % {@(timeSeriesData, labels, keywords) ... 43 | % PP_removeTransients(timeSeriesData, labels, keywords, 500)}; 44 | 45 | end -------------------------------------------------------------------------------- /HCTSA_generation/systemConfigs/generateRosslerConfigs.m: -------------------------------------------------------------------------------- 1 | function TSconfigs = generateRosslerConfigs() 2 | % parameter values to generate the TSconfig for 3 | aVar = [0.1, 0.3]; aFix = 0.2; 4 | bVar = [0.01, 2]; bFix = 0.2; 5 | cVar = [4.5, 20]; cFix = 5.7; 6 | 7 | paramsCell = { ... 8 | {aVar; bFix; cFix}, ... 1D a 9 | {aFix; bVar; cFix}, ... 1D b 10 | {aFix; bFix; cVar}, ... 1D c 11 | {aVar; bVar; cFix}, ... 2D a, b 12 | {aVar; bFix; cVar}, ... 2D a, c 13 | {aFix; bVar; cVar}, ... 2D b, c 14 | {aVar; bVar; cVar}, ... 3D a, b, c 15 | }; 16 | 17 | Ns = [ ... 18 | 100, ... 19 | 100, ... 20 | 100, ... 21 | 400, ... 22 | 400, ... 23 | 400, ... 24 | 1000, ... 25 | ]; 26 | 27 | TSconfigs = {}; 28 | for paramsInd = 1:length(paramsCell) 29 | TSconfigs = horzcat(TSconfigs, generateRosslerConfig(paramsCell{paramsInd}, Ns(paramsInd))); 30 | end 31 | 32 | end 33 | 34 | function config = generateRosslerConfig(params, N) 35 | 36 | config.functionName = 'rossler'; 37 | config.signalNames = {'x', 'y', 'z'}; 38 | 39 | config.nRealizations = N; 40 | 41 | config.paramNames = {'a', 'b', 'c'}; 42 | config.params = params; 43 | 44 | config.timeParamNames = {'timeSteps'}; 45 | config.timeParams = [... 46 | 2000; ... signal steps 47 | ]; 48 | 49 | end -------------------------------------------------------------------------------- /HCTSA_generation/systemConfigs/generateRosslerConfigs2.m: -------------------------------------------------------------------------------- 1 | function TSconfigs = generateRosslerConfigs2() 2 | % parameter values to generate the TSconfig for 3 | aVar = [0.15, 0.25]; aFix = 0.2; 4 | bVar = [0.5, 2]; bFix = 1; 5 | cVar = [8.5, 17]; cFix = 10; 6 | 7 | paramsCell = { ... 8 | {aVar; bFix; cFix}, ... 1D a 9 | {aFix; bVar; cFix}, ... 1D b 10 | {aFix; bFix; cVar}, ... 1D c 11 | {aVar; bVar; cFix}, ... 2D a, b 12 | {aVar; bFix; cVar}, ... 2D a, c 13 | {aFix; bVar; cVar}, ... 2D b, c 14 | {aVar; bVar; cVar}, ... 3D a, b, c 15 | }; 16 | 17 | Ns = [ ... 18 | 100, ... 19 | 100, ... 20 | 100, ... 21 | 400, ... 22 | 400, ... 23 | 400, ... 24 | 1000, ... 25 | ]; 26 | 27 | TSconfigs = {}; 28 | for paramsInd = 1:length(paramsCell) 29 | TSconfigs = horzcat(TSconfigs, generateRosslerConfig(paramsCell{paramsInd}, Ns(paramsInd))); 30 | end 31 | 32 | end 33 | 34 | function config = generateRosslerConfig(params, N) 35 | 36 | config.functionName = 'rossler'; 37 | config.signalNames = {'x', 'y', 'z'}; 38 | 39 | config.nRealizations = N; 40 | 41 | config.paramNames = {'a', 'b', 'c'}; 42 | config.params = params; 43 | 44 | config.timeParamNames = {'timeSteps'}; 45 | config.timeParams = [... 46 | 2000; ... signal steps 47 | ]; 48 | 49 | end -------------------------------------------------------------------------------- /HCTSA_generation/systemConfigs/generateStochasticSineMapConfigs.m: -------------------------------------------------------------------------------- 1 | function TSconfigs = generateStochasticSineMapConfigs() 2 | % parameter values to generate the TSconfig for 3 | muVar = [0.5 4]; muFix = 2.4; 4 | qVar = [0 1]; qFix = 0.5; 5 | bVar = [0 3]; bFix = 1; 6 | 7 | paramsCell = { ... 8 | {muVar; qFix; bFix}, ... 1D mu 9 | {muFix; qVar; bFix}, ... 1D q 10 | {muFix; qFix; bVar}, ... 1D b 11 | {muVar; qVar; bFix}, ... 2D mu, q 12 | {muVar; qFix; bVar}, ... 2D mu, b 13 | {muFix; qVar; bVar}, ... 2D b, q 14 | {muVar; qVar; bVar}, ... 3D mu, b, q 15 | }; 16 | 17 | Ns = [ ... 18 | 100, ... 19 | 100, ... 20 | 100, ... 21 | 400, ... 22 | 400, ... 23 | 400, ... 24 | 1000, ... 25 | ]; 26 | 27 | TSconfigs = {}; 28 | for paramsInd = 1:length(paramsCell) 29 | TSconfigs = horzcat(TSconfigs, generateStochasticSineMapConfig(paramsCell{paramsInd}, Ns(paramsInd))); 30 | end 31 | 32 | end 33 | 34 | function config = generateStochasticSineMapConfig(params, N) 35 | 36 | config.functionName = 'stochasticSineMap'; 37 | config.signalNames = {'x'}; 38 | 39 | config.nRealizations = N; 40 | 41 | config.paramNames = {'mu', 'q', 'b'}; 42 | config.params = params; 43 | 44 | config.timeParamNames = {'steps'}; 45 | config.timeParams = [... 46 | 2500; ... signal steps 47 | ]; 48 | 49 | % config.postprocessing = ... 50 | % {@(timeSeriesData, labels, keywords) ... 51 | % PP_removeTransients(timeSeriesData, labels, keywords, 500)}; 52 | 53 | end -------------------------------------------------------------------------------- /HCTSA_generation/systemConfigs/generateStochasticSineMapConfigs2.m: -------------------------------------------------------------------------------- 1 | function TSconfigs = generateStochasticSineMapConfigs2() 2 | % parameter values to generate the TSconfig for 3 | muVar = [2.5 4]; muFix = 2.5; 4 | qVar = [0 1]; qFix = 0.5; 5 | bVar = [0 3]; bFix = 1; 6 | 7 | paramsCell = { ... 8 | {muVar; qFix; bFix}, ... 1D mu 9 | {muFix; qVar; bFix}, ... 1D q 10 | {muFix; qFix; bVar}, ... 1D b 11 | {muVar; qVar; bFix}, ... 2D mu, q 12 | {muVar; qFix; bVar}, ... 2D mu, b 13 | {muFix; qVar; bVar}, ... 2D b, q 14 | {muVar; qVar; bVar}, ... 3D mu, b, q 15 | }; 16 | 17 | Ns = [ ... 18 | 100, ... 19 | 100, ... 20 | 100, ... 21 | 400, ... 22 | 400, ... 23 | 400, ... 24 | 1000, ... 25 | ]; 26 | 27 | TSconfigs = {}; 28 | for paramsInd = 1:length(paramsCell) 29 | TSconfigs = horzcat(TSconfigs, generateStochasticSineMapConfig(paramsCell{paramsInd}, Ns(paramsInd))); 30 | end 31 | 32 | end 33 | 34 | function config = generateStochasticSineMapConfig(params, N) 35 | 36 | config.functionName = 'stochasticSineMap'; 37 | config.signalNames = {'x'}; 38 | 39 | config.nRealizations = N; 40 | 41 | config.paramNames = {'mu', 'q', 'b'}; 42 | config.params = params; 43 | 44 | config.timeParamNames = {'steps'}; 45 | config.timeParams = [... 46 | 2500; ... signal steps 47 | ]; 48 | 49 | % config.postprocessing = ... 50 | % {@(timeSeriesData, labels, keywords) ... 51 | % PP_removeTransients(timeSeriesData, labels, keywords, 500)}; 52 | 53 | end -------------------------------------------------------------------------------- /HCTSA_generation/systemConfigs/generateVanDerPolConfigs.m: -------------------------------------------------------------------------------- 1 | function TSconfigs = generateVanDerPolConfigs() 2 | % parameter values to generate the TSconfig for 3 | kVar = [0.1, 5]; kFix = 1; 4 | cVar = [0.1, 5]; cFix = 1; 5 | 6 | paramsCell = { ... 7 | {cVar, kFix}, ... 1D c 8 | {cFix, kVar}, ... 1D k 9 | {cVar, kVar}, ... 2D c, k 10 | }; 11 | 12 | Ns = [ ... 13 | 100, ... 14 | 100, ... 15 | 400, ... 16 | ]; 17 | 18 | TSconfigs = {}; 19 | for paramsInd = 1:length(paramsCell) 20 | TSconfigs = horzcat(TSconfigs, generateVanDerPolConfig(paramsCell{paramsInd}, Ns(paramsInd))); 21 | end 22 | 23 | end 24 | 25 | function config = generateVanDerPolConfig(params, N) 26 | 27 | config.functionName = 'vanDerPol'; 28 | config.signalNames = {'x', 'y'}; 29 | 30 | config.nRealizations = N; 31 | 32 | config.paramNames = {'c', 'k'}; 33 | config.params = params; 34 | 35 | config.timeParamNames = {'timeSteps'}; 36 | config.timeParams = [... 37 | 500; ... signal steps 38 | ]; 39 | 40 | end -------------------------------------------------------------------------------- /HCTSA_generation/systemConfigs/generateVanDerPolConfigs_varyLenFsEta.m: -------------------------------------------------------------------------------- 1 | function TSconfigs = generateVanDerPolConfigs_varyLenFsEta(tsLen, Fs, eta) 2 | % parameter values to generate the TSconfig for 3 | kVar = [0.1, 5]; kFix = 1; 4 | cVar = [0.1, 5]; cFix = 1; 5 | 6 | paramsCell = { ... 7 | % {cVar, kFix}, ... 1D c 8 | % {cFix, kVar}, ... 1D k 9 | {cVar, kVar}, ... 2D c, k 10 | }; 11 | 12 | Ns = [ ... 13 | % 100, ... 14 | % 100, ... 15 | 400, ... 16 | ]; 17 | 18 | TSconfigs = {}; 19 | for paramsInd = 1:length(paramsCell) 20 | TSconfigs = horzcat(TSconfigs, generateVanDerPolConfig(paramsCell{paramsInd}, Ns(paramsInd), tsLen, Fs, eta)); 21 | end 22 | 23 | end 24 | 25 | function config = generateVanDerPolConfig(params, N, tsLen, Fs, eta) 26 | 27 | config.functionName = 'vanDerPol_L'; 28 | config.signalNames = {'x', 'y'}; 29 | 30 | config.nRealizations = N; 31 | 32 | config.paramNames = {'c', 'k'}; 33 | config.params = params; 34 | 35 | config.timeParamNames = {'timeSteps', 'L'}; 36 | config.timeParams = [... 37 | tsLen; ... signal steps 38 | tsLen/Fs; ... time (s) covered 39 | ]; 40 | 41 | config.postprocessing = {... 42 | @(timeSeriesData, labels, keywords)... 43 | PP_addNoise(timeSeriesData, labels, keywords, eta)}; 44 | 45 | end -------------------------------------------------------------------------------- /HCTSA_generation/systemFunctions/autoregressive.m: -------------------------------------------------------------------------------- 1 | function signal = autoregressive(tau, alpha, n) 2 | 3 | % make sure the process doesn't diverge by limiting the sum of 4 | % coeffs to alpha 5 | params = repmat(alpha/tau, tau, 1); 6 | signal = MkSg_AR(n,params,500); 7 | 8 | % signal = zeros(1,n); 9 | % 10 | % if tau == 1 11 | % signal(1) = 0.1; 12 | % else 13 | % signal(1:tau) = randn(1,tau); 14 | % end 15 | % 16 | % for i = (tau+1):(n-1) 17 | % signal(i) = alpha * signal(i-tau) + randn; 18 | % end 19 | 20 | end 21 | 22 | -------------------------------------------------------------------------------- /HCTSA_generation/systemFunctions/bimodal.m: -------------------------------------------------------------------------------- 1 | function output = bimodal(delta, alpha, n) 2 | 3 | output = zeros(1, n); 4 | 5 | currentDist = 0; % 0 or 1 6 | for i = 1:n 7 | 8 | if currentDist == 1 9 | output(i) = randn; 10 | else 11 | output(i) = randn + delta; 12 | end 13 | 14 | % switch with p=alpha 15 | if rand > alpha 16 | currentDist = mod(currentDist+1,2); 17 | end 18 | end 19 | 20 | end -------------------------------------------------------------------------------- /HCTSA_generation/systemFunctions/logisticMap.m: -------------------------------------------------------------------------------- 1 | function signal = logisticMap (A, x0, n) 2 | 3 | signal = MkSg_map('logistic', n, x0, A, 500); 4 | 5 | % signal = zeros(1,n); 6 | % 7 | % signal(1) = x0; 8 | % 9 | % for i = 1:(n-1) 10 | % signal(i+1) = A * signal(i) * (1 - signal(i)); 11 | % end 12 | 13 | end -------------------------------------------------------------------------------- /HCTSA_generation/systemFunctions/lorenzAtt.m: -------------------------------------------------------------------------------- 1 | function signal = lorenzAtt(s, r, b, n) 2 | 3 | signal = MkSg_Flow('Lorenz', n, round(0.01*n), [], [s,r,b]); 4 | 5 | % signalX = zeros(1,n); 6 | % signalY = zeros(1,n); 7 | % signalZ = zeros(1,n); 8 | % 9 | % signalX(1) = x0; 10 | % signalY(1) = y0; 11 | % signalZ(1) = z0; 12 | % 13 | % for i = 1:(n-1) 14 | % 15 | % [xDot, yDot, zDot] = lorenz_1step(signalX(i), signalY(i), signalZ(i), s, r, b); 16 | % signalX(i+1) = signalX(i) + xDot * dt; 17 | % signalY(i+1) = signalY(i) + yDot * dt; 18 | % signalZ(i+1) = signalZ(i) + zDot * dt; 19 | % 20 | % end 21 | % 22 | % signals = [signalX; signalY; signalZ]; 23 | % 24 | % end 25 | % 26 | % function [xDot, yDot, zDot] = lorenz_1step(x, y, z, s, r, b) %, s=10, r=28, b=2.667 27 | % 28 | % xDot = s*(y - x); 29 | % yDot = r*x - y - x*z; 30 | % zDot = x*y - b*z; 31 | % 32 | % end 33 | -------------------------------------------------------------------------------- /HCTSA_generation/systemFunctions/mackeyglass/mackeyglass.m: -------------------------------------------------------------------------------- 1 | function X = mackeyglass(a, b, tau, sample_n, deltat) 2 | 3 | % Based on the Mackey-Glass time series generator 4 | % version 1.0.0.0 by Marco Cococcioni 5 | % Downloaded from Matlab Central on 15.09.2017 6 | 7 | % %% Input parameters 8 | % a = 0.2; % value for a in eq (1) 9 | % b = 0.1; % value for b in eq (1) 10 | % tau = 17; % delay constant in eq (1) 11 | % x0 = 1.2; % initial condition: x(t=0)=x0 12 | % deltat = 0.1; % time step size (which coincides with the integration step) 13 | % sample_n = 12000; % total no. of samples, excluding the given initial condition 14 | 15 | 16 | %% Main algorithm 17 | % * x_t : x at instant t , i.e. x(t) (current value of x) 18 | % * x_t_minus_tau : x at instant (t-tau) , i.e. x(t-tau) 19 | % * x_t_plus_deltat : x at instant (t+deltat), i.e. x(t+deltat) (next value of x) 20 | % * X : the (sample_n+1)-dimensional vector containing x0 plus all other computed values of x 21 | % * T : the (sample_n+1)-dimensional vector containing time samples 22 | % * x_history : a circular vector storing all computed samples within x(t-tau) and x(t) 23 | 24 | x0 = 1.2; 25 | 26 | time = 0; 27 | index = 1; 28 | history_length = floor(tau/deltat); 29 | x_history = zeros(history_length, 1); % here we assume x(t)=0 for -tau <= t < 0 30 | x_t = x0; 31 | 32 | X = zeros(sample_n+1, 1); % vector of all generated x samples 33 | T = zeros(sample_n+1, 1); % vector of time samples 34 | 35 | for i = 1:sample_n+1, 36 | X(i) = x_t; 37 | 38 | if tau == 0, 39 | x_t_minus_tau = 0.0; 40 | else 41 | x_t_minus_tau = x_history(index); 42 | end 43 | 44 | x_t_plus_deltat = mackeyglass_rk4(x_t, x_t_minus_tau, deltat, a, b); 45 | 46 | if (tau ~= 0), 47 | x_history(index) = x_t_plus_deltat; 48 | index = mod(index, history_length)+1; 49 | end 50 | time = time + deltat; 51 | T(i) = time; 52 | x_t = x_t_plus_deltat; 53 | end 54 | -------------------------------------------------------------------------------- /HCTSA_generation/systemFunctions/mackeyglass/mackeyglass_eq.m: -------------------------------------------------------------------------------- 1 | %% makeyglass_eq 2 | % This function returns dx/dt of Mackey-Glass delayed differential equation 3 | 4 | %% 5 | % 6 | % $$\frac{dx(t)}{dt}=\frac{ax(t-\tau)}{1+x(t-\tau)^{10}}-bx(t)$$ 7 | % 8 | 9 | %% 10 | % *Matlab code:* 11 | function x_dot = mackeyglass_eq(x_t, x_t_minus_tau, a, b) 12 | x_dot = -b*x_t + a*x_t_minus_tau/(1 + x_t_minus_tau^10.0); 13 | end 14 | 15 | 16 | %% 17 | % 18 | % 19 | -------------------------------------------------------------------------------- /HCTSA_generation/systemFunctions/mackeyglass/mackeyglass_rk4.m: -------------------------------------------------------------------------------- 1 | %% mackeyglass_rk4 2 | % This function computes the numerical solution of the Mackey-Glass 3 | % delayed differential equation using the 4-th order Runge-Kutta method 4 | 5 | 6 | %% 7 | % $$k_1=\Delta t \cdot mackeyglass\_eq(x(t), x(t-\tau), a, b)$$ 8 | %% 9 | % $$k_2=\Delta t \cdot mackeyglass\_eq(x(t+\frac{1}{2}k_1), x(t-\tau), a, b)$$ 10 | %% 11 | % $$k_3=\Delta t \cdot mackeyglass\_eq(x(t+\frac{1}{2}k_2), x(t-\tau), a, b)$$ 12 | %% 13 | % $$k_4=\Delta t \cdot mackeyglass\_eq(x(t+k_3), x(t-\tau), a, b)$$ 14 | %% 15 | % $$x(t+\Delta t) = x(t) + \frac{k_1}{6}+ \frac{k_2}{3} + \frac{k_3}{6} + \frac{k_4}{6}$$ 16 | 17 | %% 18 | % Here is the code for , 19 | % the Mackey-Glass delayed differential equation 20 | 21 | 22 | %% 23 | % *Matlab code:* 24 | function x_t_plus_deltat = mackeyglass_rk4(x_t, x_t_minus_tau, deltat, a, b) 25 | k1 = deltat*mackeyglass_eq(x_t, x_t_minus_tau, a, b); 26 | k2 = deltat*mackeyglass_eq(x_t+0.5*k1, x_t_minus_tau, a, b); 27 | k3 = deltat*mackeyglass_eq(x_t+0.5*k2, x_t_minus_tau, a, b); 28 | k4 = deltat*mackeyglass_eq(x_t+k3, x_t_minus_tau, a, b); 29 | x_t_plus_deltat = (x_t + k1/6 + k2/3 + k3/3 + k4/6); 30 | end 31 | 32 | 33 | %% 34 | % 35 | % 36 | -------------------------------------------------------------------------------- /HCTSA_generation/systemFunctions/noisySineWithLinearTrend.m: -------------------------------------------------------------------------------- 1 | function output = noisySineWithLinearTrend(T, eta, m, n) 2 | 3 | t = 1:n; 4 | 5 | output = sin(2*pi*t/T) + eta * randn(1,n) + m * t / n; 6 | 7 | end -------------------------------------------------------------------------------- /HCTSA_generation/systemFunctions/noisySineWithMeanShift.m: -------------------------------------------------------------------------------- 1 | function output = noisySineWithMeanShift(T, eta, s, n) 2 | 3 | t = 1:n; 4 | 5 | output = sin(2*pi*t/T) + eta * randn(1,n) + s; 6 | 7 | end -------------------------------------------------------------------------------- /HCTSA_generation/systemFunctions/populationGrowth.m: -------------------------------------------------------------------------------- 1 | function s = populationGrowth(r, K, beta, n) 2 | 3 | fprintf('Generationg populationGrowth for r=%1.3f, K=%1.3f, beta=%1.3f\n', ... 4 | r, K, beta); 5 | 6 | % fixed params 7 | s0 = [1]; 8 | Tend = 30; 9 | 10 | % variable params 11 | params.r = r; 12 | params.K = K; 13 | params.beta = beta; 14 | 15 | % Set evaluation/sensitivity options 16 | opts = odeset('reltol',10^-6,'abstol',10^-6); 17 | 18 | % Specify the time span 19 | tspan = [0,Tend]; 20 | 21 | % Specify the ODE 22 | ode = @(t,y) popGrowthStep(t,y,params); 23 | 24 | % Solve the ODE 25 | sol = ode45(ode,tspan,s0);%,opts); 26 | 27 | % Evaluate solution on a discrete grid of N points 28 | t = linspace(0, Tend, n); 29 | s = deval(sol,t)'; 30 | 31 | end 32 | 33 | function dx = popGrowthStep(t, x, params) 34 | 35 | r = params.r; 36 | K = params.K; 37 | beta = params.beta; 38 | 39 | dx = r*x*(K-x) + beta*x*randn(1); 40 | 41 | end -------------------------------------------------------------------------------- /HCTSA_generation/systemFunctions/postProcessing/PP_LyapunovExponent.m: -------------------------------------------------------------------------------- 1 | function [timeSeriesData, labels, keywords] = PP_LyapunovExponent(timeSeriesData, labels, keywords) 2 | % mock function for lyapunov exponent calculation. Replace with actual 3 | % lyapunov exponent calculation 4 | 5 | n = length(timeSeriesData); 6 | 7 | for i = 1:n 8 | timeSeries = timeSeriesData{i}; 9 | lyapunovExp = lyapspec(timeSeries, 1, 5, 12, 0.05, 10);%1; % change this. 10 | keywords{i} = [keywords{i}, ',LE=', num2str(lyapunovExp)]; 11 | end 12 | 13 | end -------------------------------------------------------------------------------- /HCTSA_generation/systemFunctions/postProcessing/PP_addNoise.m: -------------------------------------------------------------------------------- 1 | function [timeSeriesData, labels, keywords, folderNameAdd] = PP_addNoise(timeSeriesData, labels, keywords, noiseAmp) 2 | % mock function for lyapunov exponent calculation. Replace with actual 3 | % lyapunov exponent calculation 4 | 5 | for i = 1:length(timeSeriesData) 6 | timeSeriesData{i} = timeSeriesData{i} + rand(size(timeSeriesData{i}))*noiseAmp; 7 | keywords{i} = [keywords{i}, ',addedNoiseAmplitude=', num2str(noiseAmp)]; 8 | end 9 | folderNameAdd = sprintf('_addEta=%1.4f', noiseAmp); 10 | 11 | end -------------------------------------------------------------------------------- /HCTSA_generation/systemFunctions/postProcessing/PP_downsample.m: -------------------------------------------------------------------------------- 1 | function [timeSeriesData, labels, keywords] = PP_downsample(timeSeriesData, labels, keywords, factor) 2 | % mock function for lyapunov exponent calculation. Replace with actual 3 | % lyapunov exponent calculation 4 | 5 | n = length(timeSeriesData); 6 | 7 | if round(factor) ~= factor 8 | error('Downsampling factor needs to be integer.'); 9 | end 10 | 11 | for i = 1:n 12 | timeSeriesData{i} = timeSeriesData{i}(1:factor:end); 13 | keywords{i} = [keywords{i}, ',downsamplingFactor', num2str(factor)]; 14 | end 15 | 16 | end -------------------------------------------------------------------------------- /HCTSA_generation/systemFunctions/postProcessing/PP_removeTransients.m: -------------------------------------------------------------------------------- 1 | function [timeSeriesData, labels, keywords] = PP_removeTransients(timeSeriesData, labels, keywords, eta) 2 | % mock function for lyapunov exponent calculation. Replace with actual 3 | % lyapunov exponent calculation 4 | 5 | n = length(timeSeriesData); 6 | 7 | for i = 1:n 8 | timeSeriesData{i} = timeSeriesData{i}((eta+1):end); 9 | keywords{i} = [keywords{i}, ',startRemoved', num2str(eta)]; 10 | end 11 | 12 | end -------------------------------------------------------------------------------- /HCTSA_generation/systemFunctions/predatorPrey.m: -------------------------------------------------------------------------------- 1 | function s = predatorPrey(r, K, alpha, N) 2 | 3 | s = MkSg_map('PredatorPrey', N, [0.5, 0.5], [r, K, alpha]); -------------------------------------------------------------------------------- /HCTSA_generation/systemFunctions/rossler.m: -------------------------------------------------------------------------------- 1 | function s = rossler(a, b, c, N) 2 | 3 | s0 = [-9; 0; 0]; 4 | 5 | params = [a, b, c]; 6 | s = MkSg_Flow('Rossler', N, [], s0, params); -------------------------------------------------------------------------------- /HCTSA_generation/systemFunctions/stochasticSineMap.m: -------------------------------------------------------------------------------- 1 | function output = stochasticSineMap(mu, q, b, n) 2 | 3 | output = MkSg_map('FreitasStochasticSine', n, [], [mu, b, q]); 4 | 5 | % output = zeros(1,n); 6 | % output(1) = unifrnd(-1,1); 7 | % 8 | % for i = 1:(n-1) 9 | % output(i+1) = mu * sin(output(i)) + binornd(1,q) * unifrnd(-b, b); 10 | % end 11 | 12 | end -------------------------------------------------------------------------------- /HCTSA_generation/systemFunctions/vanDerPol.m: -------------------------------------------------------------------------------- 1 | function s = vanDerPol(c, k, N) 2 | 3 | params = [c, k]; 4 | s = MkSg_Flow('vdp', N, [], [], params); -------------------------------------------------------------------------------- /HCTSA_generation/systemFunctions/vanDerPol_L.m: -------------------------------------------------------------------------------- 1 | function s = vanDerPol_L(c, k, N, L) 2 | 3 | params = [c, k]; 4 | s = MkSg_Flow('vdp', N, L, [], params); -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | {one line to give the program's name and a brief idea of what it does.} 635 | Copyright (C) {year} {name of author} 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | {project} Copyright (C) {year} {fullname} 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /MkSg_AR.m: -------------------------------------------------------------------------------- 1 | function s = MkSg_AR(N,params,eta) 2 | % returns an AR time series of mean zero 3 | % Length N 4 | % Transient removed of length eta 5 | % with defining parameters params as a vector (i.e., also specifies order) 6 | 7 | if nargin < 1 || isempty(N) 8 | N = 1000; 9 | end 10 | if nargin < 2 || isempty(params) 11 | params = [0.1]; % AR(1) process with parameter 0.1 12 | end 13 | if nargin < 3 || isempty(eta) 14 | eta = 100; % 100 time points removed from intial transient 15 | end 16 | 17 | % Part of the Make_Signal package 18 | % Ben Fulcher 29/3/2010 19 | 20 | 21 | % Make the noise term, eta 22 | % Gaussian distributed (this could be specified as an additional input to 23 | % make this code more general, and it could take that input from 24 | % MkSg_noise). You could even pass general signals in for the noise term 25 | % and treat this as a filter... In fact, I think you can do all this much 26 | % more elegantly using the filter command in MATLAB... But I'm lazy and 27 | % also enjoy making my own less efficient code. 28 | noise = randn(N+eta,1); 29 | x = zeros(N+eta,1); 30 | 31 | order = length(params); 32 | % will need this many initial conditions 33 | % taken from uniform random distribution 34 | % Could do nothing (i.e., take from uniform distribution of zeros)- we're 35 | % removing transient so for the stationary processes, this shouldn't 36 | % matter. 37 | x(1:order) = rand(order,1); 38 | 39 | for i=order+1:N+eta 40 | x(i) = params'*x(i-order:i-1) + noise(i); 41 | end 42 | 43 | s = x(eta+1:end); 44 | 45 | end 46 | -------------------------------------------------------------------------------- /MkSg_Flow.m: -------------------------------------------------------------------------------- 1 | function s = MkSg_Flow(flowName,N,L,s0,params,eta) 2 | % Returns a time series obtained from a given flow 3 | % Output is a signal, s, that has as each column an output from a co-ordinate 4 | % of the specified flow 5 | %---INPUTS: 6 | % --number of points in the time series (as N), 7 | % --time scale (as L) 8 | % --initial conditions (as s0) 9 | % --the parameter vector specific to each ODE (params) 10 | % --length of the transient, eta (number of points) 11 | %------------------------------------------------------------------------------- 12 | 13 | %------------------------------------------------------------------------------- 14 | % PARSE INPUTS, set broad defaults 15 | %------------------------------------------------------------------------------- 16 | if nargin < 1 || isempty(flowName) 17 | flowName = 'Lorenz'; % Lorenz attractor 18 | end 19 | if nargin < 5 20 | params = []; % use defaults specified in function file 21 | end 22 | if nargin < 6 || isempty(eta) 23 | eta = 500; % remove transient -- first 500 data points 24 | end 25 | % Set evaluation/sensitivity options 26 | opts = odeset('reltol',10^-6,'abstol',10^-6); 27 | 28 | %------------------------------------------------------------------------------- 29 | % Other defaults are set for each specific dynamical system 30 | switch flowName 31 | case 'Lorenz' 32 | %% Lorenz Attractor 33 | % Sprott Autonomous Dissipative Flows 34 | if nargin < 2 || isempty(N), N = 1000; end 35 | if nargin < 3 || isempty(L), L = round(N/5); end 36 | if nargin < 4 || isempty(s0), s0 = [0; -0.01; 20]; end 37 | ode = @(t,y) F_lorenz(t,y,params); % Specify the ODE 38 | 39 | case 'Rossler' 40 | %% Rössler Attractor 41 | % Sprott Autonomous Dissipative Flows 42 | if nargin < 2 || isempty(N), N = 1000; end 43 | if nargin < 3 || isempty(L), L = round(N/5); end 44 | if nargin < 4 || isempty(s0), s0 = [-9; 0; 0]; end 45 | ode = @(t,y) F_rossler(t,y,params); % Specify the ODE 46 | 47 | case 'DiffnLorenz' 48 | %% Diffusionless Lorenz Attractor 49 | % Sprott Autonomous Dissipative Flows 50 | if nargin < 2 || isempty(N), N = 1000; end 51 | if nargin < 3 || isempty(L), L = round(N/5); end 52 | if nargin < 4 || isempty(s0), s0 = [0; -0.01; 20]; end 53 | ode = @(t,y) F_diffnlorenz(t,y,params); % Specify the ODE 54 | 55 | case 'ComplexButterfly' 56 | %% Complex Butterfly 57 | % Sprott Autonomous Dissipative Flows 58 | if nargin < 2 || isempty(N), N = 5000; end 59 | if nargin < 3 || isempty(L), L = round(N/2); end 60 | if nargin < 4 || isempty(s0), s0 = [0.2; 0; 0]; end 61 | ode = @(t,y) F_complxbutfly(t,y,params); % Specify the ODE 62 | 63 | case 'Chen' 64 | %% Chen's System 65 | % Sprott Autonomous Dissipative Flows 66 | if nargin < 2 || isempty(N), N = 1000; end 67 | if nargin < 3 || isempty(L), L = round(N/4); end 68 | if nargin < 4 || isempty(s0), s0 = [-10; 0; 37]; end 69 | ode = @(t,y) F_chen(t,y,params); % Specify the ODE 70 | 71 | case 'Hadley' 72 | %% Hadley circulation 73 | % Sprott Autonomous Dissipative Flows 74 | if nargin < 2 || isempty(N), N = 1000; end 75 | if nargin < 3 || isempty(L), L = round(N/100); end 76 | if nargin < 4 || isempty(s0), s0 = [0; 0; 1.3]; end 77 | ode = @(t,y) F_hadley(t,y,params); % Specify the ODE 78 | 79 | case 'ACT' 80 | %% ACT attractor 81 | % Sprott Autonomous Dissipative Flows 82 | if nargin < 2 || isempty(N), N = 1000; end 83 | if nargin < 3 || isempty(L), L = round(N/10); end 84 | if nargin < 4 || isempty(s0), s0 = [0.5; 0; 0]; end 85 | ode = @(t,y) F_ACT(t,y,params); % Specify the ODE 86 | 87 | case 'RabFab' 88 | %% Rabinovich-Fabrikant attactor 89 | % Sprott Autonomous Dissipative Flows 90 | if nargin < 2 || isempty(N), N = 1000; end 91 | if nargin < 3 || isempty(L), L = round(N/10); end 92 | if nargin < 4 || isempty(s0), s0 = [-1; 0; 0.5]; end 93 | ode = @(t,y) F_rabfab(t,y,params); % Specify the ODE 94 | 95 | case 'lfrbms' 96 | %% Linear feedback rigid body motion system (faulty) 97 | % Sprott Autonomous Dissipative Flows 98 | if nargin < 2 || isempty(N), N = 1000; end 99 | if nargin < 3 || isempty(L), L = round(N/5); end 100 | if nargin < 4 || isempty(s0), s0 = [0.6; 0; 0]; end 101 | ode = @(t,y) F_lfrbms(t,y,params); % Specify the ODE 102 | % ------Can't get it to work---------- 103 | 104 | case 'Chua' 105 | %% Chua's circuit 106 | % Sprott Autonomous Dissipative Flows 107 | if nargin < 2 || isempty(N), N = 1000; end 108 | if nargin < 3 || isempty(L), L = round(N/5); end 109 | if nargin < 4 || isempty(s0), s0 = [0; 0; 0.6]; end 110 | ode = @(t,y) F_chua(t,y,params); % Specify the ODE 111 | 112 | case 'MooreSpiegel' 113 | %% Moore-Spiegel oscillator 114 | % Sprott Autonomous Dissipative Flows 115 | if nargin < 2 || isempty(N), N = 1000; end 116 | if nargin < 3 || isempty(L), L = round(N/10); end 117 | if nargin < 4 || isempty(s0), s0 = [0.1; 0; 0]; end 118 | ode = @(t,y) F_moorespiegel(t,y,params); % Specify the ODE 119 | 120 | case 'thomascsa' 121 | %% Thomas' cyclically symmetric attractor 122 | % Sprott Autonomous Dissipative Flows 123 | if nargin < 2 || isempty(N), N = 1000; end 124 | if nargin < 3 || isempty(L), L = round(N/2); end 125 | if nargin < 4 || isempty(s0), s0 = [0.1; 0; 0]; end 126 | ode = @(t,y) F_thomascsa(t,y,params); % Specify the ODE 127 | 128 | case 'halvorsencsa' 129 | %% Halvorsen's cyclically symmetric attractor 130 | % Sprott Autonomous Dissipative Flows 131 | if nargin < 2 || isempty(N), N = 1000; end 132 | if nargin < 3 || isempty(L), L = round(N/10); end 133 | if nargin < 4 || isempty(s0), s0 = [-5; 0; 0]; end 134 | ode = @(t,y) F_halvorsencsa(t,y,params); % Specify the ODE 135 | 136 | case 'BurkeShaw' 137 | %% Burke-Shaw attractor (doesn't work) 138 | % Sprott Autonomous Dissipative Flows 139 | if nargin < 2 || isempty(N), N = 1000; end 140 | if nargin < 3 || isempty(L), L = round(N/5); end 141 | if nargin < 4 || isempty(s0), s0 = [0.6; 0; 0]; end 142 | ode = @(t,y) F_burkeshaw(t,y,params); % Specify the ODE 143 | % ------- Can't get it to work ----------- 144 | 145 | case 'Rucklidge' 146 | %% Rucklidge attractor 147 | % Sprott Autonomous Dissipative Flows 148 | if nargin < 2 || isempty(N), N = 1000; end 149 | if nargin < 3 || isempty(L), L = round(N/10); end 150 | if nargin < 4 || isempty(s0), s0 = [1; 0; 4.5]; end 151 | ode = @(t,y) F_rucklidge(t,y,params); % Specify the ODE 152 | 153 | case 'windmi' 154 | %% WINDMI attractor 155 | % Sprott Autonomous Dissipative Flows 156 | if nargin < 2 || isempty(N), N = 1000; end 157 | if nargin < 3 || isempty(L), L = round(N/2); end 158 | if nargin < 4 || isempty(s0), s0 = [0; 0.8; 0]; end 159 | ode = @(t,y) F_windmi(t,y,params); % Specify the ODE 160 | 161 | case 'simpqcf' 162 | %% Simplest quadratic chaotic flow 163 | % Sprott Autonomous Dissipative Flows 164 | if nargin < 2 || isempty(N), N = 1000; end 165 | if nargin < 3 || isempty(L), L = round(N/2); end 166 | if nargin < 4 || isempty(s0), s0 = [-0.9; 0; 0.5]; end 167 | ode = @(t,y) F_simpqcf(t,y,params); % Specify the ODE 168 | 169 | case 'simpccf' 170 | %% Simplest cubic chaotic flow 171 | % Sprott Autonomous Dissipative Flows 172 | if nargin < 2 || isempty(N), N = 1000; end 173 | if nargin < 3 || isempty(L), L = round(N/2); end 174 | if nargin < 4 || isempty(s0), s0 = [0; 0.96; 0]; end 175 | ode = @(t,y) F_simpccf(t,y,params); % Specify the ODE 176 | 177 | case 'simpplcf' 178 | %% Simplest piecewise linear chaotic flow 179 | % Sprott Autonomous Dissipative Flows 180 | if nargin < 2 || isempty(N), N = 1000; end 181 | if nargin < 3 || isempty(L), L = round(N/2); end 182 | if nargin < 4 || isempty(s0), s0 = [0; -0.7; 0]; end 183 | ode = @(t,y) F_simpplcf(t,y,params); % Specify the ODE 184 | 185 | case 'DoubleScroll' 186 | %% Double scroll 187 | % Sprott Autonomous Dissipative Flows 188 | if nargin < 2 || isempty(N), N = 1000; end 189 | if nargin < 3 || isempty(L), L = round(N/2); end 190 | if nargin < 4 || isempty(s0), s0 = [0.01; 0.01; 0]; end 191 | ode = @(t,y) F_dblscroll(t,y,params); % Specify the ODE 192 | 193 | %%% Sprott's Conservative Flows 194 | case 'DrivenPend' 195 | %% Driven Pendulum 196 | % Sprott's Conservative Flows 197 | if nargin < 2 || isempty(N), N = 1000; end 198 | if nargin < 3 || isempty(L), L = round(N/2); end 199 | if nargin < 4 || isempty(s0), s0 = [0; 0]; end 200 | ode = @(t,y) F_drivenpend(t,y,params); % Specify the ODE 201 | 202 | case 'simpdcf' 203 | %% Simplest Driven Chaotic Flow 204 | % Sprott's Conservative Flows 205 | if nargin < 2 || isempty(N), N = 1000; end 206 | if nargin < 3 || isempty(L), L = N; end 207 | if nargin < 4 || isempty(s0), s0 = [0; 0]; end 208 | ode = @(t,y) F_simpdcf(t,y,params); % Specify the ODE 209 | 210 | case 'nosehoover' 211 | %% Nose-Hoover Oscillator 212 | % Sprott's Conservative Flows 213 | if nargin < 2 || isempty(N), N = 1000; end 214 | if nargin < 3 || isempty(L), L = N; end 215 | if nargin < 4 || isempty(s0), s0 = [0; 5; 0]; end 216 | ode = @(t,y) F_nosehoover(t,y,params); % Specify the ODE 217 | 218 | case 'labyrinth' 219 | %% Labyrinth Chaos 220 | % Sprott's Conservative Flows 221 | if nargin < 2 || isempty(N), N = 1000; end 222 | if nargin < 3 || isempty(L), L = N*2; end 223 | if nargin < 4 || isempty(s0), s0 = [0.1; 0; 0]; end 224 | % (No parameters) 225 | ode = @(t,y) F_labyrinth(t,y); % Specify the ODE 226 | 227 | case 'henonheiles' 228 | %% Henon-Heiles System 229 | % Sprott's Conservative Flows 230 | if nargin < 2 || isempty(N), N = 1000; end 231 | if nargin < 3 || isempty(L), L = round(N/2); end 232 | if nargin < 4 || isempty(s0), s0 = [0.499; 0; 0; 0.03160676]; end 233 | % (No parameters) 234 | ode = @(t,y) F_henonheiles(t,y); % Specify the ODE 235 | 236 | %%% Sprott's Dissipative Flows 237 | case 'DPend' 238 | %% Damped driven pendulum 239 | % Sprott's dissipative flows 240 | if nargin < 2 || isempty(N), N = 1000; end 241 | if nargin < 3 || isempty(L), L = round(N/2); end 242 | if nargin < 4 || isempty(s0), s0 = [0.1; 0.1]; end 243 | ode = @(t,y) F_DPend(t,y,params); % Specify the ODE 244 | 245 | case 'DvdP' 246 | %% Driven van der Pol oscillator 247 | % Sprott's dissipative flows 248 | if nargin < 2 || isempty(N), N = 1000; end 249 | if nargin < 3 || isempty(L), L = round(N/2); end 250 | if nargin < 4 || isempty(s0), s0 = [-1.9; 0.2]; end 251 | ode = @(t,y) F_DvdP(t,y,params); % Specify the ODE 252 | 253 | case 'ShawvdP' 254 | %% Shaw-van der Pol 255 | % Sprott's dissipative flows 256 | if nargin < 2 || isempty(N), N = 1000; end 257 | if nargin < 3 || isempty(L), L = round(N/2); end 258 | if nargin < 4 || isempty(s0), s0 = [1.3; 0.1]; end 259 | ode = @(t,y) F_ShawvdP(t,y,params); % Specify the ODE 260 | 261 | case 'FBruss' 262 | %% Forced Brusselator 263 | % Sprott's dissipative flows 264 | if nargin < 2 || isempty(N), N = 1000; end 265 | if nargin < 3 || isempty(L), L = round(N/2); end 266 | if nargin < 4 || isempty(s0), s0 = [0.3; 2]; end 267 | ode = @(t,y) F_FBruss(t,y,params); % Specify the ODE 268 | 269 | case 'Ueda' 270 | %% Ueda Oscillator 271 | % Sprott's dissipative flows 272 | if nargin < 2 || isempty(N), N = 1000; end 273 | if nargin < 3 || isempty(L), L = round(N/2); end 274 | if nargin < 4 || isempty(s0), s0 = [2.5; 0]; end 275 | ode = @(t,y) F_ueda(t,y,params); % Specify the ODE 276 | 277 | case 'Dufftwowell' 278 | %% Duffing two-well oscillator 279 | % Sprott's dissipative flows 280 | if nargin < 2 || isempty(N), N = 2000; end 281 | if nargin < 3 || isempty(L), L = round(N/2); end 282 | if nargin < 4 || isempty(s0), s0 = [0.2; 0]; end 283 | ode = @(t,y) F_Dufftwowell(t,y,params); % Specify the ODE 284 | 285 | case 'Duffvdp' 286 | %% Duffing van der Pol oscillator 287 | % Sprott's dissipative flows 288 | if nargin < 2 || isempty(N), N = 2000; end 289 | if nargin < 3 || isempty(L), L = round(N/2); end 290 | if nargin < 4 || isempty(s0), s0 = [0.2; -2]; end 291 | ode = @(t,y) F_duffvdp(t,y,params); % Specify the ODE 292 | 293 | case 'vdp' 294 | %% van der Pol oscillator (non chaotic) 295 | if nargin < 2 || isempty(N), N = 4000; end 296 | if nargin < 3 || isempty(L), L = round(N/6); end 297 | if nargin < 4 || isempty(s0), s0 = [1; 1]; end 298 | ode = @(t,y) F_vdp(t,y,params); % Specify the ODE 299 | 300 | case 'Rayduff' 301 | %% Rayleigh-Duffing oscillator 302 | % Sprott's dissipative flows 303 | if nargin < 2 || isempty(N), N = 2000; end 304 | if nargin < 3 || isempty(L), L = round(N/2); end 305 | if nargin < 4 || isempty(s0), s0 = [0.3; 0]; end 306 | ode = @(t,y) F_rayduff(t,y,params); % Specify the ODE 307 | 308 | %%% Sprott's Simple Jerk Systems 309 | case 'JD1' 310 | %% Sprott Jerk 1 311 | if nargin < 2 || isempty(N), N = 2000; end 312 | if nargin < 3 || isempty(L), L = round(N/2); end 313 | if nargin < 4 || isempty(s0), s0 = [0.1; 0; 0]; end 314 | ode = @(t,y) F_sprottJD1(t,y,params); % Specify the ODE 315 | case 'JD2' 316 | %% Sprott Jerk 2 317 | if nargin < 2 || isempty(N), N = 2000; end 318 | if nargin < 3 || isempty(L), L = round(N/2); end 319 | if nargin < 4 || isempty(s0), s0 = [0.1; 0; 0]; end 320 | ode = @(t,y) F_sprottJD2(t,y,params); % Specify the ODE 321 | case 'JD3' 322 | %% Sprott Jerk 3 323 | if nargin < 2 || isempty(N), N = 2000; end 324 | if nargin < 3 || isempty(L), L = round(N/2); end 325 | if nargin < 4 || isempty(s0), s0 = [0.1; 0; 0]; end 326 | ode = @(t,y) F_sprottJD3(t,y,params); % Specify the ODE 327 | case 'JD4' 328 | %% Sprott Jerk 4 329 | if nargin < 2 || isempty(N), N = 2000; end 330 | if nargin < 3 || isempty(L), L = round(N/2); end 331 | if nargin < 4 || isempty(s0), s0 = [0.1; 0; 0]; end 332 | ode = @(t,y) F_sprottJD4(t,y,params); % Specify the ODE 333 | case 'JD5' 334 | %% Sprott Jerk 5 335 | if nargin < 2 || isempty(N), N = 2000; end 336 | if nargin < 3 || isempty(L), L = round(N/2); end 337 | if nargin < 4 || isempty(s0), s0 = [0.1; 0; 0]; end 338 | ode = @(t,y) F_sprottJD5(t,y,params); % Specify the ODE 339 | case 'JD6' 340 | %% Sprott Jerk 6 341 | if nargin < 2 || isempty(N), N = 2000; end 342 | if nargin < 3 || isempty(L), L = round(N/2); end 343 | if nargin < 4 || isempty(s0), s0 = [0.1; 0; 0]; end 344 | ode = @(t,y) F_sprottJD6(t,y,params); % Specify the ODE 345 | case 'JD7' 346 | %% Sprott Jerk 7 347 | if nargin < 2 || isempty(N), N = 2000; end 348 | if nargin < 3 || isempty(L), L = round(N/2); end 349 | if nargin < 4 || isempty(s0), s0 = [0.1; 0; 0]; end 350 | ode = @(t,y) F_sprottJD7(t,y,params); % Specify the ODE 351 | 352 | %%% Sprott's 3D Chaotic FLOWS 353 | % Table 4.1 354 | % All basically parameterless 355 | case '3dcf_A' 356 | %% Sprott 3D chaotic flow A 357 | if nargin < 2 || isempty(N), N = 2000; end 358 | if nargin < 3 || isempty(L), L = round(N/2); end 359 | if nargin < 4 || isempty(s0), s0 = [0.05; 0.05; 0.05]; end 360 | ode = @(t,y) F_Sprott3dcf_A(t,y); % Specify the ODE 361 | case '3dcf_B' 362 | %% Sprott 3D chaotic flow B 363 | if nargin < 2 || isempty(N), N = 2000; end 364 | if nargin < 3 || isempty(L), L = round(N/2); end 365 | if nargin < 4 || isempty(s0), s0 = [0.05; 0.05; 0.05]; end 366 | ode = @(t,y) F_Sprott3dcf_B(t,y); % Specify the ODE 367 | case '3dcf_C' 368 | %% Sprott 3D chaotic flow C 369 | if nargin < 2 || isempty(N), N = 2000; end 370 | if nargin < 3 || isempty(L), L = round(N/2); end 371 | if nargin < 4 || isempty(s0), s0 = [0.05; 0.05; 0.05]; end 372 | ode = @(t,y) F_Sprott3dcf_C(t,y); % Specify the ODE 373 | case '3dcf_D' 374 | %% Sprott 3D chaotic flow D 375 | if nargin < 2 || isempty(N), N = 2000; end 376 | if nargin < 3 || isempty(L), L = round(N/2); end 377 | if nargin < 4 || isempty(s0), s0 = [0.05; 0.05; 0.05]; end 378 | ode = @(t,y) F_Sprott3dcf_D(t,y); % Specify the ODE 379 | case '3dcf_E' 380 | %% Sprott 3D chaotic flow E 381 | if nargin < 2 || isempty(N), N = 2000; end 382 | if nargin < 3 || isempty(L), L = round(N/2); end 383 | if nargin < 4 || isempty(s0), s0 = [0.05; 0.05; 0.05]; end 384 | ode = @(t,y) F_Sprott3dcf_E(t,y); % Specify the ODE 385 | case '3dcf_F' 386 | %% Sprott 3D chaotic flow F 387 | if nargin < 2 || isempty(N), N = 2000; end 388 | if nargin < 3 || isempty(L), L = round(N/2); end 389 | if nargin < 4 || isempty(s0), s0 = [0.05; 0.05; 0.05]; end 390 | ode = @(t,y) F_Sprott3dcf_F(t,y); % Specify the ODE 391 | case '3dcf_G' 392 | %% Sprott 3D chaotic flow G 393 | if nargin < 2 || isempty(N), N = 2000; end 394 | if nargin < 3 || isempty(L), L = round(N/2); end 395 | if nargin < 4 || isempty(s0), s0 = [0.05; 0.05; 0.05]; end 396 | ode = @(t,y) F_Sprott3dcf_G(t,y); % Specify the ODE 397 | case '3dcf_H' 398 | %% Sprott 3D chaotic flow H 399 | if nargin < 2 || isempty(N), N = 2000; end 400 | if nargin < 3 || isempty(L), L = round(N/2); end 401 | if nargin < 4 || isempty(s0), s0 = [0.05; 0.05; 0.05]; end 402 | ode = @(t,y) F_Sprott3dcf_H(t,y); % Specify the ODE 403 | case '3dcf_I' 404 | %% Sprott 3D chaotic flow I 405 | if nargin < 2 || isempty(N), N = 2000; end 406 | if nargin < 3 || isempty(L), L = round(N/2); end 407 | if nargin < 4 || isempty(s0), s0 = [0.05; 0.05; 0.05]; end 408 | ode = @(t,y) F_Sprott3dcf_I(t,y); % Specify the ODE 409 | case '3dcf_J' 410 | %% Sprott 3D chaotic flow J 411 | if nargin < 2 || isempty(N), N = 2000; end 412 | if nargin < 3 || isempty(L), L = round(N/2); end 413 | if nargin < 4 || isempty(s0), s0 = [0.05; 0.05; 0.05]; end 414 | ode = @(t,y) F_Sprott3dcf_J(t,y); % Specify the ODE 415 | case '3dcf_K' 416 | %% Sprott 3D chaotic flow K 417 | if nargin < 2 || isempty(N), N = 2000; end 418 | if nargin < 3 || isempty(L), L = round(N/2); end 419 | if nargin < 4 || isempty(s0), s0 = [0.05; 0.05; 0.05]; end 420 | ode = @(t,y) F_Sprott3dcf_K(t,y); % Specify the ODE 421 | case '3dcf_L' 422 | %% Sprott 3D chaotic flow L 423 | if nargin < 2 || isempty(N), N = 2000; end 424 | if nargin < 3 || isempty(L), L = round(N/2); end 425 | if nargin < 4 || isempty(s0), s0 = [0.05; 10; -4]; end 426 | ode = @(t,y) F_Sprott3dcf_L(t,y); % Specify the ODE 427 | case '3dcf_M' 428 | %% Sprott 3D chaotic flow M 429 | if nargin < 2 || isempty(N), N = 2000; end 430 | if nargin < 3 || isempty(L), L = round(N/2); end 431 | if nargin < 4 || isempty(s0), s0 = [0.05; 0.05; 0.05]; end 432 | ode = @(t,y) F_Sprott3dcf_M(t,y); % Specify the ODE 433 | case '3dcf_N' 434 | %% Sprott 3D chaotic flow N 435 | if nargin < 2 || isempty(N), N = 2000; end 436 | if nargin < 3 || isempty(L), L = round(N/2); end 437 | if nargin < 4 || isempty(s0), s0 = [0.05; 0.05; 0.05]; end 438 | ode = @(t,y) F_Sprott3dcf_N(t,y); % Specify the ODE 439 | case '3dcf_O' 440 | %% Sprott 3D chaotic flow O 441 | if nargin < 2 || isempty(N), N = 2000; end 442 | if nargin < 3 || isempty(L), L = round(N/2); end 443 | if nargin < 4 || isempty(s0), s0 = [0.05; 0.05; 0.05]; end 444 | ode = @(t,y) F_Sprott3dcf_O(t,y); % Specify the ODE 445 | case '3dcf_P' 446 | %% Sprott 3D chaotic flow P 447 | if nargin < 2 || isempty(N), N = 2000; end 448 | if nargin < 3 || isempty(L), L = round(N/2); end 449 | if nargin < 4 || isempty(s0), s0 = [0.05; 0.05; 0.05]; end 450 | ode = @(t,y) F_Sprott3dcf_P(t,y); % Specify the ODE 451 | case '3dcf_Q' 452 | %% Sprott 3D chaotic flow Q 453 | if nargin < 2 || isempty(N), N = 2000; end 454 | if nargin < 3 || isempty(L), L = round(N/2); end 455 | if nargin < 4 || isempty(s0), s0 = [0.05; 0.05; 0.05]; end 456 | ode = @(t,y) F_Sprott3dcf_Q(t,y); % Specify the ODE 457 | case '3dcf_R' 458 | %% Sprott 3D chaotic flow R 459 | if nargin < 2 || isempty(N), N = 2000; end 460 | if nargin < 3 || isempty(L), L = round(N/2); end 461 | if nargin < 4 || isempty(s0), s0 = [0.05; 0.05; 0.05]; end 462 | ode = @(t,y) F_Sprott3dcf_R(t,y); % Specify the ODE 463 | case '3dcf_S' 464 | %% Sprott 3D chaotic flow S 465 | if nargin < 2 || isempty(N), N = 2000; end 466 | if nargin < 3 || isempty(L), L = round(N/2); end 467 | if nargin < 4 || isempty(s0), s0 = [0.05; 0.05; 0.05]; end 468 | ode = @(t,y) F_Sprott3dcf_S(t,y); % Specify the ODE 469 | 470 | otherwise 471 | disp([flowName ' has no matches']); return 472 | end 473 | 474 | % Specify the time span 475 | tspan = [1,L+eta]; 476 | 477 | %------------------------------------------------------------------------------- 478 | % Solve the ODE: 479 | fprintf(1,'Solving %s (ODE45)..........\n',flowName); 480 | tic 481 | sol = ode45(ode,tspan,s0,opts); 482 | fprintf(1,'Solving %s took %s\n',BF_thetime(toc)); 483 | 484 | % Evaluate solution on a discrete grid of N points, eliminating the transient 485 | t = linspace(1+eta, L+eta, N); 486 | s = deval(sol,t)'; 487 | 488 | % Ensure a column vector 489 | if size(s,2) > size(s,1) 490 | s = s'; 491 | end 492 | 493 | end 494 | -------------------------------------------------------------------------------- /MkSg_SelfAffine.m: -------------------------------------------------------------------------------- 1 | function s = MkSg_SelfAffine(N,alpha,generateHow) 2 | % Generates a self-affine time series 3 | %------------------------------------------------------------------------------- 4 | 5 | if nargin < 1 6 | N = 5000; 7 | end 8 | if nargin < 2 9 | alpha = 0.5; 10 | end 11 | if nargin < 3 12 | generateHow = 'powernoise'; 13 | end 14 | 15 | %------------------------------------------------------------------------------- 16 | 17 | switch generateHow 18 | case 'powernoise' 19 | s = F_powernoise(alpha,N); % deterministic powerlaw-correlated noise 20 | case 'rmpnoise' 21 | % I think you need to alter to input the Hurst exponent, H: 22 | H = 0.5*(alpha+1); 23 | s = F_rmpnoise(H,N); % powerlaw-correlated noise 24 | end 25 | 26 | %=============================================================================== 27 | % N = 5000; 28 | % alphar = (-1:0.02:4); 29 | % for i = 1:length(alphar) 30 | % x = powernoise(alphar(i), N); % deterministic powerlaw-correlated noise 31 | % plot(x(1:500),'.-k'); 32 | % title(alphar(i),'interpreter','none') 33 | % disp(alphar(i)) 34 | % Y = abs(fft(x)).^2; 35 | % Y = Y(1:end/2); 36 | % p = polyfit(log(1:length(Y))',log(Y),1); 37 | % disp(p(1)); 38 | % end 39 | %=============================================================================== 40 | 41 | 42 | end 43 | -------------------------------------------------------------------------------- /MkSg_map.m: -------------------------------------------------------------------------------- 1 | function s = MkSg_Map(mapName,N,s0,params,eta) 2 | % returns a time series obtained from given conservative map from the 3 | % list of maps in Chaos and Time-Series Analysis by J. C. Sprott 4 | % Output is a signal, s, that has as each column an output from a coordinate of 5 | % the specified map 6 | %------------------------------------------------------------------------------- 7 | 8 | %% Set broad defaults 9 | if nargin < 1 || isempty(mapName) 10 | mapName = 'Chirikov'; % Henon map 11 | end 12 | if nargin < 2 || isempty(N) 13 | N = 1000; % time series 1000 points long 14 | end 15 | if nargin < 5 || isempty(eta) 16 | eta = 500; % remove transient -- first 500 data points 17 | end 18 | 19 | % Set other defaults within each specific map 20 | 21 | switch mapName 22 | %%% Sprott Conservative Maps 23 | case 'Chirikov' 24 | %% Chirikov (standard) map 25 | % Sprott conservative map 26 | % parameter is k 27 | % Set defaults 28 | if nargin < 3 || isempty(s0), s0 = [0.1,6]; end 29 | if nargin < 4 || isempty(params), params = 1; end 30 | % Initialize 31 | x = zeros(N+eta,1); 32 | y = zeros(N+eta,1); 33 | % Initial conditions 34 | x(1) = s0(1); 35 | y(1) = s0(2); 36 | % Parameters 37 | k = params; 38 | % Simulate the map 39 | for i = 2:N+eta 40 | y(i) = mod(y(i-1) + k*sin(x(i-1)), 2*pi); 41 | x(i) = mod(x(i-1) + y(i), 2*pi); 42 | end 43 | % Remove transient 44 | x = x(1+eta:end); 45 | y = y(1+eta:end); 46 | % Package into signal output 47 | s = [x,y]; 48 | 49 | case 'Henonqm' 50 | %% Henon area-preserving quadratic map 51 | % Sprott conservative map 52 | % Parameter is alpha 53 | % Set defaults 54 | if nargin < 3 || isempty(s0), s0 = [0.6,0.13]; end 55 | if nargin < 4 || isempty(params), params = acos(0.24); end 56 | % Initialize 57 | x = zeros(N+eta,1); 58 | y = zeros(N+eta,1); 59 | % Initial conditions 60 | x(1) = s0(1); 61 | y(1) = s0(2); 62 | % Parameters 63 | alpha = params; 64 | % Simulate the map 65 | for i = 2:N+eta 66 | x(i) = x(i-1)*cos(alpha) - (y(i-1) - x(i-1)^2) * sin(alpha); 67 | y(i) = x(i-1)*sin(alpha) + (y(i-1) - x(i-1)^2) * cos(alpha); 68 | end 69 | % Remove transient 70 | x = x(1+eta:end); 71 | y = y(1+eta:end); 72 | % Package into signal output 73 | s = [x,y]; 74 | 75 | case 'Arnold' 76 | %% Arnold's cat map 77 | % Sprott conservative map 78 | % Set defaults 79 | if nargin < 3 || isempty(s0), s0=[0,1/sqrt(2)]; end % normal initial conditions 80 | if nargin < 4 || isempty(params), params = 2; end % k=2, normal 81 | % Initialize 82 | x = zeros(N+eta,1); 83 | y = zeros(N+eta,1); 84 | % Initial conditions 85 | x(1) = s0(1); 86 | y(1) = s0(2); 87 | % Parameters 88 | k = params; 89 | % Simulate the map 90 | for i=2:N+eta 91 | x(i) = mod(x(i-1) + y(i-1), 1); 92 | y(i) = mod(x(i-1) + k*y(i-1), 1); 93 | end 94 | % Remove transient 95 | x = x(1+eta:end); 96 | y = y(1+eta:end); 97 | % Package into signal output 98 | s = [x,y]; 99 | 100 | case 'Gingerbreadman' 101 | %% Gingerbreadman map 102 | % Sprott conservative map 103 | % Set defaults 104 | if nargin < 3 || isempty(s0), s0=[0.51,3.7]; end % initial conditions 105 | % Initialize 106 | x = zeros(N+eta,1); 107 | y = zeros(N+eta,1); 108 | % Initial conditions 109 | x(1) = s0(1); 110 | y(1) = s0(2); 111 | % 112 | % Simulate the map 113 | for i=2:N+eta 114 | x(i) = 1 + abs(x(i-1)) - y(i-1); 115 | y(i) = x(i-1); 116 | end 117 | % Remove transient 118 | x = x(1+eta:end); 119 | y = y(1+eta:end); 120 | % Package into signal output 121 | s = [x,y]; 122 | 123 | case 'Chaoticweb' 124 | %% Chaotic web map 125 | % Sprott conservative map 126 | % Set defaults 127 | if nargin < 3 || isempty(s0), s0=[0,2.98]; end % initial conditions 128 | if nargin < 4 || isempty(params), params = [pi/2, 1]; end % alpha = pi/2, k = 1 129 | % Initialize 130 | x = zeros(N+eta,1); 131 | y = zeros(N+eta,1); 132 | % Initial conditions 133 | x(1) = s0(1); 134 | y(1) = s0(2); 135 | % Parameters 136 | alpha = params(1); 137 | k = params(2); 138 | % Simulate the map 139 | for i=2:N+eta 140 | x(i) = x(i-1)*cos(alpha) - (y(i-1) + k*sin(x(i-1))) * sin(alpha); 141 | y(i) = x(i-1)*sin(alpha) + (y(i-1) + k*sin(x(i-1))) * cos(alpha); 142 | end 143 | % Remove transient 144 | x = x(1+eta:end); 145 | y = y(1+eta:end); 146 | % Package into signal output 147 | s = [x,y]; 148 | 149 | case 'Lorenz3d' 150 | %% Lorenz 3D chaotic map 151 | % Sprott conservative map 152 | % Set defaults 153 | if nargin < 3 || isempty(s0), s0=[0.5,0.51,-0.99]; end % initial conditions 154 | % Initialize 155 | x = zeros(N+eta,1); 156 | y = zeros(N+eta,1); 157 | z = zeros(N+eta,1); 158 | % Initial conditions 159 | x(1) = s0(1); 160 | y(1) = s0(2); 161 | z(1) = s0(3); 162 | % < No Parameters > 163 | % Simulate the map 164 | for i=2:N+eta 165 | x(i) = x(i-1)*y(i-1)-z(i-1); 166 | y(i) = x(i-1); 167 | z(i) = y(i-1); 168 | end 169 | % Remove transient 170 | x = x(1+eta:end); 171 | y = y(1+eta:end); 172 | z = z(1+eta:end); 173 | % Package into signal output 174 | s = [x,y,z]; 175 | 176 | %%% Sprott: Dissipative Maps 177 | case 'Henon' 178 | %% Henon map 179 | % Sprott dissipative map 180 | % Set defaults 181 | if nargin < 3 || isempty(s0), s0=[0.1,0.8]; end % initial conditions 182 | if nargin < 4 || isempty(params), params = [1.4, 0.3]; end % a=1.4, b=0.3 (nominal) 183 | % Initialize 184 | x = zeros(N+eta,1); 185 | y = zeros(N+eta,1); 186 | % Initial conditions 187 | x(1) = s0(1); 188 | y(1) = s0(2); 189 | % Parameters 190 | a = params(1); 191 | b = params(2); 192 | % Simulate the map 193 | for i=2:N+eta 194 | x(i) = 1 - a*x(i-1)^2 + b*y(i-1); 195 | y(i) = x(i-1); 196 | end 197 | % Remove transient 198 | x = x(1+eta:end); 199 | y = y(1+eta:end); 200 | % Package into signal output 201 | s = [x,y]; 202 | 203 | case 'Lozi' 204 | %% Lozi map 205 | % Sprott dissipative map 206 | % Set defaults 207 | if nargin < 3 || isempty(s0), s0=[-0.2,0.1]; end % initial conditions 208 | if nargin < 4 || isempty(params), params = [1.7, 0.5]; end % a=1.4, b=0.3 (nominal) 209 | % Initialize 210 | x = zeros(N+eta,1); 211 | y = zeros(N+eta,1); 212 | % Initial conditions 213 | x(1) = s0(1); 214 | y(1) = s0(2); 215 | % Parameters 216 | a = params(1); 217 | b = params(2); 218 | % Simulate the map 219 | for i=2:N+eta 220 | x(i) = 1 - a*abs(x(i-1)) + b*y(i-1); 221 | y(i) = x(i-1); 222 | end 223 | % Remove transient 224 | x = x(1+eta:end); 225 | y = y(1+eta:end); 226 | % Package into signal output 227 | s = [x,y]; 228 | 229 | case 'DelayedLogistic' 230 | %% Delayed logistic map 231 | % Sprott dissipative map 232 | % Set defaults 233 | if nargin < 3 || isempty(s0), s0=[0.001,0.001]; end % initial conditions 234 | if nargin < 4 || isempty(params), params = 2.27; end % A=2.27 (nominal) 235 | % Initialize 236 | x = zeros(N+eta,1); 237 | y = zeros(N+eta,1); 238 | % Initial conditions 239 | x(1) = s0(1); 240 | y(1) = s0(2); 241 | % Parameters 242 | A = params; 243 | % Simulate the map 244 | for i=2:N+eta 245 | x(i) = A*x(i-1)*(1-y(i-1)); 246 | y(i) = x(i-1); 247 | end 248 | % Remove transient 249 | x = x(1+eta:end); 250 | y = y(1+eta:end); 251 | % Package into signal output 252 | s = [x,y]; 253 | 254 | case 'Tinkerbell' 255 | %% Tinkerbell map 256 | % Sprott dissipative maps 257 | % Set defaults 258 | if nargin < 3 || isempty(s0), s0=[0.1,0.4]; end % initial conditions 259 | if nargin < 4 || isempty(params), params = [0.9, -0.6, 2, 0.5]; end % a,b,c,d -- all nominal 260 | % Initialize 261 | x = zeros(N+eta,1); 262 | y = zeros(N+eta,1); 263 | % Initial conditions 264 | x(1) = s0(1); 265 | y(1) = s0(2); 266 | % Parameters 267 | a = params(1); 268 | b = params(2); 269 | c = params(3); 270 | d = params(4); 271 | % Simulate the map 272 | for i=2:N+eta 273 | x(i) = x(i-1)^2 - y(i-1)^2 + a*x(i-1) + b*y(i-1); 274 | y(i) = 2*x(i-1)*y(i-1) + c*x(i-1) + d*y(i-1); 275 | end 276 | % Remove transient 277 | x = x(1+eta:end); 278 | y = y(1+eta:end); 279 | % Package into signal output 280 | s = [x,y]; 281 | 282 | case 'Burgers' 283 | %% Burgers map 284 | % Sprott dissipative maps 285 | % Set defaults 286 | if nargin < 3 || isempty(s0), s0=[-0.2,0.1]; end % initial conditions 287 | if nargin < 4 || isempty(params), params = [0.75, 1.75]; end % a,b -- nominal 288 | % Initialize 289 | x = zeros(N+eta,1); 290 | y = zeros(N+eta,1); 291 | % Initial conditions 292 | x(1) = s0(1); 293 | y(1) = s0(2); 294 | % Parameters 295 | a = params(1); 296 | b = params(2); 297 | % Simulate the map 298 | for i=2:N+eta 299 | x(i) = a*x(i-1) - y(i-1)^2; 300 | y(i) = b*y(i-1) + x(i-1)*y(i-1); 301 | end 302 | % Remove transient 303 | x = x(1+eta:end); 304 | y = y(1+eta:end); 305 | % Package into signal output 306 | s = [x,y]; 307 | 308 | case 'HolmesCubic' 309 | %% Holmes Cubic map 310 | % Sprott dissipative maps 311 | % Set defaults 312 | if nargin < 3 || isempty(s0), s0=[1.7,0]; end % initial conditions 313 | if nargin < 4 || isempty(params), params = [0.2, 2.77]; end % b,d -- nominal 314 | % Initialize 315 | x = zeros(N+eta,1); 316 | y = zeros(N+eta,1); 317 | % Initial conditions 318 | x(1) = s0(1); 319 | y(1) = s0(2); 320 | % Parameters 321 | b = params(1); 322 | d = params(2); 323 | % Simulate the map 324 | for i=2:N+eta 325 | x(i) = y(i-1); 326 | y(i) = -b*x(i-1) + d*y(i-1) - y(i-1)^3; 327 | end 328 | % Remove transient 329 | x = x(1+eta:end); 330 | y = y(1+eta:end); 331 | % Package into signal output 332 | s = [x,y]; 333 | 334 | case 'KaplanYorke' 335 | %% Kaplan-Yorke map 336 | % Sprott dissipative maps 337 | % Set defaults 338 | if nargin < 3 || isempty(s0), s0=[1/sqrt(2),-0.4]; end % initial conditions (usual) 339 | if nargin < 4 || isempty(params), params = [1.99999999, 0.2]; end % a,b -- nominal 340 | % Initialize 341 | x = zeros(N+eta,1); 342 | y = zeros(N+eta,1); 343 | % Initial conditions 344 | x(1) = s0(1); 345 | y(1) = s0(2); 346 | % Parameters 347 | a = params(1); 348 | b = params(2); 349 | % Simulate the map 350 | for i=2:N+eta 351 | x(i) = mod(a*x(i-1),1); 352 | y(i) = mod(b*y(i-1) + cos(4*pi*x(i-1)), 1); 353 | end 354 | % Remove transient 355 | x = x(1+eta:end); 356 | y = y(1+eta:end); 357 | % Package into signal output 358 | s = [x,y]; 359 | 360 | case 'DissipativeStandard' 361 | %% Dissipative Standard map 362 | % Sprott dissipative maps 363 | % Set defaults 364 | if nargin < 3 || isempty(s0), s0=[1/sqrt(2),-0.4]; end % initial conditions (usual) 365 | if nargin < 4 || isempty(params), params = [0.1, 8.8]; end % b,k -- nominal 366 | % Initialize 367 | x = zeros(N+eta,1); 368 | y = zeros(N+eta,1); 369 | % Initial conditions 370 | x(1) = s0(1); 371 | y(1) = s0(2); 372 | % Parameters 373 | b = params(1); 374 | k = params(2); 375 | % Simulate the map 376 | for i=2:N+eta 377 | y(i) = mod(b*y(i-1) + k*sin(x(i-1)), 2*pi); 378 | x(i) = mod(x(i-1) + y(i),2*pi); 379 | end 380 | % Remove transient 381 | x = x(1+eta:end); 382 | y = y(1+eta:end); 383 | % Package into signal output 384 | s = [x,y]; 385 | 386 | case 'Ikeda' 387 | %% Ikeda map 388 | % Sprott dissipative maps 389 | % Set defaults 390 | if nargin < 3 || isempty(s0), s0=[0.05,0]; end % initial conditions 391 | if nargin < 4 || isempty(params), params = [6, 0.4, 1, 0.9]; end % alpha, beta, gamma, mu -- nominal 392 | % Initialize 393 | x = zeros(N+eta,1); 394 | y = zeros(N+eta,1); 395 | % Initial conditions 396 | x(1) = s0(1); 397 | y(1) = s0(2); 398 | % Parameters 399 | alpha = params(1); 400 | beta = params(2); 401 | gamma = params(3); 402 | mu = params(4); 403 | % Simulate the map 404 | for i=2:N+eta 405 | theta = beta - alpha/(1 + x(i-1)^2 + y(i-1)^2); 406 | x(i) = gamma + mu*(x(i-1)*cos(theta) - y(i-1)*sin(theta)); 407 | y(i) = mu*(x(i-1)*sin(theta) + y(i-1)*cos(theta)); 408 | end 409 | % Remove transient 410 | x = x(1+eta:end); 411 | y = y(1+eta:end); 412 | % Package into signal output 413 | s = [x,y]; 414 | 415 | case 'Sinai' 416 | %% Sinai map 417 | % Sprott dissipative maps 418 | % Set defaults 419 | if nargin < 3 || isempty(s0), s0=[0.5,0.5]; end % initial conditions 420 | if nargin < 4 || isempty(params), params = 0.10; end % delta 421 | % Initialize 422 | x = zeros(N+eta,1); 423 | y = zeros(N+eta,1); 424 | % Initial conditions 425 | x(1) = s0(1); 426 | y(1) = s0(2); 427 | % Parameters 428 | delta = params; 429 | % Simulate the map 430 | for i=2:N+eta 431 | x(i) = mod(x(i-1) + y(i-1) + delta*cos(2*pi*y(i-1)), 1); 432 | y(i) = mod(x(i-1) + 2*y(i-1),1); 433 | end 434 | % Remove transient 435 | x = x(1+eta:end); 436 | y = y(1+eta:end); 437 | % Package into signal output 438 | s = [x,y]; 439 | 440 | case 'PredatorPrey' 441 | %% Discrete Predator-Prey Map 442 | % Sprott dissipative maps 443 | % Set defaults 444 | if nargin < 3 || isempty(s0), s0=[0.5,0.5]; end % initial conditions 445 | if nargin < 4 || isempty(params), params = [0.3, 1, 5]; end % r, K, alpha (normal) 446 | % Initialize 447 | x = zeros(N+eta,1); 448 | y = zeros(N+eta,1); 449 | % Initial conditions 450 | x(1) = s0(1); 451 | y(1) = s0(2); 452 | % Parameters 453 | r = params(1); 454 | K = params(2); 455 | alpha = params(3); 456 | % Simulate the map 457 | for i=2:N+eta 458 | x(i) = x(i-1)*exp(r*(1 - x(i-1)/K) - alpha*y(i-1)); 459 | y(i) = x(i-1)*(1 - exp(-alpha*y(i-1))); 460 | end 461 | % Remove transient 462 | x = x(1+eta:end); 463 | y = y(1+eta:end); 464 | % Package into signal output 465 | s = [x,y]; 466 | 467 | %%% Autoregressive Maps 468 | case 'FreitasStochasticSine' 469 | %% Freitas stochastic sine map 470 | % Map from the literature: Freitas, Letellier, Aguirre: PRE 79,035201(R) (2009) 471 | % x_{n+1},0 = mu*sin(x_n) + Y_n*eta_n 472 | % Y_n is Bernoulii: y=binornd(1,q,[]) q is the probability y=1 473 | % eta is (cts) uniform random: eta=unifrnd(-b,b,[]) with magnitude b 474 | % So when q=0, it's a sine map on a period-2 limit cycle, otherwise it 475 | % occasionally gets kicked, perhaps to another limit cycle (there are two fixed 476 | % points -- at -2 and at 2) 477 | 478 | % Set defaults 479 | if nargin < 3 || isempty(s0), s0 = unifrnd(-1,1,1); end % initial conditions 480 | if nargin < 4 || isempty(params), params = [2.4, 1, 0.1]; end % mu, b, q 481 | % Parameters 482 | mu = params(1); % amplitude of sine 483 | b = params(2); % amplitude of noise 484 | q = params(3); % probability of random kick occurring 485 | % Initialize 486 | x = zeros(N+eta,1); 487 | y = binornd(1,q,[N+eta, 1]); 488 | n = unifrnd(-b,b,[N+eta, 1]); 489 | % Initial condition 490 | x(1) = s0; 491 | % Simulate the map 492 | for i = 2:N+eta 493 | x(i) = mu*sin(x(i-1)) + y(i)*n(i); 494 | end 495 | % Remove transient 496 | x = x(1+eta:end); 497 | % Package into signal output, s 498 | s = x; 499 | 500 | case 'FreitasNonlinearMA' 501 | %% Freita's Nonlinear Moving Average Filter 502 | % Map from the literature: Freitas, Letellier, Aguirre: PRE 79,035201(R) (2009) 503 | % A nonlinear moving average filter of uniform random noise: 504 | % x_{n},0 = a*u_n + b*u_{n-1},0*(1-u_n) 505 | % The paper didn't give values for the parameters a and b: 506 | % I have just used uniform random numbers for both a and b between -5 and 5, 507 | % Getting a new value at each iteration, and with each interation receiving two occurances [1 2] 508 | % initial condition is also uniform continuous random [-5 5] 509 | 510 | % Set defaults 511 | if nargin < 3 || isempty(s0), s0 = unifrnd(-5,5,1); end % initial conditions 512 | if nargin < 4 || isempty(params), params = [2, 1]; end % a, b 513 | % Initialize 514 | x = zeros(N+eta,1); 515 | u = unifrnd(0,1,[N+eta 1]); 516 | % Initial conditions 517 | x(1) = s0; 518 | % Parameters 519 | a = params(1); 520 | b = params(2); 521 | % Simulate the map 522 | for i=2:N+eta 523 | x(i) = a*u(i) + b*u(i-1)*(1-u(i)); 524 | end 525 | % Remove transient 526 | x = x(1+eta:end); 527 | % Package into signal output, s 528 | s = x; 529 | 530 | case 'CaoPeriodic' 531 | %% Cao Periodic Map 532 | % To show his method for determining the dimension he uses this four-dimensional system: 533 | % x_{n+4},0 = sin(x_n+5) + sin(2x_{n+1},0+5) + sin(3x_{n+2},0+5) + sin(4x_{n+3},0+5) 534 | % Not quite autoregressive... Nonlinear autoregressive maybe? 535 | % Set defaults 536 | if nargin < 3 || isempty(s0), s0 = rand(4,1); end % initial conditions (4 of them) 537 | % Initialize 538 | x = zeros(N+eta,1); 539 | % Initial conditions 540 | x(1:4) = s0; 541 | % Simulate the map 542 | for i=5:N+eta 543 | x(i) = sin(x(i-4)+5) + sin(2*x(i-3)+5) + sin(3*x(i-2)+5) + sin(4*x(i-1)+5); 544 | end 545 | % Remove transient 546 | x = x(1+eta:end); 547 | % Package into signal output, s 548 | s = x; 549 | 550 | %%% Sprott's Noninvertible Maps 551 | % Appendix A.1 of his book 552 | case 'logistic' 553 | %% Logistic Map 554 | % Set defaults 555 | if nargin < 3 || isempty(s0), s0 = 0.1; end % normal initial conditions 556 | if nargin < 4 || isempty(params), params = 4; end % A=4, chaos 557 | % Initialize 558 | x = zeros(N+eta,1); 559 | % Initial conditions 560 | x(1) = s0; 561 | % Parameters 562 | A = params; 563 | % Simulate the map 564 | for i=2:N+eta 565 | x(i) = A*x(i-1)*(1-x(i-1)); 566 | end 567 | % Remove transient as signal to return 568 | s = x(1+eta:end); 569 | 570 | case 'sine' 571 | %% Sine Map 572 | % Set defaults 573 | if nargin < 3 || isempty(s0), s0 = 0.1; end % initial condition 574 | if nargin < 4 || isempty(params), params = 1; end % A=1, chaos 575 | % Initialize 576 | x = zeros(N+eta,1); 577 | % Initial conditions 578 | x(1) = s0; 579 | % Parameters 580 | A = params; 581 | % Simulate the map 582 | for i=2:N+eta 583 | x(i)=A*sin(pi*x(i-1)); 584 | end 585 | % Remove transient as signal to return 586 | s = x(1+eta:end); 587 | 588 | case 'tent' 589 | %% Tent Map 590 | % Set defaults 591 | if nargin < 3 || isempty(s0), s0 = 1/sqrt(2); end % normal initial conditions 592 | if nargin < 4 || isempty(params), params = 1.9999999; end % A=1.999999, chaos 593 | % Initialize 594 | x = zeros(N+eta,1); 595 | % Initial conditions 596 | x(1) = s0; 597 | % Parameters 598 | A = params; 599 | % Simulate the map 600 | for i=2:N+eta 601 | x(i) = A*min([x(i-1), 1-x(i-1)]); 602 | end 603 | % Remove transient as signal to return 604 | s = x(1+eta:end); 605 | 606 | case 'lincongen' 607 | %% Linear Congruential Generator 608 | % Set defaults 609 | if nargin < 3 || isempty(s0), s0 = 0.1; end % initial condition 610 | if nargin < 4 || isempty(params), params = [7141, 54773, 259200]; end % [A,B,C] -- nominal 611 | % Initialize 612 | x = zeros(N+eta,1); 613 | % Initial conditions 614 | x(1) = s0; 615 | % Parameters 616 | A = params(1); 617 | B = params(2); 618 | C = params(3); 619 | % Simulate the map 620 | for i=2:N+eta 621 | x(i) = mod(A*x(i-1) + B,C); 622 | end 623 | % Remove transient as signal to return 624 | s = x(1+eta:end); 625 | 626 | case 'cubic' 627 | %% Cubic Map 628 | % Set defaults 629 | if nargin < 3 || isempty(s0), s0 = 0.1; end % initial condition 630 | if nargin < 4 || isempty(params), params = 2.6; end % A 631 | % Initialize 632 | x = zeros(N+eta,1); 633 | % Initial conditions 634 | x(1) = s0; 635 | % Parameters 636 | A = params; 637 | % Simulate the map 638 | for i=2:N+eta 639 | x(i) = A*x(i-1)*(1-x(i-1)^2); 640 | end 641 | % Remove transient as signal to return 642 | s = x(1+eta:end); 643 | 644 | case 'rickerspopulation' 645 | %% Ricker's Population Model 646 | % Set defaults 647 | if nargin < 3 || isempty(s0), s0 = 0.1; end % initial condition 648 | if nargin < 4 || isempty(params), params = 20; end % A 649 | % Initialize 650 | x = zeros(N+eta,1); 651 | % Initial conditions 652 | x(1) = s0; 653 | % Parameters 654 | A = params; 655 | % Simulate the map 656 | for i=2:N+eta 657 | x(i) = A*x(i-1)*exp(-x(i-1)); 658 | end 659 | % Remove transient as signal to return 660 | s = x(1+eta:end); 661 | 662 | case 'Gauss' 663 | %% Gauss map 664 | % Set defaults 665 | if nargin < 3 || isempty(s0), s0 = 0.1; end % initial condition 666 | % Initialize 667 | x = zeros(N+eta,1); 668 | % Initial conditions 669 | x(1) = s0; 670 | % Simulate the map 671 | for i=2:N+eta 672 | x(i)=mod(1/x(i-1),1); % Gauss Map 673 | end 674 | % Remove transient as signal to return 675 | s = x(1+eta:end); 676 | 677 | case 'Cusp' 678 | %% Cusp map 679 | % Set defaults 680 | if nargin < 3 || isempty(s0), s0 = 0.1; end % initial condition 681 | if nargin < 4 || isempty(params), params = 1.95; end % A 682 | % Initialize 683 | x = zeros(N+eta,1); 684 | % Initial conditions 685 | x(1) = s0; 686 | % Parameters 687 | A = params; 688 | % Simulate the map 689 | for i=2:N+eta 690 | x(i) = 1 - A*sqrt(abs(x(i-1)));; 691 | end 692 | % Remove transient as signal to return 693 | s = x(1+eta:end); 694 | 695 | case 'GaussWCM' 696 | %% Gaussian white chaotic map 697 | % Set defaults 698 | if nargin < 3 || isempty(s0), s0 = 0.1; end % initial condition 699 | % Initialize 700 | x = zeros(N+eta,1); 701 | % Initial conditions 702 | x(1) = s0; 703 | % Simulate the map 704 | for i=2:N+eta 705 | x(i)=abs(x(i-1))^(-0.25)-0.5-abs(x(i-1)); 706 | % x(i)=A*erfinv(1-2*erf(x(i-1)/A)); % Gaussian white chaotic map DOESN'T WORK 707 | end 708 | % Remove transient as signal to return 709 | s = x(1+eta:end); 710 | 711 | case 'Pinchers' 712 | %% Pinchers Map 713 | % Set defaults 714 | if nargin < 3 || isempty(s0), s0 = 0; end % initial condition 715 | if nargin < 4 || isempty(params), params = [2, 0.5]; end % [s,c] 716 | % Initialize 717 | x = zeros(N+eta,1); 718 | % Initial conditions 719 | x(1) = s0; 720 | % Parameters 721 | s = params(1); 722 | c = params(2); 723 | % Simulate the map 724 | for i=2:N+eta 725 | x(i) = abs(tanh(s*(x(i-1)-c))); 726 | end 727 | % Remove transient as signal to return 728 | s = x(1+eta:end); 729 | 730 | case 'Spence' 731 | %% Spence Map 732 | % Set defaults 733 | if nargin < 3 || isempty(s0), s0 = 0.1; end % initial condition 734 | % Initialize 735 | x = zeros(N+eta,1); 736 | % Initial conditions 737 | x(1) = s0; 738 | % Simulate the map 739 | for i=2:N+eta 740 | x(i) = abs(log(x(i-1))); 741 | end 742 | % Remove transient as signal to return 743 | s = x(1+eta:end); 744 | 745 | case 'Sinecircle' 746 | %% Sine-circle Map 747 | % Set defaults 748 | if nargin < 3 || isempty(s0), s0 = 0; end % initial condition 749 | if nargin < 4 || isempty(params), params = [2.1, 0.44]; end % [K, Omega] 750 | % Initialize 751 | x = zeros(N+eta,1); 752 | % Initial conditions 753 | x(1) = s0; 754 | % Parameters 755 | K = params(1); 756 | Omega = params(2); 757 | % Simulate the map 758 | for i=2:N+eta 759 | x(i) = mod(x(i-1) + Omega - K/(2*pi)*sin(2*pi*x(i-1)),1); 760 | end 761 | % Remove transient as signal to return 762 | s = x(1+eta:end); 763 | 764 | %%% More Maps 765 | case 'Julia' 766 | %% Julia Map 767 | % Not sure where I got this map from. It's probably mentioned in Sprott. 768 | % Can't get it to do anything interesting 769 | % Set defaults 770 | if nargin < 3 || isempty(s0), s0 = [0.1, 0.1]; end % initial condition 771 | % Initialize 772 | x = zeros(N+eta,1); 773 | y = zeros(N+eta,1); 774 | % Initial conditions 775 | x(1) = s0(1); 776 | y(1) = s0(2); 777 | % Simulate the map 778 | for i=2:N+eta 779 | x(i) = x(i-1)^2 - y(i-1)^2 - 1; 780 | y(i) = 2*x(i-1)*y(i-1); 781 | end 782 | % Remove transient as signal to return 783 | s = [x(1+eta:end) y(1+eta:end)]; 784 | 785 | 786 | otherwise 787 | disp(['Invalid map name']); 788 | s = NaN; 789 | return 790 | end 791 | 792 | 793 | 794 | end 795 | -------------------------------------------------------------------------------- /MkSg_noise.m: -------------------------------------------------------------------------------- 1 | function s = MkSg_Noise(whatDistribution,N,params) 2 | % Returns a noisy time series 3 | % Length N 4 | % Sampled from a given distribution whatDistribution 5 | % with defining parameters params 6 | %------------------------------------------------------------------------------- 7 | 8 | if nargin < 1 || isempty(whatDistribution) 9 | whatDistribution = 'uniform'; 10 | end 11 | if nargin < 2 || isempty(N) 12 | N = 1000; 13 | end 14 | %------------------------------------------------------------------------------- 15 | 16 | switch whatDistribution 17 | case 'uniform' 18 | s = rand(N,1); 19 | case 'normal' 20 | s = randn(N,1); 21 | case 'beta' 22 | % Uses the MATLAB Statistics Toolbox 23 | % params specifies a two-component vector [a,b] 24 | if nargin<3 || isempty(params), params = [1,1]; end 25 | a = params(1); 26 | b = params(2); 27 | s = betarnd(a,b,N,1); 28 | case 'exp' 29 | % Uses the MATLAB Statistics Toolbox 30 | % params specifies the mean parameter mu 31 | if nargin<3 || isempty(params), params = 1; end 32 | mu = params; 33 | s = exprnd(mu,N,1); 34 | case 'gamma' 35 | % Uses the MATLAB Statistics Toolbox 36 | % params specifies the gamma distribution parameters [a,b] 37 | if nargin<3 || isempty(params), params = [1,5]; end 38 | a = params(1); 39 | b = params(2); 40 | s = gamrnd(a,b,N,1); 41 | case 'geo' 42 | % Uses the MATLAB Statistics Toolbox 43 | % params specifies the probability parameter p 44 | if nargin<3 || isempty(params), params = 0.5; end 45 | p = params; 46 | s = geornd(p,N,1); 47 | otherwise 48 | disp('Invalid distribution specified'); 49 | s = NaN; 50 | end 51 | 52 | 53 | end 54 | -------------------------------------------------------------------------------- /MkSg_sine.m: -------------------------------------------------------------------------------- 1 | function s = MkSg_Sine(N,A,f,phi,eta) 2 | % returns a sine wave 3 | % Length N 4 | % Amplitude A 5 | % Frequency f 6 | % Phase offset phi 7 | % Noise amplitude eta 8 | 9 | %------------------------------------------------------------------------------- 10 | %% Set defaults 11 | if nargin < 1 || isempty(N) 12 | N = 1000; % time series of length 1000 13 | end 14 | if nargin < 2 || isempty(A) 15 | A = 1; % amplitude 1 16 | end 17 | if nargin < 3 || isempty(f) 18 | f = 1/20; % frequency 1/20 19 | end 20 | if nargin < 4 || isempty(phi) 21 | phi = 0; % no phase offset 22 | end 23 | if nargin < 5 || isempty(eta) 24 | eta = 0; % no Gaussian random noise 25 | end 26 | 27 | %------------------------------------------------------------------------------- 28 | %% Make the signal: 29 | s = A*sin(2*pi*f*(1:N)' + phi) + eta*randn(N,1); 30 | 31 | end 32 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # TimeSeriesGeneration 2 | 3 | [![DOI](https://zenodo.org/badge/102444874.svg)](https://zenodo.org/badge/latestdoi/102444874) 4 | 5 | Matlab code for generating time series from different types of generative model systems. 6 | 7 | Basic support for: 8 | * Autoregressive processes: `MkSg_AR` 9 | * Systems of ODEs (dynamical systems, or flows, including all systems included in *Chaos and Time-Series Analysis* by J. C. Sprott): `MkSg_Flow` 10 | * Iterative maps (including all of those listed in *Chaos and Time-Series Analysis* by J. C. Sprott): `MkSg_Map` 11 | * Uncorrelated random noise (from a given distribution): `MkSg_Noise` 12 | * Self-affine processes: `MkSg_SelfAffine` 13 | * Noisy sinusoids: `MkSg_Sine` 14 | 15 | ## Generation of HCTSA files for different systems with continuously varying parameters 16 | 17 | `runScript.m` 18 | -------------------------------------------------------------------------------- /functions/BF_thetime.m: -------------------------------------------------------------------------------- 1 | function timeString = BF_thetime(tsec,formatLong) 2 | % BF_thetime Converts a duration (seconds) to a human-interpretable string 3 | % 4 | % e.g., converts to minutes or hours or days as appropriate) output is something 5 | % like '25.5 minutes' or '3.2 days' -- always displays to one decimal place. 6 | % 7 | % This code is useful for displaying user feedback on tic/toc statements. 8 | % 9 | %---INPUTS: 10 | % tsec, the duration in seconds 11 | % formatLong, (i) 0: display short units (like 's' instead of 'seconds') 12 | % [default] 13 | % (ii) 1: display long units (like 'seconds' instead of 's') 14 | % 15 | %---OUTPUT: 16 | % timeString, an interpretable text version of the input time. 17 | 18 | % ------------------------------------------------------------------------------ 19 | % Copyright (C) 2016, Ben D. Fulcher , 20 | % 21 | % 22 | % If you use this code for your research, please cite: 23 | % B. D. Fulcher, M. A. Little, N. S. Jones, "Highly comparative time-series 24 | % analysis: the empirical structure of time series and their methods", 25 | % J. Roy. Soc. Interface 10(83) 20130048 (2013). DOI: 10.1098/rsif.2013.0048 26 | % 27 | % This function is free software: you can redistribute it and/or modify it under 28 | % the terms of the GNU General Public License as published by the Free Software 29 | % Foundation, either version 3 of the License, or (at your option) any later 30 | % version. 31 | % 32 | % This program is distributed in the hope that it will be useful, but WITHOUT 33 | % ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 34 | % FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 35 | % details. 36 | % 37 | % You should have received a copy of the GNU General Public License along with 38 | % this program. If not, see . 39 | % ------------------------------------------------------------------------------ 40 | 41 | if nargin < 2 || isempty(formatLong) 42 | formatLong = false; % Set to 1 to use a longer format for the unit 43 | end 44 | 45 | 46 | if tsec < 1E-3 47 | if formatLong 48 | timeString = '< 1 milliseconds'; 49 | else 50 | timeString = '< 1ms'; 51 | end 52 | elseif tsec < 1 % less than a second, display in integer number of milliseconds 53 | if formatLong 54 | timeString = sprintf('%.0f milliseconds',tsec*1000); 55 | else 56 | timeString = sprintf('%.0fms',tsec*1000); 57 | end 58 | elseif tsec <= 60 % less than a minute, display in seconds 59 | if formatLong 60 | timeString = sprintf('%.1f seconds',tsec); 61 | else 62 | timeString = sprintf('%.1fs',tsec); 63 | end 64 | elseif tsec <= 60*60 % less than an hour, display in minutes 65 | if formatLong 66 | timeString = sprintf('%.1f minutes',tsec/60); 67 | else 68 | timeString = sprintf('%.1fmin',tsec/60); 69 | end 70 | elseif tsec <= 60*24*60 % less than a day, display in hours 71 | if formatLong 72 | timeString = sprintf('%.1f hours',tsec/60/60); 73 | else 74 | timeString = sprintf('%.1fh',tsec/60/60); 75 | end 76 | % elseif tsec<=60*24*7*60 % less than a week, display in days 77 | else % display in days 78 | timeString = sprintf('%.1f days',tsec/60/60/24); 79 | end 80 | 81 | end 82 | -------------------------------------------------------------------------------- /functions/F_ACT.m: -------------------------------------------------------------------------------- 1 | function dx = F_ACT(t,x) 2 | % ACT attractor 3 | 4 | if nargin<3 || isempty(params) 5 | params = [1.8, -0.07, 1.5, 0.02]; % [alpha, beta, delta, mu] 6 | end 7 | alpha = params(1); 8 | beta = params(2); 9 | delta = params(3); 10 | mu = params(4); 11 | 12 | % Initialize 13 | dx = zeros(3,1); 14 | % Evaluate 15 | dx(1) = alpha*(x(1)-x(2)); 16 | dx(2) = -4*alpha*x(2) + x(1)*x(3) + mu*x(1)^3; 17 | dx(3) = -delta*alpha*x(3) + x(1)*x(2) + beta*x(3)^2; 18 | 19 | end 20 | -------------------------------------------------------------------------------- /functions/F_DHO.m: -------------------------------------------------------------------------------- 1 | function dx = F_DHO(t,x) 2 | % A Driven Pendulum 3 | global b A Omega omega 4 | 5 | dx=zeros(2,1); 6 | dx(1) = x(2); 7 | dx(2) = -b*x(2)-omega^2*x(1)+A*sin(Omega*t); 8 | 9 | end 10 | -------------------------------------------------------------------------------- /functions/F_DPend.m: -------------------------------------------------------------------------------- 1 | function dx = F_DPend(t,x,params) 2 | % A Driven Pendulum 3 | 4 | if nargin<3 || isempty(params) 5 | params = [0.6, 0.05, 0.7]; % [A, b, Omega] 6 | end 7 | A = params(1); 8 | b = params(2); 9 | Omega = params(3); 10 | 11 | % A=0.6; b=0.05; Omega=0.7; 12 | 13 | % Initialize 14 | dx = zeros(2,1); 15 | % Evaluate 16 | dx(1) = x(2); 17 | dx(2) = -b*x(2)-sin(x(1))+A*sin(Omega*t); 18 | 19 | end 20 | -------------------------------------------------------------------------------- /functions/F_Dufftwell.m: -------------------------------------------------------------------------------- 1 | function dy = F_Dufftwell(t,y) 2 | % A Duffing oscillator with k1=-1,k2=1,A=0 3 | global b 4 | % b=2; 5 | 6 | dy(1) = y(2); 7 | dy(2) = -b*y(2)+y(1)-y(1)^3; 8 | 9 | dy = dy'; 10 | 11 | end 12 | -------------------------------------------------------------------------------- /functions/F_Dufftwowell.m: -------------------------------------------------------------------------------- 1 | function dx = F_Dufftwowell(t,x,params) 2 | % A Duffing oscillator 3 | 4 | if nargin<3 || isempty(params) 5 | params = [0.25, 0.4, 1]; % [b, A, Omega] 6 | end 7 | b = params(1); 8 | A = params(2); 9 | Omega = params(3); 10 | % b=0.25; A=0.4; Omega=1; 11 | 12 | % Initialize 13 | dx = zeros(2,1); 14 | % Evaluate 15 | dx(1) = x(2); 16 | dx(2) = -x(1)^3 + x(1) - b*x(2) + A*sin(Omega*t); 17 | 18 | end 19 | -------------------------------------------------------------------------------- /functions/F_DvdP.m: -------------------------------------------------------------------------------- 1 | function dx = F_DvdP(t,x,params) 2 | % Driven van der Pol oscillator 3 | 4 | if nargin<3 || isempty(params) 5 | params = [3, 5, 1.788]; %[b, A, Omega] 6 | end 7 | b = params(1); 8 | A = params(2); 9 | Omega = params(3); 10 | 11 | % b=3;A=5;Omega=1.788; 12 | 13 | dx=zeros(2,1); 14 | dx(1) = x(2); 15 | dx(2) = -x(1)+b*(1-x(1)^2)*x(2)+A*sin(Omega*t); 16 | 17 | end 18 | -------------------------------------------------------------------------------- /functions/F_FBruss.m: -------------------------------------------------------------------------------- 1 | function dx = F_FBruss(t,x,params) 2 | % Forced Brusselator 3 | 4 | if nargin<3 || isempty(params) 5 | params = [0.4, 1.2, 0.05, 0.8]; % [a,b,A,Omega] 6 | end 7 | a = params(1); 8 | b = params(2); 9 | A = params(3); 10 | Omega = params(4); 11 | 12 | % a=0.4;b=1.2;A=0.05;Omega=0.8; 13 | 14 | % Initialize 15 | dx = zeros(2,1); 16 | % Evaluate 17 | dx(1) = x(1)^2*x(2) - (b+1)*x(1) + a + A*sin(Omega*t); 18 | dx(2) = -x(1)^2*x(2) + b*x(1); 19 | 20 | end 21 | -------------------------------------------------------------------------------- /functions/F_Jerk1.m: -------------------------------------------------------------------------------- 1 | function dx = F_Jerk1(t,x) 2 | % First Jerk Equation 3 | global A 4 | 5 | dx=zeros(3,1); 6 | dx(1) = x(2); 7 | dx(2) = x(3); 8 | dx(3) = -A*x(3)-x(2)+abs(x(1))-1; 9 | 10 | end 11 | -------------------------------------------------------------------------------- /functions/F_Jerk2.m: -------------------------------------------------------------------------------- 1 | function dx = F_Jerk2(t,x) 2 | % Second Jerk Equation 3 | global A 4 | 5 | dx=zeros(3,1); 6 | dx(1) = x(2); 7 | dx(2) = x(3); 8 | dx(3) = -A*x(3)-x(2)+x(1)-sign(x(1)); 9 | 10 | end 11 | -------------------------------------------------------------------------------- /functions/F_Jerk3.m: -------------------------------------------------------------------------------- 1 | function dx = F_Jerk3(t,x) 2 | % Third Jerk Equation 3 | global A 4 | 5 | dx=zeros(3,1); 6 | dx(1) = x(2); 7 | dx(2) = x(3); 8 | dx(3) = -A*x(3)+(x(2))^2-x(1); 9 | 10 | end 11 | -------------------------------------------------------------------------------- /functions/F_ShawvdP.m: -------------------------------------------------------------------------------- 1 | function dx = F_ShawvdP(t,x,params) 2 | % Shaw-van der Pol oscillator 3 | 4 | if nargin<3 || isempty(params) 5 | params = [1, 1, 2]; % [b, A, Omega] 6 | end 7 | 8 | b = params(1); 9 | A = params(2); 10 | Omega = params(3); 11 | % b=1;A=1;Omega=2; 12 | 13 | % Initialize 14 | dx = zeros(2,1); 15 | % Evaluate 16 | dx(1) = x(2) + A*sin(Omega*t); 17 | dx(2) = -x(1) + b*(1-x(1)^2)*x(2); 18 | 19 | end 20 | -------------------------------------------------------------------------------- /functions/F_Sprott3dcf_A.m: -------------------------------------------------------------------------------- 1 | function dx = F_Sprott3dcf_A(t,x) 2 | % Sprott's 3d chaotic flows: A 3 | 4 | % Initialize 5 | dx = zeros(3,1); 6 | % Evaluate 7 | dx(1) = x(2); 8 | dx(2) = -x(1) + x(2)*x(3); 9 | dx(3) = 1 - x(2)^2; 10 | 11 | end 12 | -------------------------------------------------------------------------------- /functions/F_Sprott3dcf_B.m: -------------------------------------------------------------------------------- 1 | function dx = F_Sprott3dcf_B(t,x) 2 | % Sprott's 3d chaotic flows: B 3 | 4 | dx=zeros(3,1); 5 | dx(1) = x(2)*x(3); 6 | dx(2) = x(1)-x(2); 7 | dx(3) = 1-x(1)*x(2); 8 | 9 | end 10 | -------------------------------------------------------------------------------- /functions/F_Sprott3dcf_C.m: -------------------------------------------------------------------------------- 1 | function dx = F_Sprott3dcf_C(t,x) 2 | % Sprott's 3d chaotic flows: C 3 | 4 | dx=zeros(3,1); 5 | dx(1) = x(2)*x(3); 6 | dx(2) = x(1)-x(2); 7 | dx(3) = 1-x(1)^2; 8 | 9 | end 10 | -------------------------------------------------------------------------------- /functions/F_Sprott3dcf_D.m: -------------------------------------------------------------------------------- 1 | function dx = F_Sprott3dcf_D(t,x) 2 | % Sprott's 3d chaotic flows: D 3 | 4 | dx=zeros(3,1); 5 | dx(1) = -x(2); 6 | dx(2) = x(1)+x(3); 7 | dx(3) = x(1)*x(3)+3*x(2)^2; 8 | 9 | end 10 | -------------------------------------------------------------------------------- /functions/F_Sprott3dcf_E.m: -------------------------------------------------------------------------------- 1 | function dx = F_Sprott3dcf_E(t,x) 2 | % Sprott's 3d chaotic flows: E 3 | 4 | dx=zeros(3,1); 5 | dx(1) = x(2)*x(3); 6 | dx(2) = x(1)^2-x(2); 7 | dx(3) = 1-4*x(1); 8 | 9 | end 10 | -------------------------------------------------------------------------------- /functions/F_Sprott3dcf_F.m: -------------------------------------------------------------------------------- 1 | function dx = F_Sprott3dcf_F(t,x) 2 | % Sprott's 3d chaotic flows: F 3 | 4 | dx=zeros(3,1); 5 | dx(1) = x(2)+x(3); 6 | dx(2) = -x(1)+0.5*x(2); 7 | dx(3) = x(1)^2-x(3); 8 | 9 | end 10 | -------------------------------------------------------------------------------- /functions/F_Sprott3dcf_G.m: -------------------------------------------------------------------------------- 1 | function dx = F_Sprott3dcf_G(t,x) 2 | % Sprott's 3d chaotic flows: G 3 | 4 | dx=zeros(3,1); 5 | dx(1) = 0.4*x(1)+x(3); 6 | dx(2) = x(1)*x(3)-x(2); 7 | dx(3) = -x(1)+x(2); 8 | 9 | end 10 | -------------------------------------------------------------------------------- /functions/F_Sprott3dcf_H.m: -------------------------------------------------------------------------------- 1 | function dx = F_Sprott3dcf_H(t,x) 2 | % Sprott's 3d chaotic flows: H 3 | 4 | dx=zeros(3,1); 5 | dx(1) = -x(2)+x(3)^2; 6 | dx(2) = x(1)+0.5*x(2); 7 | dx(3) = x(1)-x(3); 8 | 9 | end 10 | -------------------------------------------------------------------------------- /functions/F_Sprott3dcf_I.m: -------------------------------------------------------------------------------- 1 | function dx = F_Sprott3dcf_I(t,x) 2 | % Sprott's 3d chaotic flows: I 3 | 4 | dx=zeros(3,1); 5 | dx(1) = -0.2*x(2); 6 | dx(2) = x(1)+x(3); 7 | dx(3) = x(1)+x(2)^2-x(3); 8 | 9 | end 10 | -------------------------------------------------------------------------------- /functions/F_Sprott3dcf_J.m: -------------------------------------------------------------------------------- 1 | function dx = F_Sprott3dcf_J(t,x) 2 | % Sprott's 3d chaotic flows: J 3 | 4 | dx=zeros(3,1); 5 | dx(1) = 2*x(3); 6 | dx(2) = -2*x(2)+x(3); 7 | dx(3) = -x(1)+x(2)+x(2)^2; 8 | 9 | end 10 | -------------------------------------------------------------------------------- /functions/F_Sprott3dcf_K.m: -------------------------------------------------------------------------------- 1 | function dx = F_Sprott3dcf_K(t,x) 2 | % Sprott's 3d chaotic flows: K 3 | 4 | dx=zeros(3,1); 5 | dx(1) = x(1)*x(2)-x(3); 6 | dx(2) = x(1)-x(2); 7 | dx(3) = x(1)+0.3*x(3); 8 | 9 | end 10 | -------------------------------------------------------------------------------- /functions/F_Sprott3dcf_L.m: -------------------------------------------------------------------------------- 1 | function dx = F_Sprott3dcf_L(t,x) 2 | % Sprott's 3d chaotic flows: L 3 | 4 | dx=zeros(3,1); 5 | dx(1) = x(2)+3.9*x(3); 6 | dx(2) = 0.9*x(1)^2-x(2); 7 | dx(3) = 1-x(1); 8 | 9 | end 10 | -------------------------------------------------------------------------------- /functions/F_Sprott3dcf_M.m: -------------------------------------------------------------------------------- 1 | function dx = F_Sprott3dcf_M(t,x) 2 | % Sprott's 3d chaotic flows: M 3 | 4 | dx=zeros(3,1); 5 | dx(1) = -x(3); 6 | dx(2) = -x(1)^2-x(2); 7 | dx(3) = 1.7+1.7*x(1)+x(2); 8 | 9 | end 10 | -------------------------------------------------------------------------------- /functions/F_Sprott3dcf_N.m: -------------------------------------------------------------------------------- 1 | function dx = F_Sprott3dcf_N(t,x) 2 | % Sprott's 3d chaotic flows: N 3 | 4 | dx=zeros(3,1); 5 | dx(1) = -2*x(2); 6 | dx(2) = x(1)+x(3)^2; 7 | dx(3) = 1+x(2)-2*x(3); 8 | 9 | end 10 | -------------------------------------------------------------------------------- /functions/F_Sprott3dcf_O.m: -------------------------------------------------------------------------------- 1 | function dx = F_Sprott3dcf_O(t,x) 2 | % Sprott's 3d chaotic flows: O 3 | 4 | dx=zeros(3,1); 5 | dx(1) = x(2); 6 | dx(2) = x(1)-x(3); 7 | dx(3) = x(1)+x(1)*x(3)+2.7*x(2); 8 | 9 | end 10 | -------------------------------------------------------------------------------- /functions/F_Sprott3dcf_P.m: -------------------------------------------------------------------------------- 1 | function dx = F_Sprott3dcf_P(t,x) 2 | % Sprott's 3d chaotic flows: P 3 | 4 | dx=zeros(3,1); 5 | dx(1) = 2.7*x(2)+x(3); 6 | dx(2) = -x(1)+x(2)^2; 7 | dx(3) = x(1)+x(2); 8 | 9 | end 10 | -------------------------------------------------------------------------------- /functions/F_Sprott3dcf_Q.m: -------------------------------------------------------------------------------- 1 | function dx = F_Sprott3dcf_Q(t,x) 2 | % Sprott's 3d chaotic flows: Q 3 | 4 | dx=zeros(3,1); 5 | dx(1) = -x(3); 6 | dx(2) = x(1)-x(2); 7 | dx(3) = 3.1*x(1)+x(2)^2+0.5*x(3); 8 | 9 | end 10 | -------------------------------------------------------------------------------- /functions/F_Sprott3dcf_R.m: -------------------------------------------------------------------------------- 1 | function dx = F_Sprott3dcf_R(t,x) 2 | % Sprott's 3d chaotic flows: R 3 | 4 | dx=zeros(3,1); 5 | dx(1) = 0.9-x(2); 6 | dx(2) = 0.4+x(3); 7 | dx(3) = x(1)*x(2)-x(3); 8 | 9 | end 10 | -------------------------------------------------------------------------------- /functions/F_Sprott3dcf_S.m: -------------------------------------------------------------------------------- 1 | function dx = F_Sprott3dcf_S(t,x) 2 | % Sprott's 3d chaotic flows: S 3 | 4 | dx=zeros(3,1); 5 | dx(1) = -x(1)-4*x(2); 6 | dx(2) = x(1)+x(3)^2; 7 | dx(3) = 1+x(1); 8 | 9 | end 10 | -------------------------------------------------------------------------------- /functions/F_VanderPol.m: -------------------------------------------------------------------------------- 1 | function dx = F_VanderPol(t,x) 2 | % Van der Pol equation 3 | % b=1; 4 | global b A Omega 5 | dx=zeros(2,1); 6 | dx(1) = x(2); 7 | dx(2) = -b*(x(1)^2-1)*x(2)-x(1)+A*sin(Omega*t); 8 | 9 | end 10 | -------------------------------------------------------------------------------- /functions/F_burkeshaw.m: -------------------------------------------------------------------------------- 1 | function dx = F_burkeshaw(t,x,params) 2 | % Burke-Shaw attractor 3 | 4 | if nargin<3 || isempty(params) 5 | params = [10, 13]; % [U, V] 6 | end 7 | 8 | U = params(1); 9 | V = params(2); 10 | 11 | % Initialize 12 | dx = zeros(3,1); 13 | 14 | % Evaluate 15 | dx(1) = -U*x(1) - U*x(2); 16 | dx(2) = -U*x(1)*x(3) - x(2); 17 | dx(3) = -U*x(1)*x(2) + V; 18 | 19 | end 20 | -------------------------------------------------------------------------------- /functions/F_chen.m: -------------------------------------------------------------------------------- 1 | function dx = F_chen(t,x,params) 2 | % Chen's System 3 | 4 | if nargin<3 || isempty(params) 5 | params = [35, 3, 28]; 6 | end 7 | a = params(1); 8 | b = params(2); 9 | c = params(3); 10 | 11 | % Initialize 12 | dx = zeros(3,1); 13 | % Evaluate 14 | dx(1) = a*(x(2) - x(1)); 15 | dx(2) = (c-a)*x(1) - x(1)*x(3) + c*x(2); 16 | dx(3) = x(1)*x(2) - b*x(3); 17 | 18 | end 19 | -------------------------------------------------------------------------------- /functions/F_chua.m: -------------------------------------------------------------------------------- 1 | function dx = F_chua(t,x,params) 2 | % Chua's circuit 3 | 4 | if nargin<3 || isempty(params) 5 | params = [9, 100/7, 8/7, 5/7]; % [alpha,beta,a,b] 6 | end 7 | alpha = params(1); 8 | beta = params(2); 9 | a = params(3); 10 | b = params(4); 11 | 12 | % alpha=9; beta=100/7; a=8/7; b=5/7; 13 | 14 | % Initialize 15 | dx = zeros(3,1); 16 | % Evaluate 17 | dx(1) = alpha*(x(2) - x(1) + b*x(1) + 0.5*(a-b)*(abs(x(1)+1)-abs(x(1)-1))); 18 | dx(2) = x(1) - x(2) + x(3); 19 | dx(3) = -beta*x(2); 20 | 21 | end 22 | -------------------------------------------------------------------------------- /functions/F_complxbutfly.m: -------------------------------------------------------------------------------- 1 | function dx = F_complxbutfly(t,x,a) 2 | % A Complex Butterfly 3 | 4 | if nargin < 3 || isempty(a) 5 | a = 0.55; % default 6 | end 7 | 8 | % Initialize: 9 | dx = zeros(3,1); 10 | 11 | % Evaluate: 12 | dx(1) = a*(x(2) - x(3)); 13 | dx(2) = -x(3)*sign(x(1)); 14 | dx(3) = abs(x(1)) - 1; 15 | 16 | end 17 | -------------------------------------------------------------------------------- /functions/F_dblscroll.m: -------------------------------------------------------------------------------- 1 | function dx = F_dblscroll(t,x,a) 2 | % Double Scroll 3 | 4 | if nargin<3 || isempty(a) 5 | a=0.8; 6 | end 7 | 8 | % Initialize 9 | dx = zeros(3,1); 10 | % Evaluate 11 | dx(1) = x(2); 12 | dx(2) = x(3); 13 | dx(3) = -a*(x(3) + x(2) + x(1) - sign(x(1))); 14 | 15 | end 16 | -------------------------------------------------------------------------------- /functions/F_ddp.m: -------------------------------------------------------------------------------- 1 | function dx = F_ddp(t,x) 2 | % A Damped Driven Pendulum 3 | global b A Omega 4 | 5 | dx=zeros(2,1); 6 | dx(1) = x(2); 7 | dx(2) = -b*x(2)-sin(x(1))+A*sin(Omega*t); 8 | 9 | end 10 | -------------------------------------------------------------------------------- /functions/F_diffnlorenz.m: -------------------------------------------------------------------------------- 1 | function dx = F_diffnlorenz(t,x,R) 2 | % A Diffusionless Lorenz Attractor 3 | if nargin<3 || isempty(R) 4 | R=1; 5 | end 6 | 7 | % Initialize 8 | dx = zeros(3,1); 9 | % Evaluate 10 | dx(1) = -x(2)-x(1); 11 | dx(2) = -x(1)*x(3); 12 | dx(3) = x(1)*x(2) + R; 13 | 14 | end 15 | -------------------------------------------------------------------------------- /functions/F_drivenpend.m: -------------------------------------------------------------------------------- 1 | function dx = F_drivenpend(t,x,params) 2 | % Driven Pendulum 3 | 4 | if nargin<3 || isempty(params) 5 | params = [1.0; 0.5]; % [A, Omega] 6 | end 7 | A = params(1); 8 | Omega = params(2); 9 | % A=1.0; Omega=0.5; 10 | 11 | % Initialize 12 | dx = zeros(2,1); 13 | % Evaluate 14 | dx(1) = x(2); 15 | dx(2) = -sin(x(1)) + A*sin(Omega*t); 16 | 17 | end 18 | -------------------------------------------------------------------------------- /functions/F_duffvdp.m: -------------------------------------------------------------------------------- 1 | function dx = F_duffvdp(t,x,params) 2 | % A Duffing-van der Pol oscillator 3 | 4 | if nargin<3 || isempty(params) 5 | params = [0.2, 8, 0.35, 1.02]; % [mu, gamma, A, Omega] 6 | end 7 | mu = params(1); 8 | gamma = params(2); 9 | A = params(3); 10 | Omega = params(4); 11 | % mu=0.2;gamma=8;A=0.35;Omega=1.02; 12 | 13 | % Initialize 14 | dx = zeros(2,1); 15 | % Evaluate 16 | dx(1) = x(2); 17 | dx(2) = mu*(1-gamma*x(1)^2)*x(2) - x(1)^3 + A*sin(Omega*t); 18 | 19 | end 20 | -------------------------------------------------------------------------------- /functions/F_hadley.m: -------------------------------------------------------------------------------- 1 | function dx = F_hadley(t,x,params) 2 | % Hadley Circulation 3 | 4 | if nargin<3 || isempty(params) 5 | params = [0.25, 4, 8, 1]; % [a,b,F,G] 6 | end 7 | 8 | a = params(1); 9 | b = params(2); 10 | F = params(3); 11 | G = params(4); 12 | 13 | % Initialize 14 | dx = zeros(3,1); 15 | % Evaluate 16 | dx(1) = -x(2)^2 - x(3)^2 - a*(x(1) + F); 17 | dx(2) = x(1)*x(2) - b*x(1)*x(3) - x(2) + G; 18 | dx(3) = b*x(1)*x(2) + x(1)*x(3) - x(3); 19 | 20 | end 21 | -------------------------------------------------------------------------------- /functions/F_halvorsencsa.m: -------------------------------------------------------------------------------- 1 | function dx = F_halvorsencsa(t,x,a) 2 | % Halvorsen's cyclically symmetric attractor 3 | if nargin<3 || isempty(a) 4 | a=1.27; 5 | end 6 | 7 | % Initialize 8 | dx = zeros(3,1); 9 | % Evaluate 10 | dx(1) = -a*x(1) - 4*x(2) - 4*x(3) - x(2)^2; 11 | dx(2) = -a*x(2) - 4*x(3) - 4*x(1) - x(3)^2; 12 | dx(3) = -a*x(3) - 4*x(1) - 4*x(2) - x(1)^2; 13 | 14 | end 15 | -------------------------------------------------------------------------------- /functions/F_henonheiles.m: -------------------------------------------------------------------------------- 1 | function dx = F_henonheiles(t,x) 2 | % Hénon-Heiles system 3 | 4 | dx = zeros(4,1); 5 | 6 | dx(1) = x(3); 7 | dx(2) = x(4); 8 | dx(3) = -x(1) - 2*x(1)*x(2); 9 | dx(4) = -x(2) - x(1)^2 + x(2)^2; 10 | 11 | end 12 | -------------------------------------------------------------------------------- /functions/F_labyrinth.m: -------------------------------------------------------------------------------- 1 | function dx = F_labyrinth(t,x) 2 | % Labyrinth Chaos 3 | 4 | dx=zeros(3,1); 5 | 6 | dx(1) = sin(x(2)); 7 | dx(2) = sin(x(3)); 8 | dx(3) = sin(x(1)); 9 | 10 | end 11 | -------------------------------------------------------------------------------- /functions/F_lfrbms.m: -------------------------------------------------------------------------------- 1 | function dx = F_lfrbms(t,x) 2 | % Linear feedback rigid body motion system 3 | alpha=0.175; 4 | 5 | dx=zeros(3,1); 6 | 7 | dx(1) = -0.4*x(1) + x(2) + 10*x(2)*x(3); 8 | dx(2) = -x(1) - 0.4*x(2) + 5*x(1)*x(2); 9 | dx(3) = alpha*x(3) - 5*x(1)*x(2); 10 | 11 | end 12 | -------------------------------------------------------------------------------- /functions/F_lorenz.m: -------------------------------------------------------------------------------- 1 | function dy = F_lorenz(t,y,params) 2 | % params specifies [sigma, r, b] 3 | 4 | % Defaults 5 | if nargin < 3 || isempty(params) 6 | params = [10, 28, 8/3]; 7 | end 8 | 9 | % Set parameters 10 | sigma = params(1); 11 | r = params(2); 12 | b = params(3); 13 | 14 | % Initialize 15 | dy = zeros(3,1); 16 | 17 | % Define the derivative 18 | dy(1) = sigma*(y(2)-y(1)); 19 | dy(2) = -y(1)*y(3) + r*y(1) - y(2); 20 | dy(3) = y(1)*y(2) - b*y(3); 21 | 22 | 23 | end 24 | -------------------------------------------------------------------------------- /functions/F_moorespiegel.m: -------------------------------------------------------------------------------- 1 | function dx = F_moorespiegel(t,x,params) 2 | % Moore-Spiegel Oscillator 3 | 4 | if nargin<3 || isempty(params) 5 | params = [6, 20]; % [T, R] 6 | end 7 | T = params(1); 8 | R = params(2); 9 | % T=6;R=20; 10 | 11 | % Initialize 12 | dx = zeros(3,1); 13 | % Evaluate 14 | dx(1) = x(2); 15 | dx(2) = x(3); 16 | dx(3) = -x(3)-(T-R+R*x(1)^2)*x(2) - T*x(1); 17 | 18 | end 19 | -------------------------------------------------------------------------------- /functions/F_nosehoover.m: -------------------------------------------------------------------------------- 1 | function dx = F_nosehoover(t,x,a) 2 | % Nosé Hoover oscillator 3 | if nargin<3 || isempty(a) 4 | a = 1; 5 | end 6 | 7 | % Initialize 8 | dx = zeros(3,1); 9 | % Evaluate 10 | dx(1) = x(2); 11 | dx(2) = -x(1) + x(2)*x(3); 12 | dx(3) = a-x(2)^2; 13 | 14 | end 15 | -------------------------------------------------------------------------------- /functions/F_powernoise.m: -------------------------------------------------------------------------------- 1 | function x = powernoise(alpha, N, varargin) 2 | % Generate samples of power law noise. The power spectrum 3 | % of the signal scales as f^(-alpha). 4 | % 5 | % Useage: 6 | % x = powernoise(alpha, N) 7 | % x = powernoise(alpha, N, 'option1', 'option2', ...) 8 | % 9 | % Inputs: 10 | % alpha - power law scaling exponent 11 | % N - number of samples to generate 12 | % 13 | % Output: 14 | % x - N x 1 vector of power law samples 15 | % 16 | % With no option strings specified, the power spectrum is 17 | % deterministic, and the phases are uniformly distributed in the range 18 | % -pi to +pi. The power law extends all the way down to 0Hz (DC) 19 | % component. By specifying the 'randpower' option string however, the 20 | % power spectrum will be stochastic with Chi-square distribution. The 21 | % 'normalize' option string forces scaling of the output to the range 22 | % [-1, 1], consequently the power law will not necessarily extend 23 | % right down to 0Hz. 24 | % 25 | % (cc) Max Little, 2008. This software is licensed under the 26 | % Attribution-Share Alike 2.5 Generic Creative Commons license: 27 | % http://creativecommons.org/licenses/by-sa/2.5/ 28 | % If you use this work, please cite: 29 | % Little MA et al. (2007), "Exploiting nonlinear recurrence and fractal 30 | % scaling properties for voice disorder detection", Biomed Eng Online, 6:23 31 | % 32 | % As of 20080323 markup 33 | % If you use this work, consider saying hi on comp.dsp 34 | % Dale B. Dalrymple 35 | 36 | opt_randpow = false; 37 | opt_normal = false; 38 | 39 | for j = 1:(nargin-2) 40 | switch varargin{j} 41 | case 'normalize', opt_normal = true; 42 | case 'randpower', opt_randpow = true; 43 | end 44 | end 45 | 46 | N2 = floor(N/2)-1; 47 | f = (2:(N2+1))'; 48 | A2 = 1./(f.^(alpha/2)); 49 | 50 | if (~opt_randpow) 51 | p2 = (rand(N2,1)-0.5)*2*pi; 52 | d2 = A2.*exp(1i*p2); 53 | else 54 | % 20080323 55 | p2 = randn(N2,1) + 1i*randn(N2,1); 56 | d2 = A2.*p2; 57 | end 58 | 59 | d = [1; d2; 1/((N2+2)^alpha); flipud(conj(d2))]; 60 | x = real(ifft(d)); 61 | 62 | if (opt_normal) 63 | x = ((x - min(x))/(max(x) - min(x)) - 0.5) * 2; 64 | end 65 | -------------------------------------------------------------------------------- /functions/F_rabfab.m: -------------------------------------------------------------------------------- 1 | function dx = F_rabfab(t,x,params) 2 | % Rabinovich-Fabrikant attractor 3 | 4 | if nargin<3 || isempty(params) 5 | params = [1.1, 0.87]; % [alpha, gamma] 6 | end 7 | alpha = params(1); 8 | gamma = params(2); 9 | 10 | % Initialize 11 | dx = zeros(3,1); 12 | % Evaluate 13 | dx(1) = x(2)*(x(3) - 1 + x(1)^2) + gamma*x(1); 14 | dx(2) = x(1)*(3*x(3) + 1 - x(1)^2) + gamma*x(2); 15 | dx(3) = -2*x(3)*(alpha+x(1)*x(2)); 16 | 17 | end 18 | -------------------------------------------------------------------------------- /functions/F_rayduff.m: -------------------------------------------------------------------------------- 1 | function dx = F_rayduff(t,x,params) 2 | % A Rayleigh-Duffing Oscillator 3 | 4 | if nargin<3 || isempty(params) 5 | params = [0.2, 4, 0.3, 1.1]; % [mu, gamma, A, Omega] 6 | end 7 | mu = params(1); 8 | gamma = params(2); 9 | A = params(3); 10 | Omega = params(4); 11 | % mu=0.2;gamma=4;A=0.3;Omega=1.1; 12 | 13 | % Initialize 14 | dx = zeros(2,1); 15 | % Evaluate 16 | dx(1) = x(2); 17 | dx(2) = mu*(1-gamma*x(2)^2)*x(2) - x(1)^3 + A*sin(Omega*t); 18 | 19 | end 20 | -------------------------------------------------------------------------------- /functions/F_rmpnoise.m: -------------------------------------------------------------------------------- 1 | function [x, beta] = rmpnoise(H, N, varargin) 2 | % Generate samples of self-similar time series with Hurst exponent H, using 3 | % the random midpoint displacement method. The output is approximately 4 | % fractional Brownian motion of scaling H, with power law spectrum 5 | % 1/f^beta with beta = [[2*H-1]] 2H+1. Then the detrended fluctuation analysis 6 | % scaling exponent alpha = H. Differencing the output produces approximate 7 | % fractional Gaussian noise with scaling H and beta = [[2*H+1]] 2H-1, and 8 | % alpha = H-1. 9 | % 10 | % Useage: 11 | % x = rmpnoise(H, N) 12 | % x = rmpnoise(H, N, 'option') 13 | % 14 | % Inputs: 15 | % H - Hurst exponent 16 | % N - number of samples to generate 17 | % 18 | % Output: 19 | % x - N x 1 vector of 20 | % beta - equivalent 1/f^beta power law spectrum beta value 21 | % 22 | % By specifying the 'normalize' option string forces scaling of the output 23 | % to the range [-1, 1] 24 | % 25 | % (cc) Max Little, 2009. This software is licensed under the 26 | % Attribution-Share Alike 2.5 Generic Creative Commons license: 27 | % http://creativecommons.org/licenses/by-sa/2.5/ 28 | % If you use this work, please cite: 29 | % Little MA et al. (2007), "Exploiting nonlinear recurrence and fractal 30 | % scaling properties for voice disorder detection", Biomed Eng Online, 6:23 31 | 32 | opt_normal = false; 33 | if ((nargin == 3) && (strcmp(varargin{end},'normalize'))) 34 | opt_normal = true; 35 | end 36 | 37 | beta = 2*H+1; 38 | 39 | L = ceil(log2(N)); 40 | M = 2^L; 41 | x(1,1) = 0; 42 | x(M+1,1) = 0; 43 | x(2:M) = randn(M-1,1); 44 | sigma = sqrt(1-2^(2*H-2)); 45 | for i = 1:L 46 | d = 2^(L-i); 47 | sigma = sigma/2^H; 48 | range = (d+1):(2*d):(M-d+1); 49 | x(range) = 0.5*(x(range-d)+x(range+d))+x(range)*sigma; 50 | end 51 | x = x(1:N); 52 | 53 | if (opt_normal) 54 | x = ((x - min(x))/(max(x) - min(x)) - 0.5) * 2; 55 | end 56 | -------------------------------------------------------------------------------- /functions/F_rossler.m: -------------------------------------------------------------------------------- 1 | function dx = F_rossler(t,x,params) 2 | % Rössler attractor 3 | 4 | if nargin < 3 || isempty(params) 5 | params = [0.2, 0.2, 5.7]; % [a, b, c] 6 | end 7 | 8 | % Set parameters 9 | a = params(1); 10 | b = params(2); 11 | c = params(3); 12 | 13 | % Inherited from Michael Small's Rossler function file: 14 | % From Thompson and Stewart: 15 | % limit cycle a=0.3 16 | % period 2 limit cycle a=0.35 17 | % period 4 a=0.375 18 | % "four band" chaos a=0.386 19 | % period 6 a=0.3909 20 | % "single band" chaos a=0.398 21 | % period 5 a=0.4 22 | % period 3 a=0.411 23 | % ---- b=2;c=4; 24 | 25 | % Evaluate the function 26 | dx = zeros(3,1); 27 | 28 | dx(1) = -x(2) - x(3); 29 | dx(2) = x(1) + a*x(2); 30 | dx(3) = b + x(3)*(x(1)-c); 31 | 32 | end 33 | -------------------------------------------------------------------------------- /functions/F_rucklidge.m: -------------------------------------------------------------------------------- 1 | function dx = F_rucklidge(t,x,params) 2 | % Rucklidge Attractor 3 | 4 | if nargin<3 || isempty(params) 5 | params = [2, 6.7]; 6 | end 7 | kappa = params(1); 8 | lambda = params(2); 9 | 10 | % Initialize 11 | dx = zeros(3,1); 12 | % Evaluate 13 | dx(1) = -kappa*x(1) + lambda*x(2) - x(2)*x(3); 14 | dx(2) = x(1); 15 | dx(3) = -x(3) + x(2)^2; 16 | 17 | end 18 | -------------------------------------------------------------------------------- /functions/F_simpccf.m: -------------------------------------------------------------------------------- 1 | function dx = F_simpccf(t,x,a) 2 | % Simplest cubic chaotic flow 3 | if nargin<3 || isempty(a) 4 | a = 2.028; 5 | end 6 | 7 | % Initialize 8 | dx = zeros(3,1); 9 | % Evaluate 10 | dx(1) = x(2); 11 | dx(2) = x(3); 12 | dx(3) = -a*x(3) + x(1)*x(2)^2 - x(1); 13 | 14 | end 15 | -------------------------------------------------------------------------------- /functions/F_simpdcf.m: -------------------------------------------------------------------------------- 1 | function dx = F_simpdcf(t,x,Omega) 2 | % Simplest driven chaotic flow 3 | 4 | if nargin < 3 || isempty(Omega) 5 | Omega = 1.88; 6 | end 7 | 8 | % Initialize: 9 | dx = zeros(2,1); 10 | 11 | % Evaluate: 12 | dx(1) = x(2); 13 | dx(2) = -x(1)^3 + sin(Omega*t); 14 | 15 | end 16 | -------------------------------------------------------------------------------- /functions/F_simpplcf.m: -------------------------------------------------------------------------------- 1 | function dx = F_simpplcf(t,x,a) 2 | % Simplest piecewise linear chaotic flow 3 | if nargin<3 || isempty(a) 4 | a=0.6; 5 | end 6 | 7 | % Initialize 8 | dx = zeros(3,1); 9 | % Evaluate 10 | dx(1) = x(2); 11 | dx(2) = x(3); 12 | dx(3) = -a*x(3) - x(2) + abs(x(1)) - 1; 13 | 14 | end 15 | -------------------------------------------------------------------------------- /functions/F_simpqcf.m: -------------------------------------------------------------------------------- 1 | function dx = F_simpqcf(t,x,a) 2 | % Simplest quadratic chaotic flow 3 | 4 | if nargin<3 || isempty(a) 5 | a=2.017; 6 | end 7 | 8 | % Initialize 9 | dx = zeros(3,1); 10 | % Evaluate 11 | dx(1) = x(2); 12 | dx(2) = x(3); 13 | dx(3) = -a*x(3) + x(2)^2 - x(1); 14 | 15 | end 16 | -------------------------------------------------------------------------------- /functions/F_sprottJD0.m: -------------------------------------------------------------------------------- 1 | function dx = F_sprottJD0(t,x,a) 2 | % First Jerk Equation 3 | if nargin<3 || isempty(a) 4 | a = -2.017; 5 | end 6 | 7 | % Initialize 8 | dx = zeros(3,1); 9 | % Evaluate 10 | dx(1) = x(2); 11 | dx(2) = x(3); 12 | dx(3) = a*x(3) + x(2)^2 - x(1); 13 | 14 | end 15 | -------------------------------------------------------------------------------- /functions/F_sprottJD1.m: -------------------------------------------------------------------------------- 1 | function dx = F_sprottJD1(t,x,params) 2 | % First Jerk Equation 3 | if nargin<3 || isempty(params) 4 | params = [-1.8, -2]; 5 | end 6 | % a = -1.8; b = -2; 7 | a = params(1); 8 | b = params(2); 9 | 10 | % Initialize 11 | dx = zeros(3,1); 12 | % Evaluate 13 | dx(1) = x(2); 14 | dx(2) = x(3); 15 | dx(3) = a*x(3) + b*x(1) + x(1)*x(2) - 1; 16 | 17 | 18 | end 19 | -------------------------------------------------------------------------------- /functions/F_sprottJD2.m: -------------------------------------------------------------------------------- 1 | function dx = F_sprottJD2(t,x,params) 2 | % First Jerk Equation 3 | if nargin<3 || isempty(params) 4 | params = [-0.5, -1.9]; % [a,b] 5 | end 6 | 7 | % a=-0.5;b=-1.9; 8 | a = params(1); 9 | b = params(2); 10 | 11 | % Initialize 12 | dx = zeros(3,1); 13 | % Evaluate 14 | dx(1) = x(2); 15 | dx(2) = x(3); 16 | dx(3) = a*x(3) + b*x(2) + x(1)^2 - 1; 17 | 18 | end 19 | -------------------------------------------------------------------------------- /functions/F_sprottJD3.m: -------------------------------------------------------------------------------- 1 | function dx = F_sprottJD3(t,x,params) 2 | % First Jerk Equation 3 | if nargin<3 || isempty(params) 4 | params = [-0.6, -3, 5]; % [a,b,c] 5 | end 6 | % a=-0.6; b=-3; c=5; 7 | a = params(1); 8 | b = params(2); 9 | c = params(3); 10 | 11 | % Initialize 12 | dx = zeros(3,1); 13 | % Evaluate 14 | dx(1) = x(2); 15 | dx(2) = x(3); 16 | dx(3) = a*x(3) + b*x(2) + c*x(1)^2 + x(1)*x(2) - 1; 17 | 18 | end 19 | -------------------------------------------------------------------------------- /functions/F_sprottJD4.m: -------------------------------------------------------------------------------- 1 | function dx = F_sprottJD4(t,x,params) 2 | % First Jerk Equation 3 | if nargin<3 || isempty(params) 4 | params = [-0.6, -2, 3]; 5 | end 6 | % a=-0.6; b=-2; c=3; 7 | a = params(1); 8 | b = params(2); 9 | c = params(3); 10 | 11 | % Initialize 12 | dx = zeros(3,1); 13 | % Evaluate 14 | dx(1) = x(2); 15 | dx(2) = x(3); 16 | dx(3) = a*x(3) + b*x(2) + c*x(1)^2 + x(1)*x(3) - 1; 17 | 18 | end 19 | -------------------------------------------------------------------------------- /functions/F_sprottJD5.m: -------------------------------------------------------------------------------- 1 | function dx = F_sprottJD5(t,x,params) 2 | % First Jerk Equation 3 | if nargin<3 || isempty(params) 4 | params = [0.5, -1]; 5 | end 6 | % a=0.5;b=-1; 7 | a = params(1); 8 | b = params(2); 9 | 10 | % Initialize 11 | dx = zeros(3,1); 12 | % Evaluate 13 | dx(1) = x(2); 14 | dx(2) = x(3); 15 | dx(3) = a*x(2) + b*x(1)^2 + x(2)^2 - x(1)*x(3); 16 | 17 | end 18 | -------------------------------------------------------------------------------- /functions/F_sprottJD6.m: -------------------------------------------------------------------------------- 1 | function dx = F_sprottJD6(t,x,params) 2 | % First Jerk Equation 3 | if nargin<3 || isempty(params) 4 | params = [-1, -1, 2, 2]; % [a,b,c,d] 5 | end 6 | % a=-1;b=-1;c=2;d=2; 7 | a = params(1); 8 | b = params(2); 9 | c = params(3); 10 | d = params(4); 11 | 12 | % Initialize 13 | dx = zeros(3,1); 14 | % Evaluate 15 | dx(1) = x(2); 16 | dx(2) = x(3); 17 | dx(3) = a*x(3) + b*x(2) + c*x(1)^2 + d*x(2)^2 + x(1)*x(3) - 1; 18 | 19 | end 20 | -------------------------------------------------------------------------------- /functions/F_sprottJD7.m: -------------------------------------------------------------------------------- 1 | function dx = F_sprottJD7(t,x,params) 2 | % First Jerk Equation 3 | if nargin<3 || isempty(params) 4 | params = [-1, 1, 2, -3, 1]; % [a,b,c,d,e] 5 | end 6 | a = params(1); 7 | b = params(2); 8 | c = params(3); 9 | d = params(4); 10 | e = params(5); 11 | % a=-1; b=1; c=2; d=-3; e=1; 12 | 13 | % Initialize 14 | dx = zeros(3,1); 15 | % Evaluate 16 | dx(1) = x(2); 17 | dx(2) = x(3); 18 | dx(3) = a*x(3) + b*x(2) + c*x(1)^2 + d*x(2)^2 + e*x(1)*x(2) + x(1)*x(3) - 1; 19 | 20 | end 21 | -------------------------------------------------------------------------------- /functions/F_thomascsa.m: -------------------------------------------------------------------------------- 1 | function dx = F_thomascsa(t,x,b) 2 | % Thomas' cyclically symmetric attractor 3 | if nargin<3 || isempty(b) 4 | b=0.18; 5 | end 6 | 7 | % Initialize 8 | dx = zeros(3,1); 9 | % Evaluate 10 | dx(1) = -b*x(1) + sin(x(2)); 11 | dx(2) = -b*x(2) + sin(x(3)); 12 | dx(3) = -b*x(3) + sin(x(1)); 13 | 14 | end 15 | -------------------------------------------------------------------------------- /functions/F_ueda.m: -------------------------------------------------------------------------------- 1 | function dy = F_ueda(t,y,params) 2 | % Ueda attractor uses: 3 | 4 | if nargin<3 || isempty(params) 5 | params = [7.5, 0.05, 1]; % [A, b, Omega] 6 | end 7 | % A=7.5; b=0.05; Omega=1; 8 | A = params(1); 9 | b = params(2); 10 | Omega = params(3); 11 | 12 | 13 | % Initialize 14 | dy = zeros(2,1); 15 | % Evaluate 16 | dy(1) = y(2); 17 | dy(2) = -b*y(2) - y(1)^3 + A*sin(Omega*t); 18 | 19 | end 20 | -------------------------------------------------------------------------------- /functions/F_vdp.m: -------------------------------------------------------------------------------- 1 | function dx = F_vdp(t,x,params) 2 | % van der Pol oscillator 3 | 4 | if nargin<3 || isempty(params) 5 | params = [1, 1]; % [c, k] 6 | end 7 | c = params(1); 8 | k = params(2); 9 | 10 | % Initialize 11 | dx = zeros(2,1); 12 | % Evaluate 13 | dx(1) = x(2); 14 | dx(2) = c*(1-x(1)^2)*x(2) - k*x(1); 15 | 16 | end 17 | -------------------------------------------------------------------------------- /functions/F_windmi.m: -------------------------------------------------------------------------------- 1 | function dx = F_windmi(t,x,params) 2 | % WINDMI attractor 3 | 4 | if nargin<3 || isempty(params) 5 | params = [0.7, 2.5]; % [a,b] 6 | end 7 | a = params(1); 8 | b = params(2); 9 | 10 | % Initialize 11 | dx = zeros(3,1); 12 | % Evaluate 13 | dx(1) = x(2); 14 | dx(2) = x(3); 15 | dx(3) = -a*x(3) - x(2) + b - exp(x(1)); 16 | 17 | end 18 | -------------------------------------------------------------------------------- /startup.m: -------------------------------------------------------------------------------- 1 | % Add paths required for the project (ignoring hidden, including version control) 2 | files = dir; 3 | directories = files([files.isdir]); 4 | directories(strmatch('.',{files([files.isdir]).name})) = []; % remove hidden 5 | paths = arrayfun(@(x)fullfile(directories(x).folder,directories(x).name),1:length(directories),'UniformOutput',false); 6 | for j = 1:length(paths) 7 | addpath(genpath(paths{j})) 8 | end 9 | addpath('.'); 10 | --------------------------------------------------------------------------------