
<?xml-stylesheet type="text/xsl" href="../styles/pmathml.xsl"?>

<html xmlns="http://www.w3.org/1999/xhtml" xmlns:dsi="http://www.w3.org/1999/xlink" xml:space="preserve"><head><title>
  NAG C Library, Mark 7 : 
  g13bjc</title><link rel="stylesheet" href="../styles/libdoc.css" type="text/css"/><script type="text/javascript">
   function showLevel(_levelId){
    var thisLevel = document.getElementById(_levelId);
    var thisplus = document.getElementById( _levelId.concat('plus'));
    var thisminus = document.getElementById( _levelId.concat('minus'));
    if(thisLevel.style.display != "block"){
     thisLevel.style.display = "block";
     thisplus.style.display = "none";
     thisminus.style.display = "inline";
     }
    else{
     thisLevel.style.display = "none";
     thisminus.style.display = "none";
     thisplus.style.display = "inline";
     }
    }
  </script></head><body><hr/><div><a href="../../pdf/G13/g13bjc.pdf">g13bjc (pdf version)</a></div><div><a href="g13_conts.xml">Chapter Contents</a></div><div><a href="g13_intro.xml">Chapter Introduction</a></div>
<div><a href="../mark7.xml">NAG C Library Contents</a></div><hr/><h1 class="libdoc">NAG C Library Function Document<br/><br/>nag_tsa_multi_inp_model_forecast (g13bjc)</h1>


<div class="htmltoc">
<h2><span class="htmltochead" onclick="showLevel('htmltoc');"><span class="htmltocplus" id="htmltocplus">+</span><span class="htmltocminus" id="htmltocminus">&#8722;</span></span>&#160;Contents</h2>
<div class="htmltocitem" id="htmltoc">
<div class="htmltoc">
<span class="htmltocplus">&#160;&#160;&#160;</span>
<a class="htmltoc" href="#purpose">&#160;1&#160;<b>Purpose</b></a>
<div class="htmltocitem" id="tocpurpose"/>
</div>

<div class="htmltoc">
<span class="htmltocplus">&#160;&#160;&#160;</span>
<a class="htmltoc" href="#specification">&#160;2&#160;<b>Specification</b></a>
<div class="htmltocitem" id="tocspecification"/>
</div>

<div class="htmltoc">
<span class="htmltocplus">&#160;&#160;&#160;</span>
<a class="htmltoc" href="#description">&#160;3&#160;<b>Description</b></a>
<div class="htmltocitem" id="tocdescription"/>
</div>

<div class="htmltoc">
<span class="htmltocplus">&#160;&#160;&#160;</span>
<a class="htmltoc" href="#references">&#160;4&#160;<b>References</b></a>
<div class="htmltocitem" id="tocreferences"/>
</div>

<div class="htmltoc">
<span class="htmltocplus">&#160;&#160;&#160;</span>
<a class="htmltoc" href="#parameters">&#160;5&#160;<b>Parameters</b></a>
<div class="htmltocitem" id="tocparameters"/>
</div>

<div class="htmltoc">
<span class="htmltocplus">&#160;&#160;&#160;</span>
<a class="htmltoc" href="#errors">&#160;6&#160;<b>Error Indicators and Warnings</b></a>
<div class="htmltocitem" id="tocerrors"/>
</div>

<div class="htmltoc">
<span class="htmltocplus">&#160;&#160;&#160;</span>
<a class="htmltoc" href="#accuracy">&#160;7&#160;<b>Accuracy</b></a>
<div class="htmltocitem" id="tocaccuracy"/>
</div>

<div class="htmltoc">
<span class="htmltocplus">&#160;&#160;&#160;</span>
<a class="htmltoc" href="#fcomments">&#160;8&#160;<b>Further Comments</b></a>
<div class="htmltocitem" id="tocfcomments"/>
</div>

<div class="htmltoc">
<span class="htmltoc" onclick="showLevel('tocg13bjcsec8');"><span class="htmltocplus" id="tocg13bjcsec8plus">+</span><span class="htmltocminus" id="tocg13bjcsec8minus">&#8722;</span></span>
<a class="htmltoc" href="#g13bjcsec8">&#160;9&#160;<b>Example</b></a>
<div class="htmltocitem" id="tocg13bjcsec8">
<div class="htmltoc">
<span class="htmltoc" onclick="showLevel('tocg13bjcsec81');"><span class="htmltocplus" id="tocg13bjcsec81plus">+</span><span class="htmltocminus" id="tocg13bjcsec81minus">&#8722;</span></span>
<a class="htmltoc" href="#g13bjcsec81">&#160;9.1&#160;<b>Example 1</b></a>
<div class="htmltocitem" id="tocg13bjcsec81">
<div class="htmltoc">
<span class="htmltocplus">&#160;&#160;&#160;</span>
<a class="htmltoc" href="#examtext1">&#160;9.1.1&#160;<b>Program Text</b></a>
<div class="htmltocitem" id="tocexamtext1"/>
</div>

<div class="htmltoc">
<span class="htmltocplus">&#160;&#160;&#160;</span>
<a class="htmltoc" href="#examdata1">&#160;9.1.2&#160;<b>Program Data</b></a>
<div class="htmltocitem" id="tocexamdata1"/>
</div>

<div class="htmltoc">
<span class="htmltocplus">&#160;&#160;&#160;</span>
<a class="htmltoc" href="#examresults1">&#160;9.1.3&#160;<b>Program Results</b></a>
<div class="htmltocitem" id="tocexamresults1"/>
</div>
</div>
</div>
</div>
</div>

<div class="htmltoc">
<span class="htmltoc" onclick="showLevel('tocoptparams');"><span class="htmltocplus" id="tocoptparamsplus">+</span><span class="htmltocminus" id="tocoptparamsminus">&#8722;</span></span>
<a class="htmltoc" href="#optparams">&#160;10&#160;<b>Optional Parameters</b></a>
<div class="htmltocitem" id="tocoptparams">
<div class="htmltoc">
<span class="htmltocplus">&#160;&#160;&#160;</span>
<a class="htmltoc" href="#g13bjcsec91">&#160;10.1&#160;<b>Optional Parameters Checklist and Default Values</b></a>
<div class="htmltocitem" id="tocg13bjcsec91"/>
</div>

<div class="htmltoc">
<span class="htmltocplus">&#160;&#160;&#160;</span>
<a class="htmltoc" href="#op-description">&#160;10.2&#160;<b>Description of Optional Parameters</b></a>
<div class="htmltocitem" id="tocop-description"/>
</div>
</div>
</div>

<div class="htmltoc">
<span class="htmltoc" onclick="showLevel('tocg13bjcsec10');"><span class="htmltocplus" id="tocg13bjcsec10plus">+</span><span class="htmltocminus" id="tocg13bjcsec10minus">&#8722;</span></span>
<a class="htmltoc" href="#g13bjcsec10">&#160;11&#160;<b>Example 2</b></a>
<div class="htmltocitem" id="tocg13bjcsec10">
<div class="htmltoc">
<span class="htmltocplus">&#160;&#160;&#160;</span>
<a class="htmltoc" href="#examtext2">&#160;11.1&#160;<b>Program Text</b></a>
<div class="htmltocitem" id="tocexamtext2"/>
</div>

<div class="htmltoc">
<span class="htmltocplus">&#160;&#160;&#160;</span>
<a class="htmltoc" href="#examdata2">&#160;11.2&#160;<b>Program Data</b></a>
<div class="htmltocitem" id="tocexamdata2"/>
</div>

<div class="htmltoc">
<span class="htmltocplus">&#160;&#160;&#160;</span>
<a class="htmltoc" href="#examresults2">&#160;11.3&#160;<b>Program Results</b></a>
<div class="htmltocitem" id="tocexamresults2"/>
</div>
</div>
</div>
</div>
</div>




<h2><a name="purpose" id="purpose"/>1&#160;&#160;Purpose</h2>

<div class="paramtext">nag_tsa_multi_inp_model_forecast (g13bjc) produces forecasts of a time series (the output series) which may depend on one or more other (input) series via a previously estimated multi-input model.  The future values of any input series must be supplied.  Standard errors of the forecasts are produced.  If future values of some of the input series have been obtained as forecasts using ARIMA models for those series, this may be allowed for in the calculation of the standard errors.</div>





<h2><a name="specification" id="specification"/>2&#160;&#160;Specification</h2>


<table class="cspec">
<tr><td class="tdcspec" colspan="2">#include &lt;nag.h&gt;<br/>
#include &lt;nagg13.h&gt;<br/><br/></td></tr>
<tr><td class="tdcspec">
void&#160;nag_tsa_multi_inp_model_forecast</td><td class="tdcspec">(Nag_ArimaOrder&#160;*<a class="argref" href="#arimav">arimav</a>, Integer&#160;<a class="argref" href="#nseries">nseries</a>, Nag_TransfOrder&#160;*<a class="argref" href="#transfv">transfv</a>, double&#160;<a class="argref" href="#para">para</a>[], Integer&#160;<a class="argref" href="#npara">npara</a>, Integer&#160;<a class="argref" href="#nev">nev</a>, Integer&#160;<a class="argref" href="#nfv">nfv</a>, const&#160;double&#160;<a class="argref" href="#xxy">xxy</a>[], Integer&#160;<a class="argref" href="#tdxxy">tdxxy</a>, double&#160;<a class="argref" href="#rmsxy">rmsxy</a>[], const&#160;Integer&#160;<a class="argref" href="#mrx">mrx</a>[], Integer&#160;<a class="argref" href="#tdmrx">tdmrx</a>, const&#160;double&#160;<a class="argref" href="#parx">parx</a>[], Integer&#160;<a class="argref" href="#ldparx">ldparx</a>, Integer&#160;<a class="argref" href="#tdparx">tdparx</a>, double&#160;<a class="argref" href="#fva">fva</a>[], double&#160;<a class="argref" href="#fsd">fsd</a>[], Nag_G13_Opt&#160;*<a class="argref" href="#options">options</a>, NagError&#160;*<a class="argref" href="#fail">fail</a>)

   
</td></tr>
</table>





<h2><a name="description" id="description"/>3&#160;&#160;Description</h2>

<div class="paramtext">nag_tsa_multi_inp_model_forecast (g13bjc) has two stages.  The first stage is essentially the same as a call to the model estimation function <a class="rtnref" href="../G13/g13bec.xml">nag_tsa_multi_inp_model_estim (g13bec)</a>, with zero iterations.  In particular, all the parameters remain unchanged in the supplied input series transfer function models and output noise series ARIMA model except that a further iteration takes place for any <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>&#969;</mi>
</math>&#160;corresponding to a simple input.  The internal nuisance parameters associated with the pre-observation period effects of the input series are estimated where requested, and so are any backforecasts of the output noise series.  The output components <math xmlns="http://www.w3.org/1998/Math/MathML">
 <msub>
  <mi>z</mi>
  <mi>t</mi>
 </msub>
</math>&#160;and <math xmlns="http://www.w3.org/1998/Math/MathML">
 <msub>
  <mi>n</mi>
  <mi>t</mi>
 </msub>
</math>, and residuals <math xmlns="http://www.w3.org/1998/Math/MathML">
 <msub>
  <mi>a</mi>
  <mi>t</mi>
 </msub>
</math>&#160;are calculated exactly as described in the Section <a class="secref" href="#description">3</a> of <a class="rtnref" href="../G13/g13bec.xml">nag_tsa_multi_inp_model_estim (g13bec)</a>.</div>
<div class="paramtext">In the second stage, the forecasts of the output series <math xmlns="http://www.w3.org/1998/Math/MathML">
 <msub>
  <mi>y</mi>
  <mi>t</mi>
 </msub>
</math>&#160;are calculated for <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>t</mi>
 <mo>=</mo>
 <mi>n</mi>
 <mo>+</mo>
 <mn>1</mn>
 <mo>,</mo>
 <mi>n</mi>
 <mo>+</mo>
 <mn>2</mn>
 <mo>,</mo>
 <mo>&#8230;</mo>
 <mo>,</mo>
 <mi>n</mi>
 <mo>+</mo>
 <mi>L</mi>
</math>&#160;where <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>n</mi>
</math>&#160;is the latest time point of the observations and <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>L</mi>
</math>&#160;is the maximum lead time of the forecasts.</div>
<div class="paramtext">First the new values, <math xmlns="http://www.w3.org/1998/Math/MathML">
 <msub>
  <mi>x</mi>
  <mi>t</mi>
 </msub>
</math>&#160;for any input series are used to form the input components <math xmlns="http://www.w3.org/1998/Math/MathML">
 <msub>
  <mi>z</mi>
  <mi>t</mi>
 </msub>
