-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmodelUC2PTS.m
34 lines (34 loc) · 883 Bytes
/
modelUC2PTS.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
function model = modelUC2PTS(modelUC)
% removing cycle from UC model
% modelUC = strrep(modelUC, '/none/', '/');
% extracting components
aux = strsplit(modelUC, '/');
trend = aux{1};
seasonal = aux{3};
noise = aux{4};
% noise
model = 'A';
if strcmp(noise, 'none')
model = 'N';
end
% trend
if strcmp(trend, 'rw')
model = [model 'N'];
elseif strcmp(trend, 'srw')
model = [model 'Ad'];
elseif strcmp(trend, 'llt')
model = [model 'A'];
elseif strcmp(trend, 'td')
model = [model 'L'];
end
% seasonal
if strcmp(seasonal, 'none')
model = [model 'N'];
elseif strcmp(seasonal, 'equal')
model = [model 'E'];
elseif strcmp(seasonal, 'different')
model = [model 'D'];
elseif strcmp(seasonal, 'linear')
model = [model 'L'];
end
end