-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathPTS2modelUC.m
49 lines (49 loc) · 1.21 KB
/
PTS2modelUC.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
function modelU = PTS2modelUC(model, armaOrders)
if nargin < 2
armaOrders = [0, 0];
end
modelU = '';
n = length(model);
% noise
model = lower(model);
aux = model(1);
if aux == '?'
modelU = '/?';
elseif aux == 'n'
modelU = '/none';
elseif aux == 'a'
modelU = sprintf('/arma(%d,%d)', armaOrders(1), armaOrders(2));
else
error('ERROR: incorrect error model!!');
end
% seasonal
aux = model(end);
if aux == '?'
modelU = ['/?' modelU];
elseif aux == 'n'
modelU = ['/none' modelU];
elseif aux == 'a'
modelU = ['/linear' modelU];
elseif aux == 'e'
modelU = ['/equal' modelU];
elseif aux == 'd'
modelU = ['/different' modelU];
else
error('ERROR: incorrect seasonal model!!');
end
% trend
aux = model(2:n-1);
if aux == '?'
modelU = ['?/none' modelU];
elseif aux == 'n'
modelU = ['rw/none' modelU];
elseif aux == 'a'
modelU = ['llt/none' modelU];
elseif aux == 'ad'
modelU = ['srw/none' modelU];
elseif aux == 'l'
modelU = ['td/none' modelU];
else
error('ERROR: incorrect trend model!!');
end
end