</math>&#160;for <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>t</mi>
 <mo>=</mo>
 <mi>n</mi>
 <mo>+</mo>
 <mn>1</mn>
 <mo>,</mo>
 <mi>n</mi>
 <mo>+</mo>
 <mn>2</mn>
 <mo>,</mo>
 <mo>&#8230;</mo>
 <mo>,</mo>
 <mi>n</mi>
 <mo>+</mo>
 <mi>L</mi>
</math>&#160;using the transfer function models:</div>
<ol class="listalpha"><li class="listalpha"><math xmlns="http://www.w3.org/1998/Math/MathML">
 <msub>
  <mi>z</mi>
  <mi>t</mi>
 </msub>
 <mo>=</mo>
 <msub>
  <mi>&#948;</mi>
  <mn>1</mn>
 </msub>
 <msub>
  <mi>z</mi>
  <mrow><mi>t</mi><mo>-</mo><mn>1</mn></mrow>
 </msub>
 <mo>+</mo>
 <msub>
  <mi>&#948;</mi>
  <mn>2</mn>
 </msub>
 <msub>
  <mi>z</mi>
  <mrow><mi>t</mi><mo>-</mo><mn>2</mn></mrow>
 </msub>
 <mo>+</mo>
 <mo>&#8943;</mo>
 <mo>+</mo>
 <msub>
  <mi>&#948;</mi>
  <mi>p</mi>
 </msub>
 <msub>
  <mi>z</mi>
  <mrow><mi>t</mi><mo>-</mo><mi>p</mi></mrow>
 </msub>
 <mo>+</mo>
 <msub>
  <mi>&#969;</mi>
  <mn>0</mn>
 </msub>
 <msub>
  <mi>x</mi>
  <mrow><mi>t</mi><mo>-</mo><mi>b</mi></mrow>
 </msub>
 <mo>-</mo>
 <msub>
  <mi>&#969;</mi>
  <mn>1</mn>
 </msub>
 <msub>
  <mi>x</mi>
  <mrow>
   <mrow><mi>t</mi><mo>-</mo><mi>b</mi></mrow>
   <mo>-</mo>
   <mn>1</mn>
  </mrow>
 </msub>
 <mo>-</mo>
 <mo>&#8943;</mo>
 <mo>-</mo>
 <msub>
  <mi>&#969;</mi>
  <mi>q</mi>
 </msub>
 <msub>
  <mi>x</mi>
  <mrow>
   <mi>t</mi>
   <mo>-</mo>
   <mi>b</mi>
   <mo>-</mo>
   <mi>q</mi>
  </mrow>
 </msub>
</math>.
 <div class="paramtext">The output noise component <math xmlns="http://www.w3.org/1998/Math/MathML">
 <msub>
  <mi>n</mi>
  <mi>t</mi>
 </msub>
</math>&#160;for <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>t</mi>
 <mo>=</mo>
 <mi>n</mi>
 <mo>+</mo>
 <mn>1</mn>
 <mo>,</mo>
 <mi>n</mi>
 <mo>+</mo>
 <mn>2</mn>
 <mo>,</mo>
 <mo>&#8230;</mo>
 <mo>,</mo>
 <mi>n</mi>
 <mo>+</mo>
 <mi>L</mi>
</math>&#160;is then forecast by setting <math xmlns="http://www.w3.org/1998/Math/MathML">
 <msub>
  <mi>a</mi>
  <mi>t</mi>
 </msub>
 <mo>=</mo>
 <mn>0</mn>
</math>&#160;for <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>t</mi>
 <mo>=</mo>
 <mi>n</mi>
 <mo>+</mo>
 <mn>1</mn>
 <mo>,</mo>
 <mi>n</mi>
 <mo>+</mo>
 <mn>2</mn>
 <mo>,</mo>
 <mo>&#8230;</mo>
 <mo>,</mo>
 <mi>n</mi>
 <mo>+</mo>
 <mi>L</mi>
</math>&#160;and using the ARIMA model equations:</div></li><li class="listalpha"><math xmlns="http://www.w3.org/1998/Math/MathML">
 <msub>
  <mi>e</mi>
  <mi>t</mi>
 </msub>
 <mo>=</mo>
 <msub>
  <mi>&#981;</mi>
  <mn>1</mn>
 </msub>
 <msub>
  <mi>e</mi>
  <mrow><mi>t</mi><mo>-</mo><mn>1</mn></mrow>
 </msub>
 <mo>+</mo>
 <msub>
  <mi>&#981;</mi>
  <mn>2</mn>
 </msub>
 <msub>
  <mi>e</mi>
  <mrow><mi>t</mi><mo>-</mo><mn>2</mn></mrow>
 </msub>
 <mo>+</mo>
 <mo>&#8943;</mo>
 <mo>+</mo>
 <msub>
  <mi>&#981;</mi>
  <mi>p</mi>
 </msub>
 <msub>
  <mi>e</mi>
  <mrow><mi>t</mi><mo>-</mo><mi>p</mi></mrow>
 </msub>
 <mo>+</mo>
 <msub>
  <mi>a</mi>
  <mi>t</mi>
 </msub>
 <mo>-</mo>
 <msub>
  <mi>&#952;</mi>
  <mn>1</mn>
 </msub>
 <msub>
  <mi>a</mi>
  <mrow><mi>t</mi><mo>-</mo><mn>1</mn></mrow>
 </msub>
 <mo>-</mo>
 <msub>
  <mi>&#952;</mi>
  <mn>2</mn>
 </msub>
 <msub>
  <mi>a</mi>
  <mrow><mi>t</mi><mo>-</mo><mn>2</mn></mrow>
 </msub>
 <mo>-</mo>
 <mo>&#8943;</mo>
 <mo>-</mo>
 <msub>
  <mi>&#952;</mi>
  <mi>q</mi>
 </msub>
 <msub>
  <mi>a</mi>
  <mrow><mi>t</mi><mo>-</mo><mi>q</mi></mrow>
 </msub>
</math>.</li><li class="listalpha"><math xmlns="http://www.w3.org/1998/Math/MathML">
 <msub>
  <mi>w</mi>
  <mi>t</mi>
 </msub>
 <mo>=</mo>
 <msub>
  <mi>&#934;</mi>
  <mn>1</mn>
 </msub>
 <msub>
  <mi>w</mi>
  <mrow><mi>t</mi><mo>-</mo><mi>s</mi></mrow>
 </msub>
 <mo>+</mo>
 <msub>
  <mi>&#934;</mi>
  <mn>2</mn>
 </msub>
 <msub>
  <mi>w</mi>
  <mrow>
   <mi>t</mi>
   <mo>-</mo>
   <mn>2</mn>
   <mo>&#215;</mo>
   <mi>s</mi>
  </mrow>
 </msub>
 <mo>+</mo>
 <mo>&#8943;</mo>
 <mo>+</mo>
 <msub>
  <mi>&#934;</mi>
  <mi>P</mi>
 </msub>
 <msub>
  <mi>w</mi>
  <mrow>
   <mrow><mi>t</mi><mo>-</mo><mi>P</mi></mrow>
   <mo>&#215;</mo>
   <mi>s</mi>
  </mrow>
 </msub>
 <mo>+</mo>
 <msub>
  <mi>e</mi>
  <mi>t</mi>
 </msub>
 <mo>-</mo>
 <msub>
  <mi>&#920;</mi>
  <mn>1</mn>
 </msub>
 <msub>
  <mi>e</mi>
  <mrow><mi>t</mi><mo>-</mo><mi>s</mi></mrow>
 </msub>
 <mo>-</mo>
 <msub>
  <mi>&#920;</mi>
  <mn>2</mn>
 </msub>
 <msub>
  <mi>e</mi>
  <mrow>
   <mi>t</mi>
   <mo>-</mo>
   <mn>2</mn>
   <mo>&#215;</mo>
   <mi>s</mi>
  </mrow>
 </msub>
 <mo>-</mo>
 <mo>&#8943;</mo>
 <mo>-</mo>
 <msub>
  <mi>&#920;</mi>
  <mi>Q</mi>
 </msub>
 <msub>
  <mi>e</mi>
  <mrow>
   <mrow><mi>t</mi><mo>-</mo><mi>Q</mi></mrow>
   <mo>&#215;</mo>
   <mi>s</mi>
  </mrow>
 </msub>
</math>.</li><li class="listalpha"><math xmlns="http://www.w3.org/1998/Math/MathML">
 <msub>
  <mi>n</mi>
  <mi>t</mi>
 </msub>
 <mo>=</mo>
 <msup>
  <mfenced separators="">
   <msup>
    <mo>&#8711;</mo>
    <mi>d</mi>
   </msup>
   <msubsup>
    <mo>&#8711;</mo>
    <mi>s</mi>
    <mi>D</mi>
   </msubsup>
  </mfenced>
  <mrow><mo>-</mo><mn>1</mn></mrow>
 </msup>
 <mfenced separators="">
  <msub>
   <mi>w</mi>
   <mi>t</mi>
  </msub>
  <mo>+</mo>
  <mi>c</mi>
 </mfenced>
</math>.</li></ol>
<div class="paramtext">This last step of &#8216;integration&#8217; reverses the process of differencing.  Finally the output forecasts are calculated as
</div>
<div class="formula"><table class="formula"><tr><td class="formula"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
 <msub>
  <mi>y</mi>
  <mi>t</mi>
 </msub>
 <mo>=</mo>
 <msub>
  <mi>z</mi>
  <mrow><mn>1</mn><mo>,</mo><mi>t</mi></mrow>
 </msub>
 <mo>+</mo>
 <msub>
  <mi>z</mi>
  <mrow><mn>2</mn><mo>,</mo><mi>t</mi></mrow>
 </msub>
 <mo>+</mo>
 <mo>&#8943;</mo>
 <mo>+</mo>
 <msub>
  <mi>z</mi>
  <mrow><mi>m</mi><mo>,</mo><mi>t</mi></mrow>
 </msub>
 <mo>+</mo>
 <msub>
  <mi>n</mi>
  <mi>t</mi>
 </msub>
 <mtext>.</mtext>
</math></td><td class="formula2"/></tr></table></div>
<div class="paramtext">
The forecast error variance of <math xmlns="http://www.w3.org/1998/Math/MathML">
 <msub>
  <mi>y</mi>
  <mrow><mi>t</mi><mo>+</mo><mi>l</mi></mrow>
 </msub>
</math>&#160;(i.e., at lead time <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>l</mi>
</math>) is <math xmlns="http://www.w3.org/1998/Math/MathML">
 <msubsup>
  <mi>S</mi>
  <mi>l</mi>
  <mn>2</mn>
 </msubsup>
</math>, which is the sum of parts which arise from the various input series, and the output noise component.  That part due to the output noise is
</div>
<div class="formula"><table class="formula"><tr><td class="formula"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
 <mrow>
  <msubsup>
   <mrow><mi>s</mi><mi>n</mi></mrow>
   <mi>l</mi>
   <mn>2</mn>
  </msubsup>
  <mo>=</mo>
  <msub>
   <mi>V</mi>
   <mi>n</mi>
  </msub>
  <mo>&#215;</mo>
  <mfenced separators="">
   <msubsup>
    <mi>&#968;</mi>
    <mn>0</mn>
    <mn>2</mn>
   </msubsup>
   <mo>+</mo>
   <msubsup>
    <mi>&#968;</mi>
    <mn>1</mn>
    <mn>2</mn>
   </msubsup>
   <mo>+</mo>
   <mo>&#8943;</mo>
   <mo>+</mo>
   <msubsup>
    <mi>&#968;</mi>
    <mrow><mi>l</mi><mo>-</mo><mn>1</mn></mrow>
    <mn>2</mn>
   </msubsup>
  </mfenced>
 </mrow>
</math></td><td class="formula2"/></tr></table></div>
<div class="paramtext">
<math xmlns="http://www.w3.org/1998/Math/MathML">
 <msub>
  <mi>V</mi>
  <mi>n</mi>
 </msub>
</math>&#160;is the estimated residual variance of the output noise ARIMA model, and <math xmlns="http://www.w3.org/1998/Math/MathML">
 <msub>
  <mi>&#968;</mi>
  <mn>0</mn>
 </msub>
 <mo>,</mo>
 <msub>
  <mi>&#968;</mi>
  <mn>1</mn>
 </msub>
 <mo>,</mo>
 <mo>&#8230;</mo>
</math>, are the &#8216;psi-weights&#8217; of this model as defined in <a class="litref" href="#ref163">Box  and Jenkins (1976)</a>.  They are calculated by applying the equations (b), (c) and (d) above for <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>t</mi>
 <mo>=</mo>
 <mn>0</mn>
 <mo>,</mo>
 <mn>1</mn>
 <mo>,</mo>
 <mo>&#8230;</mo>
 <mo>,</mo>
 <mi>L</mi>
</math>, but with artificial values for the various series and with the constant <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>c</mi>
</math>&#160;set to 0.  Thus all values of <math xmlns="http://www.w3.org/1998/Math/MathML">
 <msub>
  <mi>a</mi>
  <mi>t</mi>
 </msub>
