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
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>
armax1 is used to identify the coefficients of a 1-dimensional
ARX process:
</para>
- <programlisting role=""><![CDATA[
+ <programlisting role="no-scilab-exec"><![CDATA[
A(z^-1)y= B(z^-1)u + D(z^-1)sig*e(t)
e(t) is a 1-dimensional white noise with variance 1.
A(z)= 1+a1*z+...+a_r*z^r; ( r=0 => A(z)=1)
for the method, see Eykhoff in trends and progress in system
identification) page 96. with
</para>
- <programlisting role=""><![CDATA[
+ <programlisting role="no-scilab-exec"><![CDATA[
z(t)=[y(t-1),..,y(t-r),u(t),...,
u(t-s),e(t-1),...,e(t-q)]
]]></programlisting>
<para>
and
</para>
- <programlisting role=""><![CDATA[
+ <programlisting role="no-scilab-exec"><![CDATA[
coef= [-a1,..,-ar,b0,...,b_s,d1,...,d_q]'
y(t)= coef'* z(t) + sig*e(t).
]]></programlisting>
a sequential version of armax
</para>
</refsection>
+
+ <refsection>
+ <title>Examples</title>
+ <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);
+
+n = 300;
+u = -prbs_a(n, 1, int([2.5,5,10,17.5,20,22,27,35]*100/12));
+zd = narsimul(ar, u);
+
+// using now armax1 : coloured noise identification
+// you can test the same example with
+[arc1, resid] = armax1(3,3,2,zd(1:n),u,1);
+disp(arc1);
+
+ ]]></programlisting>
+ </refsection>
+
+
<refsection>
<title>Important notice</title>
<para>In Scilab versions up to 4.1.2 the returned value in
number of the coefficient matrix of the least squares problem solved.
</para>
</refsection>
+ <refsection>
+ <title>Examples</title>
+ <programlisting role="example"><![CDATA[
+//generate data from a given linear system
+A = [ 0.5, 0.1,-0.1, 0.2;
+ 0.1, 0, -0.1,-0.1;
+ -0.4,-0.6,-0.7,-0.1;
+ 0.8, 0, -0.6,-0.6];
+B = [0.8;0.1;1;-1];
+C = [1 2 -1 0];
+SYS=syslin(0.1,A,B,C);
+nsmp=100;
+U=prbs_a(nsmp,nsmp/5);
+Y=(flts(U,SYS)+0.3*rand(1,nsmp,'normal'));
+
+// Compute R
+S=15;
+[R,N1,SVAL] = findR(S,Y',U');
+N=3;
+SYS1 = findABCD(S,N,1,R) ;
+SYS1.dt=0.1;
+
+inistate(SYS1,Y',U')
+
+]]></programlisting>
+ </refsection>
<refsection role="see also">
<title>See Also</title>
<simplelist type="inline">