<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/244908</link>
    <title>MATLAB Central Newsreader - Prediction with ARMAX</title>
    <description>Feed for thread: Prediction with ARMAX</description>
    <language>en-us</language>
    <copyright>&amp;copy;1994-2012 by MathWorks, Inc.</copyright>
    <webmaster>webmaster@mathworks.com</webmaster>
    <generator>MATLAB Central Newsreader</generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <ttl>60</ttl>
    <image>
      <title>MathWorks</title>
      <url>http://www.mathworks.com/images/membrane_icon.gif</url>
    </image>
    <item>
      <pubDate>Mon, 23 Feb 2009 14:39:44 -0500</pubDate>
      <title>Re: Prediction with ARMAX</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/244908#630200</link>
      <author>Rajiv Singh</author>
      <description>Hi Mehmet,&lt;br&gt;
Your model structure selection should primarily be guided by your knowldge &lt;br&gt;
of (or desire to capture) the underlying dynamics. For example, choose 'nk' &lt;br&gt;
based on what the perceived delay in the model is, and not based on how far &lt;br&gt;
in future you want to forecast result.&lt;br&gt;
&lt;br&gt;
So I would not advice shifting data or setting 'nk' to 7. Instead, try out &lt;br&gt;
various model orders (low to high) and use the one that seems to provide the &lt;br&gt;
best fit to your data. This can be ascertained using COMPARE function. For &lt;br&gt;
example, you can check how well your model simulates (M = Inf) or how well &lt;br&gt;
it performs 7 step-ahead prediction (M=7):&lt;br&gt;
COMPARE(DATA, MODEL, M)&lt;br&gt;
&lt;br&gt;
What prediction horizon to use in COMAPRE or PREDICT depends upon how you &lt;br&gt;
intend to use the model. If you are using model always to forecast results &lt;br&gt;
using I/O data collected under similar settings (similar noise/disturbance &lt;br&gt;
profile), then you could just validate your model using M = 7. However, if &lt;br&gt;
you are interested in checking how well the underlying dyanamics have been &lt;br&gt;
captured (which is a more severe validation test than finite horizon &lt;br&gt;
prediction), use M = Inf.&lt;br&gt;
&lt;br&gt;
This is what I do usually: I generate a bunch of candiate models (various &lt;br&gt;
types and orders) and use M = Inf in COMPARE to check how well they fit a &lt;br&gt;
validation data set. Then I select the one which provides the best fit while &lt;br&gt;
not using too high orders. I then use the model as required for prediction &lt;br&gt;
or simulation.&lt;br&gt;
&lt;br&gt;
HTH,&lt;br&gt;
Rajiv&lt;br&gt;
&lt;br&gt;
&quot;Mehmet Demirel&quot; &amp;lt;mecudem@yahoo.com&amp;gt; wrote in message &lt;br&gt;
news:gnjsoq$9ld$1@fred.mathworks.com...&lt;br&gt;
&amp;gt; Question is about data introduction to armax: M is a two column matrix &lt;br&gt;
&amp;gt; containing output (y) and input (u) time series. Each row is the &lt;br&gt;
&amp;gt; measurement of the same day, no day shift. Desired model structure with a &lt;br&gt;
&amp;gt; lead time of 7 days;&lt;br&gt;
&amp;gt; y(t) = B(q)u(t-7) + C(q)e(t)&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Do i need to introduce the data with a 7 row shift like this (target &lt;br&gt;
&amp;gt; starts at 8th day);&lt;br&gt;
&amp;gt; Input_calib =M(1:7664,2)&lt;br&gt;
&amp;gt; Target_calib=M(8:7671,1);&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Or it is not necessary as i can set Armax parameter &quot;nk&quot; as 7 for the same &lt;br&gt;
&amp;gt; purpose?&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; zcalib = iddata(y,u); %y output, u input&lt;br&gt;
&amp;gt; Armafit = armax(zcalib,'na',0,'nb',1,'nc',1,'nk',7);&lt;br&gt;
&amp;gt; Results:&lt;br&gt;
&amp;gt; y(t) = B(q)u(t) + C(q)e(t)&lt;br&gt;
&amp;gt; B(q) = 0.7437 (+-0.009438) q^-7&lt;br&gt;
&amp;gt; C(q) = 1 + 0.873 (+-0.007281) q^-1&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Second part of my question;&lt;br&gt;
&amp;gt; To make a realisation of the model in validation part;&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; predict(Armafit,zvalid,inf) or predict(Armafit,zvalid,7) should be &lt;br&gt;
&amp;gt; selected?&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; I think first one should be used according to this information available &lt;br&gt;
&amp;gt; at the link below..&lt;br&gt;
&amp;gt; YP = PREDICT(Z,TH,M)&lt;br&gt;
&amp;gt; M = inf gives a pure simulation of the system.(Default M=1).&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; But i am still not sure with lead time if it becomes 7+1 and 8 days since &lt;br&gt;
&amp;gt; default m is one...&lt;br&gt;
&amp;gt; Ref: &lt;a href=&quot;http://jisao.washington.edu/vimont_matlab/System/predict.html&quot;&gt;http://jisao.washington.edu/vimont_matlab/System/predict.html&lt;/a&gt;&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Cheers,&lt;br&gt;
&amp;gt; mehmet, loves knowledge share </description>
    </item>
    <item>
      <pubDate>Thu, 19 Feb 2009 15:10:18 -0500</pubDate>
      <title>Prediction with ARMAX</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/244908#629480</link>
      <author>Mehmet Demirel</author>
      <description>Question is about data introduction to armax: M is a two column matrix containing output (y) and input (u) time series. Each row is the measurement of the same day, no day shift. Desired model structure with a lead time of 7 days;&lt;br&gt;
