-
Notifications
You must be signed in to change notification settings - Fork 0
/
loki.m
48 lines (40 loc) · 1.56 KB
/
loki.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
clear variables;
close all;
clc;
import src.sinks.*
%% .USER SETTINGS
% .Data format/IO settings
% .input data's time format: actually tested: Y-M-D h:m:s
% (Y:Year, M:Month, D:Day, h:hour, m:month, s:second)
userSetting.epochFmt = "Y-M-D h:m:s";
% .data file name
userSetting.fileName = "example.dat";
% .data folder
userSetting.foldName = "dat";
% .significant level given from interval (0,1)
userSetting.sigLevel = 0.05;
% .limit value of dependence. Used in case of critical value calculation. Given in interval (0,1).
userSetting.limitDependence = 0.4; %
% .boolean parameter. If true (1), original series is reduced by linear model
userSetting.detrendData = 1; % v pripade true odstranim linearny trend
% .input data time resolution (timestamp).
userSetting.timeResolution = 1; % [day]
% .method for time series de-seasonalisation. In today, a median filter (given by median year)
% and LSQ are implemented and tested.
userSetting.filterModel = "medianFilter";
% .boolean parameter. If true, then multi-change point is investigated
userSetting.multiChangePoint = 1; %
%% .RUN LOKI APPLICATION
lokiObj = src.loki(userSetting);
% .example of getting the results
%[maxT, idxChp, meanBf, meanAf] = lokiObj.chpObj.getChpp;
%shift = lokiObj.chpObj.getShift;
%critVal = lokiObj.chpObj.getCriticalValue;
%pVal = lokiObj.chpObj.getPVal;
%status = lokiObj.chpObj.getStatus;
%% .PLOT RESULTS
src.sinks.segmentPlot(lokiObj.prepObj.getTable.Detrend, ...
sort(lokiObj.prepObj.getTable.Mjd),...
lokiObj.getResTable.ChpIdx, "mXlabel", "Time [MJD]");
%% .GET VERSION
%lokiObj.getVersion();