annotate extra/tsa/inst/poly2ar.m @ 12580:b6eace8bc216 octave-forge

[tsa] update contact email address
author schloegl
date Thu, 02 Apr 2015 10:00:34 +0000
parents 18ff3d258eea
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2414
19251cd2753b Latest package manager mega patch, but not the last
adb014
parents:
diff changeset
1 function [A] = poly2ar(A);
19251cd2753b Latest package manager mega patch, but not the last
adb014
parents:
diff changeset
2 % Converts AR polymials into autoregressive parameters.
19251cd2753b Latest package manager mega patch, but not the last
adb014
parents:
diff changeset
3 % Multiple polynomials can be converted.
19251cd2753b Latest package manager mega patch, but not the last
adb014
parents:
diff changeset
4 %
19251cd2753b Latest package manager mega patch, but not the last
adb014
parents:
diff changeset
5 % function [AR] = poly2ar(A);
19251cd2753b Latest package manager mega patch, but not the last
adb014
parents:
diff changeset
6 %
19251cd2753b Latest package manager mega patch, but not the last
adb014
parents:
diff changeset
7 % INPUT:
19251cd2753b Latest package manager mega patch, but not the last
adb014
parents:
diff changeset
8 % A AR polynomial, each row represents one polynomial
19251cd2753b Latest package manager mega patch, but not the last
adb014
parents:
diff changeset
9 %
19251cd2753b Latest package manager mega patch, but not the last
adb014
parents:
diff changeset
10 % OUTPUT
19251cd2753b Latest package manager mega patch, but not the last
adb014
parents:
diff changeset
11 % AR autoregressive model parameter
19251cd2753b Latest package manager mega patch, but not the last
adb014
parents:
diff changeset
12 %
19251cd2753b Latest package manager mega patch, but not the last
adb014
parents:
diff changeset
13 % see also ACOVF ACORF DURLEV RC2AR AR2POLY
19251cd2753b Latest package manager mega patch, but not the last
adb014
parents:
diff changeset
14
4907
18ff3d258eea update license of TSA toolbox to GPLv3
schloegl
parents: 4404
diff changeset
15 % $Id$
12580
b6eace8bc216 [tsa] update contact email address
schloegl
parents: 4907
diff changeset
16 % Copyright (C) 1998-2002,2008 by Alois Schloegl <alois.schloegl@gmail.com>
4907
18ff3d258eea update license of TSA toolbox to GPLv3
schloegl
parents: 4404
diff changeset
17 %
18ff3d258eea update license of TSA toolbox to GPLv3
schloegl
parents: 4404
diff changeset
18 % This program is free software: you can redistribute it and/or modify
18ff3d258eea update license of TSA toolbox to GPLv3
schloegl
parents: 4404
diff changeset
19 % it under the terms of the GNU General Public License as published by
18ff3d258eea update license of TSA toolbox to GPLv3
schloegl
parents: 4404
diff changeset
20 % the Free Software Foundation, either version 3 of the License, or
18ff3d258eea update license of TSA toolbox to GPLv3
schloegl
parents: 4404
diff changeset
21 % (at your option) any later version.
2414
19251cd2753b Latest package manager mega patch, but not the last
adb014
parents:
diff changeset
22 %
4907
18ff3d258eea update license of TSA toolbox to GPLv3
schloegl
parents: 4404
diff changeset
23 % This program is distributed in the hope that it will be useful,
18ff3d258eea update license of TSA toolbox to GPLv3
schloegl
parents: 4404
diff changeset
24 % but WITHOUT ANY WARRANTY; without even the implied warranty of
18ff3d258eea update license of TSA toolbox to GPLv3
schloegl
parents: 4404
diff changeset
25 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18ff3d258eea update license of TSA toolbox to GPLv3
schloegl
parents: 4404
diff changeset
26 % GNU General Public License for more details.
2414
19251cd2753b Latest package manager mega patch, but not the last
adb014
parents:
diff changeset
27 %
4907
18ff3d258eea update license of TSA toolbox to GPLv3
schloegl
parents: 4404
diff changeset
28 % You should have received a copy of the GNU General Public License
18ff3d258eea update license of TSA toolbox to GPLv3
schloegl
parents: 4404
diff changeset
29 % along with this program. If not, see <http://www.gnu.org/licenses/>.
2414
19251cd2753b Latest package manager mega patch, but not the last
adb014
parents:
diff changeset
30
19251cd2753b Latest package manager mega patch, but not the last
adb014
parents:
diff changeset
31 % Inititialization
19251cd2753b Latest package manager mega patch, but not the last
adb014
parents:
diff changeset
32 [lr,lc]=size(A);
19251cd2753b Latest package manager mega patch, but not the last
adb014
parents:
diff changeset
33
19251cd2753b Latest package manager mega patch, but not the last
adb014
parents:
diff changeset
34 if ~all(A(:,1)==1)
19251cd2753b Latest package manager mega patch, but not the last
adb014
parents:
diff changeset
35 fprintf(2,'Warning POLY2AR: input argument might not be an AR-polynom');
19251cd2753b Latest package manager mega patch, but not the last
adb014
parents:
diff changeset
36 end;
19251cd2753b Latest package manager mega patch, but not the last
adb014
parents:
diff changeset
37
19251cd2753b Latest package manager mega patch, but not the last
adb014
parents:
diff changeset
38 A = -A(:,2:size(A,2))./A(:,ones(1,size(A,2)-1));