summaryrefslogtreecommitdiff
path: root/modules/cacsd/help/en_US/armax.xml
blob: 2e978a46bc2cfa4b7ec105d40ae2ef5e27cbf714 (plain)
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
<?xml version="1.0" encoding="UTF-8"?>
<!--
 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
 * Copyright (C) ENPC - JPC
 * 
 * This file must be used under the terms of the CeCILL.
 * This source file is licensed as described in the file COPYING, which
 * you should have received as part of this distribution.  The terms
 * are also available at    
 * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
 *
 -->
<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:lang="en" xml:id="armax">
    <refnamediv>
        <refname>armax</refname>
        <refpurpose>armax identification</refpurpose>
    </refnamediv>
    <refsynopsisdiv>
        <title>Calling Sequence</title>
        <synopsis>[arc,la,lb,sig,resid]=armax(r,s,y,u,[b0f,prf])</synopsis>
    </refsynopsisdiv>
    <refsection>
        <title>Arguments</title>
        <variablelist>
            <varlistentry>
                <term>y</term>
                <listitem>
                    <para>output process  y(ny,n); ( ny: dimension of y , n : sample size)</para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>u</term>
                <listitem>
                    <para>input process   u(nu,n); ( nu: dimension of u , n : sample size)</para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>r and s</term>
                <listitem>
                    <para>auto-regression orders r &gt;=0 et s &gt;=-1</para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>b0f</term>
                <listitem>
                    <para>optional parameter. Its default value is 0 and it means that the coefficient b0 must be identified. if bof=1 the b0 is supposed to be zero and is not identified</para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>prf</term>
                <listitem>
                    <para>optional parameter for display control. If prf =1, the default value,  a display of the identified Arma is given.</para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>arc</term>
                <listitem>
                    <para>a Scilab arma object (see armac)</para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>la</term>
                <listitem>
                    <para>is the list(a,a+eta,a-eta) ( la = a in dimension 1) ; where eta is the estimated standard deviation.  , a=[Id,a1,a2,...,ar] where each ai is a matrix of size (ny,ny)</para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>lb</term>
                <listitem>
                    <para>is the list(b,b+etb,b-etb) (lb =b in dimension 1) ; where etb is the estimated standard deviation. b=[b0,.....,b_s] where each bi is a matrix of size (nu,nu)</para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>sig</term>
                <listitem>
                    <para>is the estimated standard deviation of the noise and resid=[ sig*e(t0),....] (</para>
                </listitem>
            </varlistentry>
        </variablelist>
    </refsection>
    <refsection>
        <title>Description</title>
        <para>
            armax is used to identify the coefficients of a n-dimensional 
            ARX process
        </para>
        <programlisting role=""><![CDATA[ 
A(z^-1)y= B(z^-1)u + sig*e(t)
 ]]></programlisting>
        <para>
            where e(t) is a n-dimensional white noise with variance I.
            sig  an nxn matrix and A(z) and B(z):
        </para>
        <programlisting role=""><![CDATA[ 
A(z) = 1+a1*z+...+a_r*z^r; ( r=0 => A(z)=1)
B(z) = b0+b1*z+...+b_s z^s ( s=-1 => B(z)=0)
 ]]></programlisting>
        <para>
            for the method see Eykhoff in trends and progress in system identification, page 96.
            with  
            <literal>z(t)=[y(t-1),..,y(t-r),u(t),...,u(t-s)]</literal>
            and
            <literal>coef= [-a1,..,-ar,b0,...,b_s] </literal>
            we can write 
            <literal>y(t)= coef* z(t) + sig*e(t) </literal> and the algorithm minimises 
            <literal>sum_{t=1}^N ( [y(t)- coef'z(t)]^2)</literal>
            where t0=max(max(r,s)+1,1))).
        </para>
    </refsection>
    <refsection>
        <title>Examples</title>
        <programlisting role="example"><![CDATA[ 
//-Ex1- Arma model : y(t) = 0.2*u(t-1)+0.01*e(t-1)
ny=1,nu=1,sig=0.01;
Arma=armac(1,[0,0.2],[0,1],ny,nu,sig)  //defining the above arma model
u=rand(1,1000,'normal');     //a random input sequence u
y=arsimul(Arma,u); //simulation of a y output sequence associated with u.
Armaest=armax(0,1,y,u);   //Identified model given u and y.
Acoeff=Armaest('a');    //Coefficients of the polynomial A(x)
Bcoeff=Armaest('b')     //Coefficients of the polynomial B(x)
Dcoeff=Armaest('d');    //Coefficients of the polynomial D(x)
[Ax,Bx,Dx]=arma2p(Armaest)   //Results in polynomial form. 
 ]]></programlisting>
        <programlisting role="example"><![CDATA[ 
//-Ex2- Arma1: y_t -0.8*y_{t-1} + 0.2*y_{t-2} =  sig*e(t)
ny=1,nu=1;sig=0.001;
// First step: simulation the Arma1 model, for that we define
// Arma2: y_t -0.8*y_{t-1} + 0.2*y_{t-2} = sig*u(t)
// with normal deviates for u(t).  
Arma2=armac([1,-0.8,0.2],sig,0,ny,nu,0);
//Definition of the Arma2 arma model (a model with B=sig and without noise!)
u=rand(1,10000,'normal');  // An input sequence for Arma2
y=arsimul(Arma2,u); // y = output of Arma2 with input u 
//                     can be seen as output of Arma1.
// Second step: identification. We look for an Arma model
// y(t) + a1*y(t-1) + a2 *y(t-2) =  sig*e(t)
Arma1est=armax(2,-1,y,[]);
[A,B,D]=arma2p(Arma1est)
 ]]></programlisting>
        <programlisting role="example"><![CDATA[ 
a = [1, -2.851, 2.717, -0.865];
b = [0, 1, 1, 1];
d = [1, 0.7, 0.2];
ar = armac(a, b, d, 1, 1, 1);
disp(_("Simulation of an ARMAX process:"));
disp(ar);
// The input
n = 300;
u = -prbs_a(n, 1, int([2.5,5,10,17.5,20,22,27,35]*100/12));
// simulation
zd = narsimul(ar, u);

// visualization
plot2d(1:n,[zd',1000*u'],style=[1,3]);curves = gce();
legend(["Simulated output";"Input [scaled]"])
 ]]></programlisting>
        <scilab:image>
            a = [1, -2.851, 2.717, -0.865];
            b = [0, 1, 1, 1];
            d = [1, 0.7, 0.2];
            ar = armac(a, b, d, 1, 1, 1);
            n = 300;
            u = -prbs_a(n, 1, int([2.5,5,10,17.5,20,22,27,35]*100/12));
            zd = narsimul(ar, u);
            plot2d(1:n,[zd',1000*u'],style=[1,3]);curves = gce();
            legend(["Simulated output";"Input [scaled]"]);
        </scilab:image>
    </refsection>
    <refsection role="see also">
        <title>See Also</title>
        <simplelist type="inline">
            <member>
                <link linkend="imrep2ss">imrep2ss</link>
            </member>
            <member>
                <link linkend="time_id">time_id</link>
            </member>
            <member>
                <link linkend="arl2">arl2</link>
            </member>
            <member>
                <link linkend="armax">armax</link>
            </member>
            <member>
                <link linkend="frep2tf">frep2tf</link>
            </member>
        </simplelist>
    </refsection>
</refentry>