</math>, <math xmlns="http://www.w3.org/1998/Math/MathML">
 <msub>
  <mi>e</mi>
  <mi>t</mi>
 </msub>
</math>, <math xmlns="http://www.w3.org/1998/Math/MathML">
 <msub>
  <mi>w</mi>
  <mi>t</mi>
 </msub>
</math>&#160;and <math xmlns="http://www.w3.org/1998/Math/MathML">
 <msub>
  <mi>n</mi>
  <mi>t</mi>
 </msub>
</math>&#160;are taken as zero for <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>t</mi><mo>&lt;</mo><mn>0</mn>
</math>; <math xmlns="http://www.w3.org/1998/Math/MathML">
 <msub>
  <mi>a</mi>
  <mi>t</mi>
 </msub>
</math>&#160;is taken to be 1 for <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>t</mi><mo>=</mo><mn>0</mn>
</math>&#160;and 0 for <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>t</mi><mo>&gt;</mo><mn>0</mn>
</math>.  The resulting values of <math xmlns="http://www.w3.org/1998/Math/MathML">
 <msub>
  <mi>n</mi>
  <mi>t</mi>
 </msub>
</math>&#160;for <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>t</mi>
 <mo>=</mo>
 <mn>0</mn>
 <mo>,</mo>
 <mn>1</mn>
 <mo>,</mo>
 <mo>&#8230;</mo>
 <mo>,</mo>
 <mi>L</mi>
</math>&#160;are precisely <math xmlns="http://www.w3.org/1998/Math/MathML">
 <msub>
  <mi>&#968;</mi>
  <mn>0</mn>
 </msub>
 <mo>,</mo>
 <msub>
  <mi>&#968;</mi>
  <mn>1</mn>
 </msub>
 <mo>,</mo>
 <mo>&#8230;</mo>
 <mo>,</mo>
 <msub>
  <mi>&#968;</mi>
  <mi>L</mi>
 </msub>
</math>&#160;as required.</div>
<div class="paramtext">Further contributions to <math xmlns="http://www.w3.org/1998/Math/MathML">
 <msubsup>
  <mi>S</mi>
  <mi>l</mi>
  <mn>2</mn>
 </msubsup>
</math>&#160;come only from those input series, for which future values are forecasts which have been obtained by applying input series ARIMA models.  For such a series the contribution is
</div>
<div class="formula"><table class="formula"><tr><td class="formula"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
 <msubsup>
  <mrow><mi>s</mi><mi>z</mi></mrow>
  <mi>l</mi>
  <mn>2</mn>
 </msubsup>
 <mo>=</mo>
 <msub>
  <mi>V</mi>
  <mi>x</mi>
 </msub>
 <mo>&#215;</mo>
 <mfenced separators="">
  <msubsup>
   <mi>&#957;</mi>
   <mn>0</mn>
   <mn>2</mn>
  </msubsup>
  <mo>+</mo>
  <msubsup>
   <mi>&#957;</mi>
   <mn>1</mn>
   <mn>2</mn>
  </msubsup>
  <mo>+</mo>
  <mo>&#8943;</mo>
  <mo>+</mo>
  <msubsup>
   <mi>&#957;</mi>
   <mrow><mi>l</mi><mo>-</mo><mn>1</mn></mrow>
   <mn>2</mn>
  </msubsup>
 </mfenced>
</math></td><td class="formula2"/></tr></table></div>
<div class="paramtext">
<math xmlns="http://www.w3.org/1998/Math/MathML">
 <msub>
  <mi>V</mi>
  <mi>x</mi>
 </msub>
</math>&#160;is the estimated residual variance of the input series ARIMA model.  The coefficients <math xmlns="http://www.w3.org/1998/Math/MathML">
 <msub>
  <mi>&#957;</mi>
  <mn>0</mn>
 </msub>
 <mo>,</mo>
 <msub>
  <mi>&#957;</mi>
  <mn>1</mn>
 </msub>
 <mo>,</mo>
 <mo>&#8230;</mo>
</math>&#160;are calculated by applying the transfer function model equation (a) above for <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>t</mi>
 <mo>=</mo>
 <mn>0</mn>
 <mo>,</mo>
 <mn>1</mn>
 <mo>,</mo>
 <mo>&#8230;</mo>
 <mo>,</mo>
 <mi>L</mi>
</math>, but again with artificial values of the series.  Thus all values of <math xmlns="http://www.w3.org/1998/Math/MathML">
 <msub>
  <mi>z</mi>
  <mi>t</mi>
 </msub>
</math>&#160;and <math xmlns="http://www.w3.org/1998/Math/MathML">
 <msub>
  <mi>x</mi>
  <mi>t</mi>
 </msub>
</math>&#160;for <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>t</mi><mo>&lt;</mo><mn>0</mn>
</math>&#160;are taken to be zero, and <math xmlns="http://www.w3.org/1998/Math/MathML">
 <msub>
  <mi>x</mi>
  <mn>0</mn>
 </msub>
 <mo>,</mo>
 <msub>
  <mi>x</mi>
  <mn>1</mn>
 </msub>
 <mo>,</mo>
 <mo>&#8230;</mo>
</math>&#160;are taken to be the psi-weight sequence <math xmlns="http://www.w3.org/1998/Math/MathML">
 <msub>
  <mi>&#968;</mi>
  <mn>0</mn>
 </msub>
 <mo>,</mo>
 <msub>
  <mi>&#968;</mi>
  <mn>1</mn>
 </msub>
 <mo>,</mo>
 <mo>&#8230;</mo>
</math>&#160;for the input series ARIMA model.  The resulting values of <math xmlns="http://www.w3.org/1998/Math/MathML">
 <msub>
  <mi>z</mi>
  <mi>t</mi>
 </msub>
</math>&#160;for <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>t</mi>
 <mo>=</mo>
 <mn>0</mn>
 <mo>,</mo>
 <mn>1</mn>
 <mo>,</mo>
 <mo>&#8230;</mo>
 <mo>,</mo>
 <mi>L</mi>
</math>&#160;are precisely <math xmlns="http://www.w3.org/1998/Math/MathML">
 <msub>
  <mi>&#957;</mi>
  <mn>0</mn>
 </msub>
 <mo>,</mo>
 <msub>
  <mi>&#957;</mi>
  <mn>1</mn>
 </msub>
 <mo>,</mo>
 <mo>&#8230;</mo>
 <mo>,</mo>
 <msub>
  <mi>&#957;</mi>
  <mi>L</mi>
 </msub>
</math>&#160;as required.</div>
<div class="paramtext">In adding such contributions <math xmlns="http://www.w3.org/1998/Math/MathML">
 <msubsup>
  <mrow><mi>s</mi><mi>z</mi></mrow>
  <mi>l</mi>
  <mn>2</mn>
 </msubsup>
</math>&#160;to <math xmlns="http://www.w3.org/1998/Math/MathML">
 <msubsup>
  <mrow><mi>s</mi><mi>n</mi></mrow>
  <mi>l</mi>
  <mn>2</mn>
 </msubsup>
</math>&#160;to make up the total forecast error variance <math xmlns="http://www.w3.org/1998/Math/MathML">
 <msubsup>
  <mi>S</mi>
  <mi>l</mi>
  <mn>2</mn>
 </msubsup>
</math>, it is assumed that the various input series with which these contributions are associated, are statistically independent of each other.</div>
<div class="paramtext">When using the function in practice an ARIMA model is required for all the input series.  In the case of those inputs for which no such ARIMA model is available (or its effects are to be excluded), the corresponding orders and parameters and the estimated residual variance should be set to zero.</div>





<h2><a name="references" id="references"/>4&#160;&#160;References</h2>

<div class="paramtext">
<p><a name="ref163" id="ref163"/>Box G E P and Jenkins G M (1976) <i>Time Series Analysis: Forecasting and Control</i> (Revised Edition) Holden&#8211;Day </p>
</div>





<h2><a name="parameters" id="parameters"/>5&#160;&#160;Parameters</h2>


<dl><dt class="paramhead"><a name="arimav" id="arimav"/>1:
 &#160;&#160;&#8194;
 <b>arimav</b> &#8211; Nag_ArimaOrder&#160;*</dt><dd>
<div class="paramtext">Pointer to structure of type <b>Nag_ArimaOrder</b> with the following members:</div>

<div>
<dl>
<dt class="memberhead"><a name="arimav_p" id="arimav_p"/><b>p</b> &#8211; Integer&#160;<span class="pclass"/></dt>
<dt class="multi-memberhead"><a name="arimav_d" id="arimav_d"/><b>d</b> &#8211; Integer&#160;<span class="pclass">Input</span></dt>
<dt class="multi-memberhead"><a name="arimav_q" id="arimav_q"/><b>q</b> &#8211; Integer&#160;<span class="pclass">Input</span></dt>
<dt class="multi-memberhead"><a name="arimav_bigp" id="arimav_bigp"/><b>bigp</b> &#8211; Integer&#160;<span class="pclass">Input</span></dt>
<dt class="multi-memberhead"><a name="arimav_bigd" id="arimav_bigd"/><b>bigd</b> &#8211; Integer&#160;<span class="pclass">Input</span></dt>
<dt class="multi-memberhead"><a name="arimav_bigq" id="arimav_bigq"/><b>bigq</b> &#8211; Integer&#160;<span class="pclass">Input</span></dt>
<dt class="multi-memberhead"><a name="arimav_s" id="arimav_s"/><b>s</b> &#8211; Integer&#160;<span class="pclass">Input</span></dt><dd>
<div class="membertext"><i>On entry</i>: these seven members of <a class="argref" href="#arimav">arimav</a> must specify the orders vector <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mfenced separators=""><mi>p</mi><mo>,</mo><mi>d</mi><mo>,</mo><mi>q</mi><mo>,</mo><mi>P</mi><mo>,</mo><mi>D</mi><mo>,</mo><mi>Q</mi><mo>,</mo><mi>s</mi></mfenced>
</math>, respectively, of the ARIMA model for the output noise component.
<div class="paramtext"><math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>p</mi>
</math>, <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>q</mi>
</math>, <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>P</mi>
</math>&#160;and <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>Q</mi>
</math>&#160;refer, respectively, to the number of autoregressive <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mfenced separators=""><mi>&#981;</mi></mfenced>
</math>, moving average <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mfenced separators=""><mi>&#952;</mi></mfenced>
</math>, seasonal autoregressive <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mfenced separators=""><mi>&#934;</mi></mfenced>
</math>&#160;and seasonal moving average <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mfenced separators=""><mi>&#920;</mi></mfenced>
</math>&#160;parameters.</div>
<div class="paramtext"><math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>d</mi>
</math>, <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>D</mi>
</math>&#160;and <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>s</mi>
</math>&#160;refer, respectively, to the order of non-seasonal differencing, the order of seasonal differencing and the seasonal period.</div>
</div>
</dd>

</dl>
</div>
</dd><dt class="paramhead"><a name="nseries" id="nseries"/>2:
 &#160;&#160;&#8194;
 <b>nseries</b> &#8211; Integer&#160;<span class="pclass">Input</span></dt><dd>
<div class="paramtext"><i>On entry</i>: the number of input and output series.  There may be any number of input series (including none), but only one output series.</div>

<div class="paramtext"><i>Constraint</i>:
  <math xmlns="http://www.w3.org/1998/Math/MathML">
 <maction actiontype="link" dsi:href="#nseries" dsi:type="simple"><mi mathcolor="#EE0000" mathvariant="bold">nseries</mi></maction><mo>&gt;</mo><mn>1</mn>
</math>&#160;if there are no parameters in the model (that is <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>p</mi>
 <mo>=</mo>
 <mi>q</mi>
 <mo>=</mo>
 <mi>P</mi>
 <mo>=</mo>
 <mi>Q</mi>
 <mo>=</mo>
 <mn>0</mn>
</math>&#160;and <math xmlns="http://www.w3.org/1998/Math/MathML">
 <maction actiontype="link" dsi:href="#optparam_cfixed" dsi:type="simple"><mi mathcolor="#800080" mathvariant="bold">options.cfixed</mi></maction><mo>=</mo><mi mathvariant="bold">TRUE</mi>
</math>), <math xmlns="http://www.w3.org/1998/Math/MathML">
 <maction actiontype="link" dsi:href="#nseries" dsi:type="simple"><mi mathcolor="#EE0000" mathvariant="bold">nseries</mi></maction><mo>&#8805;</mo><mn>1</mn>
</math>&#160;otherwise
.</div>
</dd><dt class="paramhead"><a name="transfv" id="transfv"/>3:
 &#160;&#160;&#8194;
 <b>transfv</b> &#8211; Nag_TransfOrder&#160;*</dt><dd>