y(t) = B(q)u(t-7) + C(q)e(t) &lt;br&gt;
&lt;br&gt;
Do i need to introduce the data with a 7 row shift like this (target starts at 8th day); &lt;br&gt;
Input_calib =M(1:7664,2)&lt;br&gt;
Target_calib=M(8:7671,1);&lt;br&gt;
&lt;br&gt;
Or it is not necessary as i can set Armax parameter &quot;nk&quot; as 7 for the same purpose? &lt;br&gt;
&lt;br&gt;
zcalib = iddata(y,u); %y output, u input&lt;br&gt;
Armafit = armax(zcalib,'na',0,'nb',1,'nc',1,'nk',7);&lt;br&gt;
Results:&lt;br&gt;
y(t) = B(q)u(t) + C(q)e(t)&lt;br&gt;
B(q) = 0.7437 (+-0.009438) q^-7&lt;br&gt;
C(q) = 1 + 0.873 (+-0.007281) q^-1&lt;br&gt;
&lt;br&gt;
Second part of my question;&lt;br&gt;
To make a realisation of the model in validation part;&lt;br&gt;
&lt;br&gt;
predict(Armafit,zvalid,inf) or predict(Armafit,zvalid,7) should be selected? &lt;br&gt;
&lt;br&gt;
I think first one should be used according to this information available at the link below..&lt;br&gt;
YP = PREDICT(Z,TH,M)&lt;br&gt;
M = inf gives a pure simulation of the system.(Default M=1).&lt;br&gt;
&lt;br&gt;
But i am still not sure with lead time if it becomes 7+1 and 8 days since default m is one...&lt;br&gt;
Ref: &lt;a href=&quot;http://jisao.washington.edu/vimont_matlab/System/predict.html&quot;&gt;http://jisao.washington.edu/vimont_matlab/System/predict.html&lt;/a&gt;&lt;br&gt;
&lt;br&gt;
Cheers,&lt;br&gt;
mehmet, loves knowledge share</description>
    </item>
  </channel>
</rss>