<div class="paramtext">Pointer to structure of type <b>Nag_TransfOrder</b> with the following members:</div>
<div>
<dl>
<dt class="memberhead"><a name="transfv_b" id="transfv_b"/><b>b</b> &#8211; Integer&#160;*<span class="pclass">Input</span></dt>
<dt class="multi-memberhead"><a name="transfv_q" id="transfv_q"/><b>q</b> &#8211; Integer&#160;*<span class="pclass">Input</span></dt>
<dt class="multi-memberhead"><a name="transfv_p" id="transfv_p"/><b>p</b> &#8211; Integer&#160;*<span class="pclass"/></dt>
<dt class="multi-memberhead"><a name="transfv_r" id="transfv_r"/><b>r</b> &#8211; Integer&#160;*<span class="pclass">Input</span></dt><dd>
<div class="membertext"><i>On entry</i>: before use these member pointers <b>must</b> be allocated memory by calling <a class="rtnref" href="../G13/g13byc.xml">nag_tsa_transf_orders (g13byc)</a> which allocates <math xmlns="http://www.w3.org/1998/Math/MathML">
 <maction actiontype="link" dsi:href="#nseries" dsi:type="simple"><mi mathcolor="#EE0000" mathvariant="bold">nseries</mi></maction><mo>-</mo><mn>1</mn>
</math>&#160;elements to each pointer.  The memory allocated to these pointers must be given the transfer function model orders <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>b</mi>
</math>, <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>q</mi>
</math>&#160;and <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>p</mi>
</math>&#160;of each of the input series.  The order parameters for input series <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>i</mi>
</math>&#160;are held in the <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>i</mi>
</math>th element of the allocated memory for each pointer.  <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mrow><mrow><maction actiontype="link" dsi:href="#transfv_b" dsi:type="simple"><mi mathcolor="#FF00FF" mathvariant="bold">b</mi></maction><mfenced open="[" close="]"><mrow><mi>i</mi><mo>-</mo><mn>1</mn></mrow></mfenced></mrow></mrow>
</math>&#160;holds the value <math xmlns="http://www.w3.org/1998/Math/MathML">
 <msub>
  <mi>b</mi>
  <mi>i</mi>
 </msub>
</math>, <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mrow><mrow><maction actiontype="link" dsi:href="#transfv_q" dsi:type="simple"><mi mathcolor="#FF00FF" mathvariant="bold">q</mi></maction><mfenced open="[" close="]"><mrow><mi>i</mi><mo>-</mo><mn>1</mn></mrow></mfenced></mrow></mrow>
</math>&#160;holds the value <math xmlns="http://www.w3.org/1998/Math/MathML">
 <msub>
  <mi>q</mi>
  <mi>i</mi>
 </msub>
</math>&#160;and <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mrow><mrow><maction actiontype="link" dsi:href="#transfv_p" dsi:type="simple"><mi mathcolor="#FF00FF" mathvariant="bold">p</mi></maction><mfenced open="[" close="]"><mrow><mi>i</mi><mo>-</mo><mn>1</mn></mrow></mfenced></mrow></mrow>
</math>&#160;holds the value <math xmlns="http://www.w3.org/1998/Math/MathML">
 <msub>
  <mi>p</mi>
  <mi>i</mi>
 </msub>
</math>.
<div class="paramtext">For a simple input, <math xmlns="http://www.w3.org/1998/Math/MathML">
 <msub>
  <mi>b</mi>
  <mi>i</mi>
 </msub>
 <mo>=</mo>
 <msub>
  <mi>q</mi>
  <mi>i</mi>
 </msub>
 <mo>=</mo>
 <msub>
  <mi>p</mi>
  <mi>i</mi>
 </msub>
 <mo>=</mo>
 <mn>0</mn>
</math>.</div>
<div class="paramtext"><math xmlns="http://www.w3.org/1998/Math/MathML">
 <mrow><mrow><maction actiontype="link" dsi:href="#transfv_r" dsi:type="simple"><mi mathcolor="#FF00FF" mathvariant="bold">r</mi></maction><mfenced open="[" close="]"><mrow><mi>i</mi><mo>-</mo><mn>1</mn></mrow></mfenced></mrow></mrow>
</math>&#160;holds the value <math xmlns="http://www.w3.org/1998/Math/MathML">
 <msub>
  <mi>r</mi>
  <mi>i</mi>
 </msub>
</math>, where <math xmlns="http://www.w3.org/1998/Math/MathML">
 <msub>
  <mi>r</mi>
  <mi>i</mi>
 </msub>
 <mo>=</mo>
 <mn>1</mn>
</math>&#160;for a simple input, and <math xmlns="http://www.w3.org/1998/Math/MathML">
 <msub>
  <mi>r</mi>
  <mi>i</mi>
 </msub>
 <mo>=</mo>
 <mn>2</mn>
</math>&#160;or 3 for a transfer function input.</div>
<div class="paramtext">The choice <math xmlns="http://www.w3.org/1998/Math/MathML">
 <msub>
  <mi>r</mi>
  <mi>i</mi>
 </msub>
 <mo>=</mo>
 <mn>3</mn>
</math>&#160;leads to estimation of the pre-period input effects as nuisance parameters, and <math xmlns="http://www.w3.org/1998/Math/MathML">
 <msub>
  <mi>r</mi>
  <mi>i</mi>
 </msub>
 <mo>=</mo>
 <mn>2</mn>
</math>&#160;suppresses this estimation.  This choice may affect the returned forecasts.</div>
<div class="paramtext">When <math xmlns="http://www.w3.org/1998/Math/MathML">
 <msub>
  <mi>r</mi>
  <mi>i</mi>
 </msub>
 <mo>=</mo>
 <mn>1</mn>
</math>, any non-zero contents of the <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>i</mi>
</math>th element of the memory of <a class="memberref" href="#transfv_b">b</a>, <a class="memberref" href="#transfv_q">q</a> and <a class="memberref" href="#transfv_p">p</a> are ignored.</div>
</div>

<div class="membertext"><i>Constraint</i>:
  <math xmlns="http://www.w3.org/1998/Math/MathML"><mrow><mrow><maction actiontype="link" dsi:href="#transfv_r" dsi:type="simple"><mi mathcolor="#FF00FF" mathvariant="bold">r</mi></maction><mfenced open="[" close="]"><mrow><mi>i</mi><mo>-</mo><mn>1</mn></mrow></mfenced></mrow></mrow></math>&#160;<math xmlns="http://www.w3.org/1998/Math/MathML"><mo>=</mo></math>&#160;<math xmlns="http://www.w3.org/1998/Math/MathML"><mn>1</mn></math>, <math xmlns="http://www.w3.org/1998/Math/MathML"><mn>2</mn></math>&#160;or <math xmlns="http://www.w3.org/1998/Math/MathML"><mn>3</mn></math>, for <math xmlns="http://www.w3.org/1998/Math/MathML"><mi mathvariant="italic">i</mi><mo>=</mo><mn>1</mn><mo>,</mo><mn>2</mn><mo>,</mo><mo>&#8230;</mo><mo>,</mo><mrow><maction actiontype="link" dsi:href="#nseries" dsi:type="simple"><mi mathcolor="#EE0000" mathvariant="bold">nseries</mi></maction><mo>-</mo><mn>1</mn></mrow></math><div class="paramtext">The memory allocated to the members of <a class="argref" href="#transfv">transfv</a> must be freed by a call to <a class="rtnref" href="../G13/g13bzc.xml">nag_tsa_trans_free (g13bzc)</a></div></div></dd>

</dl>
</div>
</dd><dt class="paramhead"><a name="para" id="para"/>4:
 &#160;&#160;&#8194;
 <b>para</b>[<a class="argref" href="#npara">npara</a>] &#8211; double&#160;<span class="pclass">Input/Output</span></dt><dd>
<div class="paramtext"><i>On entry</i>: estimates of the multi-input model parameters.  These are in order firstly the ARIMA model parameters: <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>p</mi>
</math>&#160;values of <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>&#981;</mi>
</math>&#160;parameters, <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>q</mi>
</math>&#160;values of <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>&#952;</mi>
</math>&#160;parameters, <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>P</mi>
</math>&#160;values of <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>&#934;</mi>
</math>&#160;parameters, <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>Q</mi>
</math>&#160;values of <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>&#920;</mi>
</math>&#160;parameters.  These are followed by the transfer function model parameter values <math xmlns="http://www.w3.org/1998/Math/MathML">
 <msub>
  <mi>&#969;</mi>
  <mn>0</mn>
 </msub>
 <mo>,</mo>
 <msub>
  <mi>&#969;</mi>
  <mn>1</mn>
 </msub>
 <mo>,</mo>
 <mo>&#8230;</mo>
 <mo>,</mo>
 <msub>
  <mi>&#969;</mi>
  <msub>
   <mi>q</mi>
   <mn>1</mn>
  </msub>
 </msub>
</math>, and <math xmlns="http://www.w3.org/1998/Math/MathML">
 <msub>
  <mi>&#948;</mi>
  <mn>1</mn>
 </msub>
 <mo>,</mo>
 <msub>
  <mi>&#948;</mi>
  <mn>2</mn>
 </msub>
 <mo>,</mo>
 <mo>&#8230;</mo>
 <mo>,</mo>
 <msub>
  <mi>&#948;</mi>
  <msub>
   <mi>p</mi>
   <mn>1</mn>
  </msub>
 </msub>
</math>&#160;for the first of any input series and similarly for each subsequent input series.  The final component of <a class="argref" href="#para">para</a> is the value of the constant <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>c</mi>
</math>.</div>
<div class="paramtext"><i>On exit</i>: the input estimates are unaltered except that any <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>&#969;</mi>
</math>&#160;estimates corresponding to a simple input will be undated by a single iteration.</div>
</dd><dt class="paramhead"><a name="npara" id="npara"/>5:
 &#160;&#160;&#8194;
 <b>npara</b> &#8211; Integer&#160;<span class="pclass">Input</span></dt><dd>
<div class="paramtext"><i>On entry</i>: the exact number of <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>&#981;</mi>
</math>, <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>&#952;</mi>
</math>, <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>&#934;</mi>
</math>, <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>&#920;</mi>
</math>, <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>&#969;</mi>
</math>, <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>&#948;</mi>
</math>, <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>c</mi>
</math>&#160;parameters, so that <math xmlns="http://www.w3.org/1998/Math/MathML">
 <maction actiontype="link" dsi:href="#npara" dsi:type="simple"><mi mathcolor="#EE0000" mathvariant="bold">npara</mi></maction>
 <mo>=</mo>
 <mi>p</mi>
 <mo>+</mo>
 <mi>q</mi>
 <mo>+</mo>
 <mi>P</mi>
 <mo>+</mo>
 <mi>Q</mi>
 <mo>+</mo>
 <maction actiontype="link" dsi:href="#nseries" dsi:type="simple"><mi mathcolor="#EE0000" mathvariant="bold">nseries</mi></maction>
 <mo>+</mo>
 <mrow>
  <mo>&#8721;</mo>
  <mfenced separators="">
   <msub>
    <mi>p</mi>
    <mi>i</mi>
   </msub>
   <mo>+</mo>
   <msub>
    <mi>q</mi>
    <mi>i</mi>
   </msub>
  </mfenced>
 </mrow>
</math>, the summation being over all the input series.  (<math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>c</mi>
</math>&#160;must be included whether its value was previously estimated or was set fixed.)</div>
</dd><dt class="paramhead"><a name="nev" id="nev"/>6:
 &#160;&#160;&#8194;
 <b>nev</b> &#8211; Integer&#160;<span class="pclass">Input</span></dt><dd>
<div class="paramtext"><i>On entry</i>: the number of original (undifferenced) values in each of the input and output time-series.</div>
</dd><dt class="paramhead"><a name="nfv" id="nfv"/>7:
 &#160;&#160;&#8194;
 <b>nfv</b> &#8211; Integer&#160;<span class="pclass">Input</span></dt><dd>
<div class="paramtext"><i>On entry</i>: the number of forecast values of the output series required.</div>

<div class="paramtext"><i>Constraint</i>:
  <math xmlns="http://www.w3.org/1998/Math/MathML">
 <maction actiontype="link" dsi:href="#nfv" dsi:type="simple"><mi mathcolor="#EE0000" mathvariant="bold">nfv</mi></maction><mo>&gt;</mo><mn>0</mn>
</math>.</div>
</dd><dt class="paramhead"><a name="xxy" id="xxy"/>8:
 &#160;&#160;&#8194;
 <b>xxy</b>[<math xmlns="http://www.w3.org/1998/Math/MathML"><maction actiontype="link" dsi:href="#nev" dsi:type="simple"><mi mathcolor="#EE0000" mathvariant="bold">nev</mi></maction><mo>+</mo><maction actiontype="link" dsi:href="#nfv" dsi:type="simple"><mi mathcolor="#EE0000" mathvariant="bold">nfv</mi></maction></math>][<a class="argref" href="#tdxxy">tdxxy</a>] &#8211; const&#160;double&#160;<span class="pclass">Input</span></dt><dd>
<div class="paramtext"><i>On entry</i>: the columns of <a class="argref" href="#xxy">xxy</a> must contain in the first <a class="argref" href="#nev">nev</a> places, the past values of each of the input and output series, in that order.  In the next <a class="argref" href="#nfv">nfv</a> places, the columns relating to the input series (i.e., columns 0 to <math xmlns="http://www.w3.org/1998/Math/MathML">
 <maction actiontype="link" dsi:href="#nseries" dsi:type="simple"><mi mathcolor="#EE0000" mathvariant="bold">nseries</mi></maction><mo>-</mo><mn>2</mn>
</math>) contain the future values of the input series which are necessary for construction of the forecasts of the output series <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>y</mi>
</math>.</div>
</dd><dt class="paramhead"><a name="tdxxy" id="tdxxy"/>9:
 &#160;&#160;&#8194;
 <b>tdxxy</b> &#8211; Integer&#160;<span class="pclass">Input</span></dt><dd>
<div class="paramtext"><i>On entry</i>: the second dimension of the array <a class="argref" href="#xxy">xxy</a> as declared in the subroutine from which nag_tsa_multi_inp_model_forecast (g13bjc) is called.</div>

<div class="paramtext"><i>Constraint</i>:
  <math xmlns="http://www.w3.org/1998/Math/MathML">
 <maction actiontype="link" dsi:href="#tdxxy" dsi:type="simple"><mi mathcolor="#EE0000" mathvariant="bold">tdxxy</mi></maction><mo>&#8805;</mo><maction actiontype="link" dsi:href="#nseries" dsi:type="simple"><mi mathcolor="#EE0000" mathvariant="bold">nseries</mi></maction>
</math>.</div>
</dd><dt class="paramhead"><a name="rmsxy" id="rmsxy"/>10:
 &#8194;
 <b>rmsxy</b>[<a class="argref" href="#nseries">nseries</a>] &#8211; double&#160;<span class="pclass">Input/Output</span></dt><dd>
<div class="paramtext"><i>On entry</i>: elements of <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mrow><mrow><maction actiontype="link" dsi:href="#rmsxy" dsi:type="simple"><mi mathcolor="#EE0000" mathvariant="bold">rmsxy</mi></maction><mfenced open="[" close="]"><mn>0</mn></mfenced></mrow></mrow>
</math>&#160;to <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mrow><mrow><maction actiontype="link" dsi:href="#rmsxy" dsi:type="simple"><mi mathcolor="#EE0000" mathvariant="bold">rmsxy</mi></maction><mfenced open="[" close="]"><mrow><maction actiontype="link" dsi:href="#nseries" dsi:type="simple"><mi mathcolor="#EE0000" mathvariant="bold">nseries</mi></maction><mo>-</mo><mn>2</mn></mrow></mfenced></mrow></mrow>
</math>&#160;must contain the estimated residual variance of the input series ARIMA models.  In the case of those inputs for which no ARIMA model is available or its effects are to be excluded in the calculation of forecast standard errors, the corresponding entry of <a class="argref" href="#rmsxy">rmsxy</a> should be set to 0.</div>
<div class="paramtext"><i>On exit</i>: <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mrow><mrow><maction actiontype="link" dsi:href="#rmsxy" dsi:type="simple"><mi mathcolor="#EE0000" mathvariant="bold">rmsxy</mi></maction><mfenced open="[" close="]"><mrow><maction actiontype="link" dsi:href="#nseries" dsi:type="simple"><mi mathcolor="#EE0000" mathvariant="bold">nseries</mi></maction><mo>-</mo><mn>1</mn></mrow></mfenced></mrow></mrow>
</math>&#160;contains the estimated residual variance of the output noise ARIMA model which is calculated from the supplied series.  Otherwise <a class="argref" href="#rmsxy">rmsxy</a> is unchanged.</div>
</dd><dt class="paramhead"><a name="mrx" id="mrx"/>11:
 &#8194;
 <b>mrx</b>[<math xmlns="http://www.w3.org/1998/Math/MathML"><mn>7</mn></math>][<a class="argref" href="#tdmrx">tdmrx</a>] &#8211; const&#160;Integer&#160;<span class="pclass">Input</span></dt><dd>
<div class="paramtext"><i>On entry</i>: the orders array for each of the input series ARIMA models.  Thus, column <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>i</mi><mo>-</mo><mn>1</mn>
</math>&#160;contains values of <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>p</mi>
</math>, <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>d</mi>
</math>, <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>q</mi>
</math>, <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>P</mi>
</math>, <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>D</mi>
</math>, <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>Q</mi>
</math>, <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>s</mi>
</math>&#160;for input series <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>i</mi>
</math>.  In the case of those inputs for which no ARIMA model is available, the corresponding orders should be set to 0.
<div class="paramtext">If there are no input series then the null pointer (Integer *)0 may be supplied in place of <a class="argref" href="#mrx">mrx</a>.</div>
</div>
</dd><dt class="paramhead"><a name="tdmrx" id="tdmrx"/>12:
 &#8194;
 <b>tdmrx</b> &#8211; Integer&#160;<span class="pclass">Input</span></dt><dd>
<div class="paramtext"><i>On entry</i>: the second dimension of the array <a class="argref" href="#mrx">mrx</a> as declared in the subroutine from which nag_tsa_multi_inp_model_forecast (g13bjc) is called.</div>

<div class="paramtext"><i>Constraint</i>:
  <math xmlns="http://www.w3.org/1998/Math/MathML">
 <maction actiontype="link" dsi:href="#tdmrx" dsi:type="simple"><mi mathcolor="#EE0000" mathvariant="bold">tdmrx</mi></maction>
 <mo>&#8805;</mo>
 <maction actiontype="link" dsi:href="#nseries" dsi:type="simple"><mi mathcolor="#EE0000" mathvariant="bold">nseries</mi></maction>
 <mo>-</mo>
 <mn>1</mn>
</math>.</div>
</dd><dt class="paramhead"><a name="parx" id="parx"/>13:
 &#8194;
 <b>parx</b>[<a class="argref" href="#ldparx">ldparx</a>][<a class="argref" href="#tdparx">tdparx</a>] &#8211; const&#160;double&#160;<span class="pclass">Input</span></dt><dd>
<div class="paramtext"><i>On entry</i>: values of the parameters (<math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>&#981;</mi>
</math>, <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>&#952;</mi>
</math>, <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>&#934;</mi>
</math>, and <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>&#920;</mi>
</math>) for each of the input series ARIMA models.  Thus column <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>i</mi>
</math>&#160;contains <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mrow><mrow><maction actiontype="link" dsi:href="#mrx" dsi:type="simple"><mi mathcolor="#EE0000" mathvariant="bold">mrx</mi></maction><mfenced open="[" close="]"><mn>0</mn></mfenced><mfenced open="[" close="]"><mi>i</mi></mfenced></mrow></mrow>
</math>&#160;values of <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>&#981;</mi>
</math>, <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mrow><mrow><maction actiontype="link" dsi:href="#mrx" dsi:type="simple"><mi mathcolor="#EE0000" mathvariant="bold">mrx</mi></maction><mfenced open="[" close="]"><mn>2</mn></mfenced><mfenced open="[" close="]"><mi>i</mi></mfenced></mrow></mrow>
</math>&#160;values of <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>&#952;</mi>
</math>, <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mrow><mrow><maction actiontype="link" dsi:href="#mrx" dsi:type="simple"><mi mathcolor="#EE0000" mathvariant="bold">mrx</mi></maction><mfenced open="[" close="]"><mn>3</mn></mfenced><mfenced open="[" close="]"><mi>i</mi></mfenced></mrow></mrow>
</math>&#160;values of <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>&#934;</mi>
</math>&#160;and <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mrow><mrow><maction actiontype="link" dsi:href="#mrx" dsi:type="simple"><mi mathcolor="#EE0000" mathvariant="bold">mrx</mi></maction><mfenced open="[" close="]"><mn>5</mn></mfenced><mfenced open="[" close="]"><mi>i</mi></mfenced></mrow></mrow>
</math>&#160;values of <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>&#920;</mi>
</math>&#160;&#8211; in that order.
<div class="paramtext">Values in the columns relating to those input series for which no ARIMA model is available are ignored.</div>
<div class="paramtext">If there are no input series then the null pointer (double *)0 may be supplied in place of <a class="argref" href="#parx">parx</a>.</div>
</div>
</dd><dt class="paramhead"><a name="ldparx" id="ldparx"/>14:
 &#8194;
 <b>ldparx</b> &#8211; Integer&#160;<span class="pclass">Input</span></dt><dd>
<div class="paramtext"><i>On entry</i>: the maximum number of parameters in any of the input series ARIMA models.  If there are no input series then <a class="argref" href="#ldparx">ldparx</a> is not referenced.</div>

<div class="paramtext"><i>Constraint</i>:
  <math xmlns="http://www.w3.org/1998/Math/MathML">
   <maction actiontype="link" dsi:href="#ldparx" dsi:type="simple"><mi mathcolor="#EE0000" mathvariant="bold">ldparx</mi></maction>
   <mo>&#8805;</mo>
   <mrow><mi>n</mi><mi>c</mi><mi>e</mi></mrow>
   <mo>=</mo>
   <mrow><mi>max</mi><mo>&#8289;</mo><mfenced separators=""><mn>1</mn><mo>,</mo><mfenced separators="">
      <mrow><mrow><maction actiontype="link" dsi:href="#mrx" dsi:type="simple"><mi mathcolor="#EE0000" mathvariant="bold">mrx</mi></maction><mfenced open="[" close="]"><mn>0</mn></mfenced><mfenced open="[" close="]"><mi>i</mi></mfenced></mrow></mrow>
      <mo>+</mo>
      <mrow><mrow><maction actiontype="link" dsi:href="#mrx" dsi:type="simple"><mi mathcolor="#EE0000" mathvariant="bold">mrx</mi></maction><mfenced open="[" close="]"><mn>2</mn></mfenced><mfenced open="[" close="]"><mi>i</mi></mfenced></mrow></mrow>
      <mo>+</mo>
      <mrow><mrow><maction actiontype="link" dsi:href="#mrx" dsi:type="simple"><mi mathcolor="#EE0000" mathvariant="bold">mrx</mi></maction><mfenced open="[" close="]"><mn>3</mn></mfenced><mfenced open="[" close="]"><mi>i</mi></mfenced></mrow></mrow>
      <mo>+</mo>
      <mrow><mrow><maction actiontype="link" dsi:href="#mrx" dsi:type="simple"><mi mathcolor="#EE0000" mathvariant="bold">mrx</mi></maction><mfenced open="[" close="]"><mn>5</mn></mfenced><mfenced open="[" close="]"><mi>i</mi></mfenced></mrow></mrow>
     </mfenced></mfenced></mrow>
  </math>, for <math xmlns="http://www.w3.org/1998/Math/MathML"><mi mathvariant="italic">i</mi><mo>=</mo><mn>0</mn><mo>,</mo><mn>1</mn><mo>,</mo><mo>&#8230;</mo><mo>,</mo><mrow><maction actiontype="link" dsi:href="#nseries" dsi:type="simple"><mi mathcolor="#EE0000" mathvariant="bold">nseries</mi></maction><mo>-</mo><mn>1</mn></mrow></math>.</div>
</dd><dt class="paramhead"><a name="tdparx" id="tdparx"/>15:
 &#8194;
 <b>tdparx</b> &#8211; Integer&#160;<span class="pclass">Input</span></dt><dd>
<div class="paramtext"><i>On entry</i>: the second dimension of the array <a class="argref" href="#parx">parx</a> as declared in the subroutine from which nag_tsa_multi_inp_model_forecast (g13bjc) is called.</div>

<div class="paramtext"><i>Constraint</i>:
  <math xmlns="http://www.w3.org/1998/Math/MathML">
 <maction actiontype="link" dsi:href="#tdparx" dsi:type="simple"><mi mathcolor="#EE0000" mathvariant="bold">tdparx</mi></maction>
 <mo>&#8805;</mo>
 <maction actiontype="link" dsi:href="#nseries" dsi:type="simple"><mi mathcolor="#EE0000" mathvariant="bold">nseries</mi></maction>
 <mo>-</mo>
 <mn>1</mn>
</math>.</div>
</dd><dt class="paramhead"><a name="fva" id="fva"/>16:
 &#8194;
 <b>fva</b>[<a class="argref" href="#nfv">nfv</a>] &#8211; double&#160;<span class="pclass">Output</span></dt><dd>
<div class="paramtext"><i>On exit</i>: the required forecast values for the output series.</div>
</dd><dt class="paramhead"><a name="fsd" id="fsd"/>17:
 &#8194;
 <b>fsd</b>[<a class="argref" href="#nfv">nfv</a>] &#8211; double&#160;<span class="pclass">Output</span></dt><dd>
<div class="paramtext"><i>On exit</i>: the standard errors for each of the forecast values.</div>
</dd><dt class="paramhead"><a name="options" id="options"/>18:
 &#8194;
 <b>options</b> &#8211; Nag_G13_Opt&#160;*<span class="pclass">Input/Output</span></dt><dd>
<div class="paramtext"><i>On entry/exit</i>: a pointer to a structure of type <b>Nag_G13_Opt</b> whose members are optional parameters for nag_tsa_multi_inp_model_forecast (g13bjc).  If the optional parameters are not required, then the null pointer, <span class="mono">G13_DEFAULT</span>, can be used in the function call tonag_tsa_multi_inp_model_forecast (g13bjc).  Details of the optional parameters and their types are given below in Section <a class="secref" href="#optparams">10</a>.</div>
</dd><dt class="paramhead"><a name="fail" id="fail"/>19:
 &#8194;
 <b>fail</b> &#8211; NagError&#160;*<span class="pclass">Input/Output</span></dt><dd>
<div class="paramtext">The NAG error parameter, see the <a class="secref" href="../genint/essint.xml">Essential Introduction</a>.</div>
</dd></dl>





<h2><a name="errors" id="errors"/>6&#160;&#160;Error Indicators and Warnings</h2>


<dl>


<dt class="errorhead"><a name="NE_G13_OPTIONS_NOT_INIT" id="NE_G13_OPTIONS_NOT_INIT"/><b>NE_G13_OPTIONS_NOT_INIT</b></dt>
<dd style="margin-top: .2em;">
<div class="paramtext"> On entry, the option structure, <a class="argref" href="#options">options</a>, has not been initialised using <a class="rtnref" href="../G13/g13bxc.xml">nag_tsa_options_init (g13bxc)</a>.
</div>
</dd>


<dt class="errorhead"><a name="NE_G13_ORDERS_NOT_INIT" id="NE_G13_ORDERS_NOT_INIT"/><b>NE_G13_ORDERS_NOT_INIT</b></dt>
<dd style="margin-top: .2em;">
<div class="paramtext"> On entry, the orders array structure <a class="argref" href="#transfv">transfv</a> in function <a class="rtnref" href="../G13/g13byc.xml">nag_tsa_transf_orders (g13byc)</a> has not been initialised.
</div>
</dd>


<dt class="errorhead"><a name="NE_INT_ARRAY_2" id="NE_INT_ARRAY_2"/><b>NE_INT_ARRAY_2</b></dt>
<dd style="margin-top: .2em;">
<div class="paramtext"> Value <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mfenced open="&#9001;" close="&#9002;" separators=""><mtext mathvariant="italic">value</mtext></mfenced></math>&#160;given to <math xmlns="http://www.w3.org/1998/Math/MathML">
 <maction actiontype="link" dsi:href="#transfv" dsi:type="simple"><mi mathcolor="#EE0000" mathvariant="bold">transfv</mi></maction>
 <mo>.</mo>
 <mrow><mrow><maction actiontype="link" dsi:href="#r" dsi:type="simple"><mi mathcolor="#FF00FF" mathvariant="bold">r</mi></maction><mfenced open="[" close="]"><mfenced open="&#9001;" close="&#9002;" separators=""><mtext mathvariant="italic">value</mtext></mfenced></mfenced></mrow></mrow>
</math>&#160;not valid.  Correct range for elements if <a class="argref" href="#transfv">transfv</a>.<a class="memberref" href="#transfv_r">r</a> is <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mn>1</mn>
 <mo>&#8804;</mo>
 <mrow><mrow><maction actiontype="link" dsi:href="#r" dsi:type="simple"><mi mathcolor="#FF00FF" mathvariant="bold">r</mi></maction><mfenced open="[" close="]"><mi>i</mi></mfenced></mrow></mrow>
 <mo>&#8804;</mo>
 <mn>3</mn>
</math>.
</div>
</dd>


<dt class="errorhead"><a name="NE_BAD_PARAM" id="NE_BAD_PARAM"/><b>NE_BAD_PARAM</b></dt>
<dd style="margin-top: .2em;">
<div class="paramtext"> On entry, parameter <a class="optparamref" href="#optparam_cfixed">options.cfixed</a> had an illegal value.
</div>
</dd>


<dt class="errorhead"><a name="NE_INT_ARG_LT" id="NE_INT_ARG_LT"/><b>NE_INT_ARG_LT</b></dt>
<dd style="margin-top: .2em;">
<div class="paramtext"> On entry, <a class="argref" href="#nseries">nseries</a> must not be less than 1: <math xmlns="http://www.w3.org/1998/Math/MathML">
 <maction actiontype="link" dsi:href="#nseries" dsi:type="simple"><mi mathcolor="#EE0000" mathvariant="bold">nseries</mi></maction><mo>=</mo><mfenced open="&#9001;" close="&#9002;" separators=""><mtext mathvariant="italic">value</mtext></mfenced>
</math>.
</div>
</dd>


<dt class="errorhead"><a name="NE_INT_ARG_LE" id="NE_INT_ARG_LE"/><b>NE_INT_ARG_LE</b></dt>
<dd style="margin-top: .2em;">
<div class="paramtext"> On entry, <a class="argref" href="#nfv">nfv</a> must not be less than or equal to 0: <math xmlns="http://www.w3.org/1998/Math/MathML">
 <maction actiontype="link" dsi:href="#nfv" dsi:type="simple"><mi mathcolor="#EE0000" mathvariant="bold">nfv</mi></maction><mo>=</mo><mfenced open="&#9001;" close="&#9002;" separators=""><mtext mathvariant="italic">value</mtext></mfenced>
</math>.
</div>
</dd>


<dt class="errorhead"><a name="NE_2_INT_ARG_LT" id="NE_2_INT_ARG_LT"/><b>NE_2_INT_ARG_LT</b></dt>
<dd style="margin-top: .2em;">
<div class="paramtext"> On entry, <math xmlns="http://www.w3.org/1998/Math/MathML">
 <maction actiontype="link" dsi:href="#tdxxy" dsi:type="simple"><mi mathcolor="#EE0000" mathvariant="bold">tdxxy</mi></maction><mo>=</mo><mfenced open="&#9001;" close="&#9002;" separators=""><mtext mathvariant="italic">value</mtext></mfenced>
</math>&#160;while <math xmlns="http://www.w3.org/1998/Math/MathML">
 <maction actiontype="link" dsi:href="#nseries" dsi:type="simple"><mi mathcolor="#EE0000" mathvariant="bold">nseries</mi></maction><mo>=</mo><mfenced open="&#9001;" close="&#9002;" separators=""><mtext mathvariant="italic">value</mtext></mfenced>
</math>.  These parameters must satisfy <math xmlns="http://www.w3.org/1998/Math/MathML">
 <maction actiontype="link" dsi:href="#tdxxy" dsi:type="simple"><mi mathcolor="#EE0000" mathvariant="bold">tdxxy</mi></maction><mo>&#8805;</mo><maction actiontype="link" dsi:href="#nseries" dsi:type="simple"><mi mathcolor="#EE0000" mathvariant="bold">nseries</mi></maction>
</math>.  <br/>
On entry, <math xmlns="http://www.w3.org/1998/Math/MathML">
 <maction actiontype="link" dsi:href="#tdmrx" dsi:type="simple"><mi mathcolor="#EE0000" mathvariant="bold">tdmrx</mi></maction><mo>=</mo><mfenced open="&#9001;" close="&#9002;" separators=""><mtext mathvariant="italic">value</mtext></mfenced>
</math>&#160;while <math xmlns="http://www.w3.org/1998/Math/MathML">
 <maction actiontype="link" dsi:href="#nseries" dsi:type="simple"><mi mathcolor="#EE0000" mathvariant="bold">nseries</mi></maction>
 <mo>-</mo>
 <mn>1</mn>
 <mo>=</mo>
 <mfenced open="&#9001;" close="&#9002;" separators=""><mtext mathvariant="italic">value</mtext></mfenced></math>.  These parameters must satisfy <math xmlns="http://www.w3.org/1998/Math/MathML">
 <maction actiontype="link" dsi:href="#tdmrx" dsi:type="simple"><mi mathcolor="#EE0000" mathvariant="bold">tdmrx</mi></maction>
 <mo>&#8805;</mo>
 <maction actiontype="link" dsi:href="#nseries" dsi:type="simple"><mi mathcolor="#EE0000" mathvariant="bold">nseries</mi></maction>
 <mo>-</mo>
 <mn>1</mn>
</math>.  <br/>
On entry, <math xmlns="http://www.w3.org/1998/Math/MathML">
 <maction actiontype="link" dsi:href="#ldparx" dsi:type="simple"><mi mathcolor="#EE0000" mathvariant="bold">ldparx</mi></maction><mo>=</mo><mfenced open="&#9001;" close="&#9002;" separators=""><mtext mathvariant="italic">value</mtext></mfenced>
</math>&#160;while <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mrow><mi>n</mi><mi>c</mi><mi>e</mi></mrow>
 <mo>=</mo>
 <mfenced open="&#9001;" close="&#9002;" separators=""><mtext mathvariant="italic">value</mtext></mfenced></math>.  These parameters must satisfy <math xmlns="http://www.w3.org/1998/Math/MathML">
 <maction actiontype="link" dsi:href="#ldparx" dsi:type="simple"><mi mathcolor="#EE0000" mathvariant="bold">ldparx</mi></maction>
 <mo>&#8805;</mo>
 <mrow><mi>n</mi><mi>c</mi><mi>e</mi></mrow>
</math>.  (See the expression for <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mrow><mi>n</mi><mi>c</mi><mi>e</mi></mrow>
</math>&#160;in Section <a class="secref" href="#parameters">5</a> where <a class="argref" href="#ldparx">ldparx</a> is described).  <br/>
On entry, <math xmlns="http://www.w3.org/1998/Math/MathML">
 <maction actiontype="link" dsi:href="#tdparx" dsi:type="simple"><mi mathcolor="#EE0000" mathvariant="bold">tdparx</mi></maction><mo>=</mo><mfenced open="&#9001;" close="&#9002;" separators=""><mtext mathvariant="italic">value</mtext></mfenced>
</math>&#160;while <math xmlns="http://www.w3.org/1998/Math/MathML">
 <maction actiontype="link" dsi:href="#nseries" dsi:type="simple"><mi mathcolor="#EE0000" mathvariant="bold">nseries</mi></maction>
 <mo>-</mo>
 <mn>1</mn>
 <mo>=</mo>
 <mfenced open="&#9001;" close="&#9002;" separators=""><mtext mathvariant="italic">value</mtext></mfenced></math>.These parameters must satisfy <math xmlns="http://www.w3.org/1998/Math/MathML">
 <maction actiontype="link" dsi:href="#tdparx" dsi:type="simple"><mi mathcolor="#EE0000" mathvariant="bold">tdparx</mi></maction>
 <mo>&#8805;</mo>
 <maction actiontype="link" dsi:href="#nseries" dsi:type="simple"><mi mathcolor="#EE0000" mathvariant="bold">nseries</mi></maction>
 <mo>-</mo>
 <mn>1</mn>
</math>.
</div>
</dd>


<dt class="errorhead"><a name="NE_ALLOC_FAIL" id="NE_ALLOC_FAIL"/><b>NE_ALLOC_FAIL</b></dt>
<dd style="margin-top: .2em;">
<div class="paramtext"> Memory allocation failed.
</div>
</dd>


<dt class="errorhead"><a name="NE_INVALID_NSER" id="NE_INVALID_NSER"/><b>NE_INVALID_NSER</b></dt>
<dd style="margin-top: .2em;">
<div class="paramtext"> On entry, <math xmlns="http://www.w3.org/1998/Math/MathML">
 <maction actiontype="link" dsi:href="#nseries" dsi:type="simple"><mi mathcolor="#EE0000" mathvariant="bold">nseries</mi></maction><mo>=</mo><mn>1</mn>
</math>&#160;and there are no parameters in the model, i.e., (<math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>p</mi>
 <mo>=</mo>
 <mi>q</mi>
 <mo>=</mo>
 <mi>P</mi>
 <mo>=</mo>
 <mi>Q</mi>
 <mo>=</mo>
 <mn>0</mn>
</math>&#160;and <math xmlns="http://www.w3.org/1998/Math/MathML">
 <maction actiontype="link" dsi:href="#optparam_cfixed" dsi:type="simple"><mi mathcolor="#800080" mathvariant="bold">options.cfixed</mi></maction><mo>=</mo><mi mathvariant="bold">TRUE</mi>
</math>).
</div>
</dd>


<dt class="errorhead"><a name="NE_NSER_INCONSIST" id="NE_NSER_INCONSIST"/><b>NE_NSER_INCONSIST</b></dt>
<dd style="margin-top: .2em;">
<div class="paramtext"> Value of <a class="argref" href="#nseries">nseries</a> passed to <a class="rtnref" href="../G13/g13byc.xml">nag_tsa_transf_orders (g13byc)</a> was <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mfenced open="&#9001;" close="&#9002;" separators=""><mtext mathvariant="italic">value</mtext></mfenced></math>&#160;which is not equal to the value <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mfenced open="&#9001;" close="&#9002;" separators=""><mtext mathvariant="italic">value</mtext></mfenced></math>&#160;passed in this function.
</div>
</dd>


<dt class="errorhead"><a name="NE_NPARA_MR_MT_INCONSIST" id="NE_NPARA_MR_MT_INCONSIST"/><b>NE_NPARA_MR_MT_INCONSIST</b></dt>
<dd style="margin-top: .2em;">
<div class="paramtext"> On entry, there is inconsistency between <a class="argref" href="#npara">npara</a> on the one hand and the elements in the orders structures, <a class="argref" href="#arimav">arimav</a> and <a class="argref" href="#transfv">transfv</a> on the other.
</div>
</dd>


<dt class="errorhead"><a name="NE_DELTA_TEST_FAILED" id="NE_DELTA_TEST_FAILED"/><b>NE_DELTA_TEST_FAILED</b></dt>
<dd style="margin-top: .2em;">
<div class="paramtext"> On entry, or during execution, one or more sets of <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>&#948;</mi>
</math>&#160;parameters do not satisfy the stationarity or invertibility test conditions.
</div>
</dd>


<dt class="errorhead"><a name="NE_SOLUTION_FAIL_CONV" id="NE_SOLUTION_FAIL_CONV"/><b>NE_SOLUTION_FAIL_CONV</b></dt>
<dd style="margin-top: .2em;">
<div class="paramtext"> Iterative refinement has failed to improve the solution of the equations giving the latest estimates of the parameters.  This occurred because the matrix of the set of equations is too ill-conditioned.
</div>
</dd>


<dt class="errorhead"><a name="NE_MAT_NOT_POS_DEF" id="NE_MAT_NOT_POS_DEF"/><b>NE_MAT_NOT_POS_DEF</b></dt>
<dd style="margin-top: .2em;">
<div class="paramtext"> Attempt to invert the second derivative matrix needed in the calculation of the covariance matrix of the parameter estimates has failed.  The matrix is not positive-definite, possibly due to rounding errors.
</div>
</dd>


<dt class="errorhead"><a name="NE_ARIMA_TEST_FAILED" id="NE_ARIMA_TEST_FAILED"/><b>NE_ARIMA_TEST_FAILED</b></dt>
<dd style="margin-top: .2em;">
<div class="paramtext"> On entry, or during execution, one or more sets of the ARIMA (<math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>&#981;</mi>
</math>, <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>&#952;</mi>
</math>, <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>&#934;</mi>
</math>&#160;or <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>&#920;</mi>
</math>) parameters do not satisfy the stationarity or invertibility test conditions.
</div>
</dd>


<dt class="errorhead"><a name="NE_INTERNAL_ERROR" id="NE_INTERNAL_ERROR"/><b>NE_INTERNAL_ERROR</b></dt>
<dd style="margin-top: .2em;">
<div class="paramtext"> An internal error has occurred in this function.  Check the function call and any array sizes.  If the call is correct then please consult NAG for assistance.
</div>
</dd>


</dl>






<h2><a name="accuracy" id="accuracy"/>7&#160;&#160;Accuracy</h2>

<div class="paramtext">The computation used is believed to be stable.</div>





<h2><a name="fcomments" id="fcomments"/>8&#160;&#160;Further Comments</h2>

<div class="paramtext">The time taken by nag_tsa_multi_inp_model_forecast (g13bjc) is approximately proportional to the product of the length of each series and the square of the number of parameters in the multi-input model.</div>




<h2><a name="g13bjcsec8" id="g13bjcsec8"/>9&#160;&#160;Example</h2>

<div class="paramtext">This example illustrates the use of the default option <span class="mono">G13_DEFAULT</span> in a call to nag_tsa_multi_inp_model_forecast (g13bjc).  An example showing the use of optional parameters is given in Section <a class="secref" href="#g13bjcsec10">11</a>.  There is one example program file, the main program of which calls both examples.  The main program is given below.</div>


<h3><a name="g13bjcsec81" id="g13bjcsec81"/>9.1&#160;&#160;Example 1</h3>

<div class="paramtext">This example illustrates the use of the default option <span class="mono">G13_DEFAULT</span> in a call to nag_tsa_multi_inp_model_forecast (g13bjc).</div>
<div class="paramtext">The data in the example relate to 40 observations of an output time series and 5 input time series.  This example differs from Example 1 in <a class="rtnref" href="../G13/g13bec.xml">nag_tsa_multi_inp_model_estim (g13bec)</a> in that there are now 4 simple input series.  The output series has one autoregressive <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mfenced separators=""><mi>&#981;</mi></mfenced>
</math>&#160;parameter and one seasonal moving average <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mfenced separators=""><mi>&#920;</mi></mfenced>
</math>&#160;parameter.  The seasonal period is 4.  The transfer function input (the fifth in the set) is defined by orders <math xmlns="http://www.w3.org/1998/Math/MathML">
 <msub>
  <mi>b</mi>
  <mn>5</mn>
 </msub>
 <mo>=</mo>
 <mn>1</mn>
</math>, <math xmlns="http://www.w3.org/1998/Math/MathML">
 <msub>
  <mi>q</mi>
  <mn>5</mn>
 </msub>
 <mo>=</mo>
 <mn>0</mn>
</math>, <math xmlns="http://www.w3.org/1998/Math/MathML">
 <msub>
  <mi>p</mi>
  <mn>5</mn>
 </msub>
 <mo>=</mo>
 <mn>1</mn>
</math>, <math xmlns="http://www.w3.org/1998/Math/MathML">
 <msub>
  <mi>r</mi>
  <mn>5</mn>
 </msub>
 <mo>=</mo>
 <mn>3</mn>
</math>, so that it allows for pre-observation period effects.  The initial values of the specified model are:
</div>
<div class="formula"><table class="formula"><tr><td class="formula"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
 <mtable>
  <mtr>
   <mtd>
    <mi>&#981;</mi>
    <mo>=</mo>
    <mn>0.495</mn>
    <mtext>,&#160;</mtext>
    <mi>&#920;</mi>
    <mo>=</mo>
    <mn>0.238</mn>
    <mtext>,</mtext>
    <msub>
     <mi>&#969;</mi>
     <mn>1</mn>
    </msub>
    <mo>=</mo>
    <mrow><mo>-</mo><mn>0.367</mn></mrow>
    <mtext>&#8195;</mtext>
    <mrow><mi>&#969;</mi><mn>2</mn></mrow>
    <mo>=</mo>
    <mrow><mo>-</mo><mn>3.876</mn></mrow>
    <mtext>&#8195;</mtext>
    <msub>
     <mi>&#969;</mi>
     <mn>3</mn>
    </msub>
    <mo>=</mo>
    <mn>4.516</mn>
   </mtd>
  </mtr>
  <mtr>
   <mtd>
    <msub>
     <mi>&#969;</mi>
     <mn>4</mn>
    </msub>
    <mo>=</mo>
    <mn>2.474</mn>
    <mtext>&#8195;</mtext>
    <msub>
     <mi>&#969;</mi>
     <mrow><mn>5</mn><mo>,</mo><mn>1</mn></mrow>
    </msub>
    <mo>=</mo>
    <mn>8.629</mn>
    <mtext>&#8195;</mtext>
    <msub>
     <mi>&#948;</mi>
     <mrow><mn>5</mn><mo>,</mo><mn>1</mn></mrow>
    </msub>
    <mo>=</mo>
    <mn>0.688</mn>
    <mtext>,&#160;</mtext>
    <mi>c</mi>
    <mo>=</mo>
    <mrow><mo>-</mo><mn>82.858</mn></mrow>
    <mtext>.</mtext>
   </mtd>
  </mtr>
 </mtable>
</math></td><td class="formula2"/></tr></table></div>
<div class="paramtext">
A further 8 values of the input series are supplied, and it is assumed that the values for the fifth series have themselves been forecast from an ARIMA model with orders 2 0 2 0 1 1 4 , in which <math xmlns="http://www.w3.org/1998/Math/MathML">
 <msub>
  <mi>&#981;</mi>
  <mn>1</mn>
 </msub>
 <mo>=</mo>
 <mn>1.6743</mn>
</math>, <math xmlns="http://www.w3.org/1998/Math/MathML">
 <msub>
  <mi>&#981;</mi>
  <mn>2</mn>
 </msub>
 <mo>=</mo>
 <mrow><mo>-</mo><mn>0.9505</mn></mrow>
</math>, <math xmlns="http://www.w3.org/1998/Math/MathML">
 <msub>
  <mi>&#952;</mi>
  <mn>1</mn>
 </msub>
 <mo>=</mo>
 <mn>1.4605</mn>
</math>, <math xmlns="http://www.w3.org/1998/Math/MathML">
 <msub>
  <mi>&#952;</mi>
  <mn>2</mn>
 </msub>
 <mo>=</mo>
 <mrow><mo>-</mo><mn>0.4862</mn></mrow>
</math>&#160;and <math xmlns="http://www.w3.org/1998/Math/MathML">
 <msub>
  <mi>&#920;</mi>
  <mn>1</mn>
 </msub>
 <mo>=</mo>
 <mn>0.8993</mn>
</math>, and for which the residual mean square is 0.1720.</div>
<div class="paramtext">The following are computed and printed out: the estimated residual variance for the output noise series, the 8 forecast values and their standard errors.</div>



<h4><a name="examtext1" id="examtext1"/>9.1.1&#160;&#160;Program Text</h4>
 
<div><a href="../../examples/source/g13bjce.c">Program Text (g13bjce.c)</a></div>





<h4><a name="examdata1" id="examdata1"/>9.1.2&#160;&#160;Program Data</h4>

<div><a href="../../examples/data/g13bjce.d">Program Data (g13bjce.d)</a></div>





<h4><a name="examresults1" id="examresults1"/>9.1.3&#160;&#160;Program Results</h4>

<div><a href="../../examples/baseresults/g13bjce.r">Program Results (g13bjce.r)</a></div>






<h2><a name="optparams" id="optparams"/>10&#160;&#160;Optional Parameters</h2>

<div class="paramtext">A number of optional input and output parameters to nag_tsa_multi_inp_model_forecast (g13bjc) are available through the structure argument <a class="argref" href="#options">options</a> of type <b>Nag_G13_Opt</b>.  A parameter may be selected by assigning an appropriate value to the relevant structure member and those parameters not selected will be assigned default values.  If no use is to be made of any of the optional parameters the user should use the null pointer, <span class="mono">G13_DEFAULT</span>, in place of <a class="argref" href="#options">options</a> when calling nag_tsa_multi_inp_model_forecast (g13bjc); the default settings will then be used for all parameters.</div>
<div class="paramtext">Before assigning values to <a class="argref" href="#options">options</a> the structure must be initialised by a call to the function <a class="rtnref" href="../G13/g13bxc.xml">nag_tsa_options_init (g13bxc)</a>.  Values may then be assigned directly to the structure members in the normal C manner.</div>
<div class="paramtext">Options selected by direct assignment are checked within nag_tsa_multi_inp_model_forecast (g13bjc) for being within the required range, if outside the range, an error message is generated.</div>
<div class="paramtext">When all calls to nag_tsa_multi_inp_model_forecast (g13bjc) have been completed and the results contained in the options structure are no longer required; then <a class="rtnref" href="../G13/g13xzc.xml">nag_tsa_free (g13xzc)</a> should be called to free the NAG allocated memory from <a class="argref" href="#options">options</a>.</div>


<h3><a name="g13bjcsec91" id="g13bjcsec91"/>10.1&#160;&#160;Optional Parameters Checklist and Default Values</h3>

<div class="paramtext">For easy reference, the following list shows the input and output members of <a class="argref" href="#options">options</a> which are valid for nag_tsa_multi_inp_model_forecast (g13bjc) together with their default values where relevant.
</div><table><tr>
<td style="width:15em;" valign="top"><span class="mono">Boolean list</span></td>
<td valign="top"><b>TRUE</b></td>
</tr><tr>
<td style="width:15em;" valign="top"><span class="mono">Boolean cfixed</span></td>
<td valign="top"><b>FALSE</b></td>
</tr><tr>
<td style="width:15em;" valign="top"><span class="mono">double *zt</span></td>
<td valign="top"/>
</tr><tr>
<td style="width:15em;" valign="top"><span class="mono">double *noise</span></td>
<td valign="top"/>
</tr></table><div class="paramtext">
</div>




<h3><a name="op-description" id="op-description"/>10.2&#160;&#160;Description of Optional Parameters</h3>




<table width="100%" class="optparam"><tr><td class="optparam" style="width:45%" align="left"><a name="optparam_list" id="optparam_list"/><b>list</b> &#8211; 
  Boolean&#160;</td><td class="optparam" align="center"><i>Input</i></td><td class="optparam" style="width:45%" align="right">Default <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mtext/><mo>=</mo><mi mathvariant="bold">TRUE</mi>
</math></td></tr></table>

<div class="paramtext"><i>On entry</i>: if <math xmlns="http://www.w3.org/1998/Math/MathML">
 <maction actiontype="link" dsi:href="#optparam_list" dsi:type="simple"><mi mathcolor="#800080" mathvariant="bold">list</mi></maction><mo>=</mo><mi mathvariant="bold">TRUE</mi>
</math>&#160;then the parameter settings which are used in the call to nag_tsa_multi_inp_model_forecast (g13bjc) will be printed.</div>





<table width="100%" class="optparam"><tr><td class="optparam" style="width:45%" align="left"><a name="optparam_cfixed" id="optparam_cfixed"/><b>cfixed</b> &#8211; 
  Boolean&#160;</td><td class="optparam" align="center"><i>Input</i></td><td class="optparam" style="width:45%" align="right">Default <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mtext/><mo>=</mo><mi mathvariant="bold">FALSE</mi>
</math></td></tr></table>

<div class="paramtext"><i>On entry</i>: <a class="optparamref" href="#optparam_cfixed">cfixed</a> must be set to <b>FALSE</b> if the constant was estimated when the model was fitted, and <b>TRUE</b> if it was held at a fixed value.  This only affects the degrees of freedom used in calculating the estimated residual variance.</div>





<table width="100%" class="optparam"><tr><td class="optparam" style="width:45%" align="left"><a name="optparam_zt" id="optparam_zt"/><b>zt</b> &#8211; 
  double&#160;*</td><td class="optparam" align="center"><i>Output</i></td><td class="optparam" style="width:45%" align="right">Default memory <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mtext/>
 <mo>=</mo>
 <mfenced separators=""><maction actiontype="link" dsi:href="#nev" dsi:type="simple"><mi mathcolor="#EE0000" mathvariant="bold">nev</mi></maction><mo>+</mo><maction actiontype="link" dsi:href="#nfv" dsi:type="simple"><mi mathcolor="#EE0000" mathvariant="bold">nfv</mi></maction></mfenced>
 <mo>&#215;</mo>
 <mfenced separators=""><maction actiontype="link" dsi:href="#nseries" dsi:type="simple"><mi mathcolor="#EE0000" mathvariant="bold">nseries</mi></maction><mo>-</mo><mn>1</mn></mfenced>
</math></td></tr></table>

<div class="paramtext"><i>On exit</i>: this pointer is allocated memory internally with <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mfenced separators=""><maction actiontype="link" dsi:href="#nev" dsi:type="simple"><mi mathcolor="#EE0000" mathvariant="bold">nev</mi></maction><mo>+</mo><maction actiontype="link" dsi:href="#nfv" dsi:type="simple"><mi mathcolor="#EE0000" mathvariant="bold">nfv</mi></maction></mfenced>
 <mo>&#215;</mo>
 <mfenced separators=""><maction actiontype="link" dsi:href="#nseries" dsi:type="simple"><mi mathcolor="#EE0000" mathvariant="bold">nseries</mi></maction><mo>-</mo><mn>1</mn></mfenced>
</math>&#160;elements corresponding to <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mfenced separators=""><maction actiontype="link" dsi:href="#nev" dsi:type="simple"><mi mathcolor="#EE0000" mathvariant="bold">nev</mi></maction><mo>+</mo><maction actiontype="link" dsi:href="#nfv" dsi:type="simple"><mi mathcolor="#EE0000" mathvariant="bold">nfv</mi></maction></mfenced>
</math>&#160;rows by <math xmlns="http://www.w3.org/1998/Math/MathML">
 <maction actiontype="link" dsi:href="#nseries" dsi:type="simple"><mi mathcolor="#EE0000" mathvariant="bold">nseries</mi></maction><mo>-</mo><mn>1</mn>
</math>&#160;columns.  The columns of <a class="optparamref" href="#optparam_zt">zt</a> hold the values of the input component series <math xmlns="http://www.w3.org/1998/Math/MathML">
 <msub>
  <mi>z</mi>
  <mi>t</mi>
 </msub>
</math>.</div>





<table width="100%" class="optparam"><tr><td class="optparam" style="width:45%" align="left"><a name="optparam_noise" id="optparam_noise"/><b>noise</b> &#8211; 
  double&#160;*</td><td class="optparam" align="center"><i>Output</i></td><td class="optparam" style="width:45%" align="right">Default memory <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mtext/>
 <mo>=</mo>
 <maction actiontype="link" dsi:href="#nev" dsi:type="simple"><mi mathcolor="#EE0000" mathvariant="bold">nev</mi></maction>
 <mo>+</mo>
 <maction actiontype="link" dsi:href="#nfv" dsi:type="simple"><mi mathcolor="#EE0000" mathvariant="bold">nfv</mi></maction>
</math></td></tr></table>

<div class="paramtext"><i>On exit</i>: this pointer is allocated memory internally with <math xmlns="http://www.w3.org/1998/Math/MathML">
 <maction actiontype="link" dsi:href="#nev" dsi:type="simple"><mi mathcolor="#EE0000" mathvariant="bold">nev</mi></maction><mo>+</mo><maction actiontype="link" dsi:href="#nfv" dsi:type="simple"><mi mathcolor="#EE0000" mathvariant="bold">nfv</mi></maction>
</math>&#160;elements.  It holds the output noise component <math xmlns="http://www.w3.org/1998/Math/MathML">
 <msub>
  <mi>n</mi>
  <mi>t</mi>
 </msub>
</math>.</div>








<h2><a name="g13bjcsec10" id="g13bjcsec10"/>11&#160;&#160;Example 2</h2>

<div class="paramtext">This example illustrates the use of the <a class="argref" href="#options">options</a> parameter in a call to nag_tsa_multi_inp_model_forecast (g13bjc).</div>
<div class="paramtext">The data in the example relate to the same 40 obervations of an output time series and 5 input time series as in Example 1.  This example differs from Example 2 in <a class="rtnref" href="../G13/g13bec.xml">nag_tsa_multi_inp_model_estim (g13bec)</a> in that there are now 4 simple input series.  The output series has one autoregressive <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mfenced separators=""><mi>&#981;</mi></mfenced>
</math>&#160;parameter and one seasonal moving average <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mfenced separators=""><mi>&#920;</mi></mfenced>
</math>&#160;parameter.  The seasonal period is 4.  The transfer function input (the fifth in the set) is defined by orders <math xmlns="http://www.w3.org/1998/Math/MathML">
 <msub>
  <mi>b</mi>
  <mn>5</mn>
 </msub>
 <mo>=</mo>
 <mn>1</mn>
</math>, <math xmlns="http://www.w3.org/1998/Math/MathML">
 <msub>
  <mi>q</mi>
  <mn>5</mn>
 </msub>
 <mo>=</mo>
 <mn>0</mn>
</math>, <math xmlns="http://www.w3.org/1998/Math/MathML">
 <msub>
  <mi>p</mi>
  <mn>5</mn>
 </msub>
 <mo>=</mo>
 <mn>1</mn>
</math>, <math xmlns="http://www.w3.org/1998/Math/MathML">
 <msub>
  <mi>r</mi>
  <mn>5</mn>
 </msub>
 <mo>=</mo>
 <mn>3</mn>
</math>, so that it allows for pre-observation period effects.  The initial values of the specified model are:
</div>
<div class="formula"><table class="formula"><tr><td class="formula"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
 <mtable>
  <mtr>
   <mtd>
    <mi>&#981;</mi>
    <mo>=</mo>
    <mn>0.495</mn>
    <mtext>,&#160;</mtext>
    <mi>&#920;</mi>
    <mo>=</mo>
    <mn>0.238</mn>
    <mtext>,</mtext>
    <msub>
     <mi>&#969;</mi>
     <mn>1</mn>
    </msub>
    <mo>=</mo>
    <mrow><mo>-</mo><mn>0.367</mn></mrow>
    <mtext>&#8195;</mtext>
    <mrow><mi>&#969;</mi><mn>2</mn></mrow>
    <mo>=</mo>
    <mrow><mo>-</mo><mn>3.876</mn></mrow>
    <mtext>&#8195;</mtext>
    <msub>
     <mi>&#969;</mi>
     <mn>3</mn>
    </msub>
    <mo>=</mo>
    <mn>4.516</mn>
   </mtd>
  </mtr>
  <mtr>
   <mtd>
    <msub>
     <mi>&#969;</mi>
     <mn>4</mn>
    </msub>
    <mo>=</mo>
    <mn>2.474</mn>
    <mtext>&#8195;</mtext>
    <msub>
     <mi>&#969;</mi>
     <mrow><mn>5</mn><mo>,</mo><mn>1</mn></mrow>
    </msub>
    <mo>=</mo>
    <mn>8.629</mn>
    <mtext>&#8195;</mtext>
    <msub>
     <mi>&#948;</mi>
     <mrow><mn>5</mn><mo>,</mo><mn>1</mn></mrow>
    </msub>
    <mo>=</mo>
    <mn>0.688</mn>
    <mtext>,&#160;</mtext>
    <mi>c</mi>
    <mo>=</mo>
    <mrow><mo>-</mo><mn>82.858</mn></mrow>
    <mtext>.</mtext>
   </mtd>
  </mtr>
 </mtable>
</math></td><td class="formula2"/></tr></table></div>
<div class="paramtext">
A further 8 values of the input series are supplied, and it is assumed that the values for the fifth series have themselves been forecast from an ARIMA model with orders 2 0 2 0 1 1 4, in which <math xmlns="http://www.w3.org/1998/Math/MathML">
 <msub>
  <mi>&#981;</mi>
  <mn>1</mn>
 </msub>
 <mo>=</mo>
 <mn>1.6743</mn>
</math>, <math xmlns="http://www.w3.org/1998/Math/MathML">
 <msub>
  <mi>&#981;</mi>
  <mn>2</mn>
 </msub>
 <mo>=</mo>
 <mrow><mo>-</mo><mn>0.9505</mn></mrow>
</math>, <math xmlns="http://www.w3.org/1998/Math/MathML">
 <msub>
  <mi>&#952;</mi>
  <mn>1</mn>
 </msub>
 <mo>=</mo>
 <mn>1.4605</mn>
</math>, <math xmlns="http://www.w3.org/1998/Math/MathML">
 <msub>
  <mi>&#952;</mi>
  <mn>2</mn>
 </msub>
 <mo>=</mo>
 <mrow><mo>-</mo><mn>0.4862</mn></mrow>
</math>&#160;and <math xmlns="http://www.w3.org/1998/Math/MathML">
 <msub>
  <mi>&#920;</mi>
  <mn>1</mn>
 </msub>
 <mo>=</mo>
 <mn>0.8993</mn>
</math>, and for which the residual mean square is 0.1720.</div>
<div class="paramtext">The following are computed and printed out: the estimated residual variance for the output noise series, the 8 forecast values and their standard errors, and the values of the components <math xmlns="http://www.w3.org/1998/Math/MathML">
 <msub>
  <mi>z</mi>
  <mi>t</mi>
 </msub>
</math>&#160;and the output noise component <math xmlns="http://www.w3.org/1998/Math/MathML">
 <msub>
  <mi>n</mi>
  <mi>t</mi>
 </msub>
</math>.</div>



<h3><a name="examtext2" id="examtext2"/>11.1&#160;&#160;Program Text</h3>
 
<div><a href="../../examples/source/g13bjce.c">Program Text (g13bjce.c)</a></div>





<h3><a name="examdata2" id="examdata2"/>11.2&#160;&#160;Program Data</h3>

<div><a href="../../examples/data/g13bjce.d">Program Data (g13bjce.d)</a></div>





<h3><a name="examresults2" id="examresults2"/>11.3&#160;&#160;Program Results</h3>

<div><a href="../../examples/baseresults/g13bjce.r">Program Results (g13bjce.r)</a></div>


<hr/><div><a href="../../pdf/G13/g13bjc.pdf">g13bjc (pdf version)</a></div><div><a href="g13_conts.xml">Chapter Contents</a></div><div><a href="g13_intro.xml">Chapter Introduction</a></div>
<div><a href="../mark7.xml">NAG C Library Contents</a></div>
<div><hr/>
  &#169; The Numerical Algorithms Group Ltd, Oxford, UK. 2004
  </div></body></html>