
<?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 : 
  g13bec</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/g13bec.pdf">g13bec (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_estim (g13bec)</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="htmltoc" onclick="showLevel('tocdescription');"><span class="htmltocplus" id="tocdescriptionplus">+</span><span class="htmltocminus" id="tocdescriptionminus">&#8722;</span></span>
<a class="htmltoc" href="#description">&#160;3&#160;<b>Description</b></a>
<div class="htmltocitem" id="tocdescription">
<div class="htmltoc">
<span class="htmltocplus">&#160;&#160;&#160;</span>
<a class="htmltoc" href="#g13becsec31">&#160;3.1&#160;<b>The Multi-input Model</b></a>
<div class="htmltocitem" id="tocg13becsec31"/>
</div>

<div class="htmltoc">
<span class="htmltocplus">&#160;&#160;&#160;</span>
<a class="htmltoc" href="#g13becsec32">&#160;3.2&#160;<b>The Estimation Criterion</b></a>
<div class="htmltocitem" id="tocg13becsec32"/>
</div>

<div class="htmltoc">
<span class="htmltocplus">&#160;&#160;&#160;</span>
<a class="htmltoc" href="#g13becsec33">&#160;3.3&#160;<b>The Estimation Procedure</b></a>
<div class="htmltocitem" id="tocg13becsec33"/>
</div>

<div class="htmltoc">
<span class="htmltocplus">&#160;&#160;&#160;</span>
<a class="htmltoc" href="#g13becsec34">&#160;3.4&#160;<b>Further Results</b></a>
<div class="htmltocitem" id="tocg13becsec34"/>
</div>
</div>
</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('tocg13becsec8');"><span class="htmltocplus" id="tocg13becsec8plus">+</span><span class="htmltocminus" id="tocg13becsec8minus">&#8722;</span></span>
<a class="htmltoc" href="#g13becsec8">&#160;9&#160;<b>Example</b></a>
<div class="htmltocitem" id="tocg13becsec8">
<div class="htmltoc">
<span class="htmltoc" onclick="showLevel('tocg13becsec81');"><span class="htmltocplus" id="tocg13becsec81plus">+</span><span class="htmltocminus" id="tocg13becsec81minus">&#8722;</span></span>
<a class="htmltoc" href="#g13becsec81">&#160;9.1&#160;<b>Example 1</b></a>
<div class="htmltocitem" id="tocg13becsec81">
<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('tocg13becsec9');"><span class="htmltocplus" id="tocg13becsec9plus">+</span><span class="htmltocminus" id="tocg13becsec9minus">&#8722;</span></span>
<a class="htmltoc" href="#g13becsec9">&#160;10&#160;<b>Optional Parameters</b></a>
<div class="htmltocitem" id="tocg13becsec9">
<div class="htmltoc">
<span class="htmltocplus">&#160;&#160;&#160;</span>
<a class="htmltoc" href="#g13becsec91">&#160;10.1&#160;<b>Optional Parameters Checklist and Default Values</b></a>
<div class="htmltocitem" id="tocg13becsec91"/>
</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 class="htmltoc">
<span class="htmltoc" onclick="showLevel('tocg13becsec93');"><span class="htmltocplus" id="tocg13becsec93plus">+</span><span class="htmltocminus" id="tocg13becsec93minus">&#8722;</span></span>
<a class="htmltoc" href="#g13becsec93">&#160;10.3&#160;<b>Description of Printed Output</b></a>
<div class="htmltocitem" id="tocg13becsec93">
<div class="htmltoc">
<span class="htmltocplus">&#160;&#160;&#160;</span>
<a class="htmltoc" href="#printed-output">&#160;10.3.1&#160;<b>Output of results via a user defined printing function</b></a>
<div class="htmltocitem" id="tocprinted-output"/>
</div>
</div>
</div>
</div>
</div>

<div class="htmltoc">
<span class="htmltoc" onclick="showLevel('tocg13becsec10');"><span class="htmltocplus" id="tocg13becsec10plus">+</span><span class="htmltocminus" id="tocg13becsec10minus">&#8722;</span></span>
<a class="htmltoc" href="#g13becsec10">&#160;11&#160;<b>Example 2</b></a>
<div class="htmltocitem" id="tocg13becsec10">
<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_estim (g13bec) fits a time series model to one output series relating it to any input series with a choice of three different estimation criteria &#8211; nonlinear least-squares, exact likelihood and marginal likelihood.  When no input series are present, nag_tsa_multi_inp_model_estim (g13bec) fits a univariate ARIMA model.</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_estim</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="#nxxy">nxxy</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="#sd">sd</a>[], double&#160;*<a class="argref" href="#rss">rss</a>, double&#160;*<a class="argref" href="#objf">objf</a>, double&#160;*<a class="argref" href="#df">df</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>




<h3><a name="g13becsec31" id="g13becsec31"/>3.1&#160;&#160;The Multi-input Model</h3>

<div class="paramtext">The output series <math xmlns="http://www.w3.org/1998/Math/MathML">
 <msub>
  <mi>y</mi>
  <mi>t</mi>
 </msub>
</math>, for <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>t</mi>
 <mo>=</mo>
 <mn>1</mn>
 <mo>,</mo>
 <mn>2</mn>
 <mo>,</mo>
 <mo>&#8230;</mo>
 <mo>,</mo>
 <mi>n</mi>
</math>, is assumed to be the sum of (unobserved) components <math xmlns="http://www.w3.org/1998/Math/MathML">
 <msub>
  <mi>z</mi>
  <mrow><mi>i</mi><mo>,</mo><mi>t</mi></mrow>
 </msub>
</math>&#160;which are due respectively to the inputs <math xmlns="http://www.w3.org/1998/Math/MathML">
 <msub>
  <mi>x</mi>
  <mrow><mi>i</mi><mo>,</mo><mi>t</mi></mrow>
 </msub>
</math>, for <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>i</mi>
 <mo>=</mo>
 <mn>1</mn>
 <mo>,</mo>
 <mn>2</mn>
 <mo>,</mo>
 <mo>&#8230;</mo>
 <mo>,</mo>
 <mi>m</mi>
</math>.</div>
<div class="paramtext">Thus <math xmlns="http://www.w3.org/1998/Math/MathML">
 <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>
 <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>
</math>&#160;where <math xmlns="http://www.w3.org/1998/Math/MathML">
 <msub>
  <mi>n</mi>
  <mi>t</mi>
 </msub>
</math>&#160;is the error, or output noise component.</div>
<div class="paramtext">A typical component <math xmlns="http://www.w3.org/1998/Math/MathML">
 <msub>
  <mi>z</mi>
  <mi>t</mi>
 </msub>
</math>&#160;may be either:</div>
<div class="paramtext">
</div><ol class="listalpha"><li class="listalpha">A simple regression component, <math xmlns="http://www.w3.org/1998/Math/MathML">
 <msub>
  <mi>z</mi>
  <mi>t</mi>
 </msub>
 <mo>=</mo>
 <mi>&#969;</mi>
 <msub>
  <mi>x</mi>
  <mi>t</mi>
 </msub>
</math>&#160;(here <math xmlns="http://www.w3.org/1998/Math/MathML">
 <msub>
  <mi>x</mi>
  <mi>t</mi>
 </msub>
</math>&#160;is called a simple input) or</li><li class="listalpha">A transfer function model component which allows for the effect of lagged values of the variable, related to <math xmlns="http://www.w3.org/1998/Math/MathML">
 <msub>
  <mi>x</mi>
  <mi>t</mi>
 </msub>
</math>&#160;by

<div class="formula"><table class="formula"><tr><td class="formula"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
 <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>
 <mtext>.</mtext>
</math></td><td class="formula2"/></tr></table></div>
</li></ol><div class="paramtext">
The noise <math xmlns="http://www.w3.org/1998/Math/MathML">
 <msub>
  <mi>n</mi>
  <mi>t</mi>
 </msub>
</math>&#160;is assumed to follow a (possibly seasonal) ARIMA model, i.e., may be represented in terms of an uncorrelated series, <math xmlns="http://www.w3.org/1998/Math/MathML">
 <msub>
  <mi>a</mi>
  <mi>t</mi>
 </msub>
</math>, by the hierarchy of equations:</div>
<div class="paramtext">
</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>
    <msup>
     <mo>&#8711;</mo>
     <mi>d</mi>
    </msup>
    <msubsup>
     <mo>&#8711;</mo>
     <mi>s</mi>
     <mi>D</mi>
    </msubsup>
    <msub>
     <mi>n</mi>
     <mi>t</mi>
    </msub>
   </mtd>
   <mtd>
    <mi>c</mi>
    <mo>+</mo>
    <msub>
     <mi>w</mi>
     <mi>t</mi>
    </msub>
   </mtd>
  </mtr>
  <mtr>
   <mtd>
    <msub>
     <mi>w</mi>
     <mi>t</mi>
    </msub>
   </mtd>
   <mtd>
    <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>
   </mtd>
  </mtr>
  <mtr>
   <mtd>
    <msub>
     <mi>e</mi>
     <mi>t</mi>
    </msub>
   </mtd>
   <mtd>
    <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>
   </mtd>
  </mtr>
  <mtr/></mtable>
</math></td><td class="formula2"/></tr></table></div>
<div class="paramtext">
Note: the orders <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>p</mi><mo>,</mo><mi>q</mi>
</math>&#160;appearing in each of the transfer function models and the ARIMA model are not necessarily the same; <math xmlns="http://www.w3.org/1998/Math/MathML">
 <msup>
  <mo>&#8711;</mo>
  <mi>d</mi>
 </msup>
 <msubsup>
  <mo>&#8711;</mo>
  <mi>s</mi>
  <mi>D</mi>
 </msubsup>
 <msub>
  <mi>n</mi>
  <mi>t</mi>
 </msub>
</math>&#160;is the result of applying non-seasonal differencing of order <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>d</mi>
</math>&#160;and seasonal differencing of seasonality <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>s</mi>
</math>&#160;and order <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>D</mi>
</math>&#160;to the series <math xmlns="http://www.w3.org/1998/Math/MathML">
 <msub>
  <mi>n</mi>
  <mi>t</mi>
 </msub>
</math>, the differenced series is then of length <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>N</mi>
 <mo>=</mo>
 <mrow>
  <mi>n</mi>
  <mo>-</mo>
  <mi>d</mi>
  <mo>-</mo>
  <mi>s</mi>
 </mrow>
 <mo>&#215;</mo>
 <mi>D</mi>
</math>; the constant term parameter <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>c</mi>
</math>&#160;may optionally be held fixed at its initial value (usually, but not necessarily zero) rather than being estimated.</div>
<div class="paramtext">For the purpose of defining an estimation criterion it is assumed that the series <math xmlns="http://www.w3.org/1998/Math/MathML">
 <msub>
  <mi>a</mi>
  <mi>t</mi>
 </msub>
</math>&#160;is a sequence of independent Normal variates having mean 0 and variance <math xmlns="http://www.w3.org/1998/Math/MathML">
 <msubsup>
  <mi>&#963;</mi>
  <mi>a</mi>
  <mn>2</mn>
 </msubsup>
</math>.  An allowance has to be made for the effects of unobserved data prior to the observation period.  For the noise component an allowance is always made using a form of backforecasting.</div>
<div class="paramtext">For each transfer function input, the user has to decide what values are to be assumed for the pre-period terms <math xmlns="http://www.w3.org/1998/Math/MathML">
 <msub>
  <mi>z</mi>
  <mn>0</mn>
 </msub>
 <mo>,</mo>
 <msub>
  <mi>z</mi>
  <mrow><mo>-</mo><mn>1</mn></mrow>
 </msub>
 <mo>,</mo>
 <mo>&#8230;</mo>
 <mo>,</mo>
 <msub>
  <mi>z</mi>
  <mrow><mn>1</mn><mo>-</mo><mi>p</mi></mrow>
 </msub>
</math>&#160;and <math xmlns="http://www.w3.org/1998/Math/MathML">
 <msub>
  <mi>x</mi>
  <mn>0</mn>
 </msub>
 <mo>,</mo>
 <msub>
  <mi>x</mi>
  <mrow><mo>-</mo><mn>1</mn></mrow>
 </msub>
 <mo>,</mo>
 <mo>&#8230;</mo>
 <mo>,</mo>
 <msub>
  <mi>x</mi>
  <mrow>
   <mn>1</mn>
   <mo>-</mo>
   <mrow><mi>b</mi><mo>-</mo><mi>q</mi></mrow>
  </mrow>
 </msub>
</math>&#160;which are in theory necessary to re-create the component series <math xmlns="http://www.w3.org/1998/Math/MathML">
 <msub>
  <mi>z</mi>
  <mn>1</mn>
 </msub>
 <mo>,</mo>
 <msub>
  <mi>z</mi>
  <mn>2</mn>
 </msub>
 <mo>,</mo>
 <mo>&#8230;</mo>
 <mo>,</mo>
 <msub>
  <mi>z</mi>
  <mi>n</mi>
 </msub>
</math>, during the estimation procedure.</div>
<div class="paramtext">The first choice is to assume that all these values are zero.  In this case in order to avoid undesirable transient distortion of the early values <math xmlns="http://www.w3.org/1998/Math/MathML">
 <msub>
  <mi>z</mi>
  <mn>1</mn>
 </msub>
 <mo>,</mo>
 <msub>
  <mi>z</mi>
  <mn>2</mn>
 </msub>
 <mo>,</mo>
 <mo>&#8230;</mo>
 <mo>,</mo>
</math>&#160;the user is advised first to correct the input series <math xmlns="http://www.w3.org/1998/Math/MathML">
 <msub>
  <mi>x</mi>
  <mi>t</mi>
 </msub>
</math>&#160;by subtracting from all the terms a suitable constant to make the early values <math xmlns="http://www.w3.org/1998/Math/MathML">
 <msub>
  <mi>x</mi>
  <mn>1</mn>
 </msub>
 <mo>,</mo>
 <msub>
  <mi>x</mi>
  <mn>2</mn>
 </msub>
 <mo>,</mo>
 <mo>&#8230;</mo>
 <mo>,</mo>
</math>&#160;close to zero.  The series mean <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mover><mrow>
  <mi>x</mi>
 </mrow><mo>-</mo></mover>
</math>&#160;is one possibility, but for a series with strong trend, the constant might be simply <math xmlns="http://www.w3.org/1998/Math/MathML">
 <msub>
  <mi>x</mi>
  <mn>1</mn>
 </msub>
</math>.</div>
<div class="paramtext">The second choice is to treat the unknown pre-period terms as nuisance parameters and estimate them along with the other parameters.  This choice should be used with caution.  For example, if <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>p</mi><mo>=</mo><mn>1</mn>
</math>&#160;and <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>b</mi>
 <mo>=</mo>
 <mi>q</mi>
 <mo>=</mo>
 <mn>0</mn>
</math>, it is equivalent to fitting to the data a decaying geometric curve of the form <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>A</mi>
 <msup>
  <mi>&#948;</mi>
  <mi>t</mi>
 </msup>
</math>, for <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>t</mi>
 <mo>=</mo>
 <mn>1</mn>
 <mo>,</mo>
 <mn>2</mn>
 <mo>,</mo>
 <mn>3</mn>
 <mo>,</mo>
 <mo>&#8230;</mo>
</math>, along with the other inputs, this being the form of the transient.  If the output <math xmlns="http://www.w3.org/1998/Math/MathML">
 <msub>
  <mi>y</mi>
  <mi>t</mi>
 </msub>
</math>&#160;contains a strong trend of this form, which is not otherwise represented in the model, it will have a tendency to influence the estimate of <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>&#948;</mi>
</math>&#160;away from the value appropriate to the transfer function model.</div>
<div class="paramtext">In most applications the first choice should be adequate, with the option possibly being used as a refinement at the end of the modelling process.  The number of nuisance parameters is then <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mrow><mi>max</mi><mo>&#8289;</mo><mfenced separators=""><mi>p</mi><mo>,</mo><mrow><mi>b</mi><mo>+</mo><mi>q</mi></mrow></mfenced></mrow>
</math>, with a corresponding loss of degrees of freedom in the residuals.  If the user aligns the input <math xmlns="http://www.w3.org/1998/Math/MathML">
 <msub>
  <mi>x</mi>
  <mi>t</mi>
 </msub>
</math>&#160;with the output by using in its place the shifted series <math xmlns="http://www.w3.org/1998/Math/MathML">
 <msub>
  <mi>x</mi>
  <mrow><mi>t</mi><mo>-</mo><mi>b</mi></mrow>
 </msub>
</math>, then setting <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>b</mi><mo>=</mo><mn>0</mn>
</math>&#160;in the transfer function model, there is some improvement in efficiency.  On some occasions when the model contains two or more inputs, each with estimation of pre-period nuisance parameters, these parameters may be co-linear and lead to failure of the function.  The option must then be &#8216;switched off&#8217; for one or more inputs.</div>




<h3><a name="g13becsec32" id="g13becsec32"/>3.2&#160;&#160;The Estimation Criterion</h3>

<div class="paramtext">This is a measure of how well a proposed set of parameters in the transfer function and noise ARIMA models, matches the data.  The estimation function searches for parameter values which minimize this criterion.  For a proposed set of parameter values it is derived by calculating:</div>
<div class="paramtext">
</div><ol class="listroman"><li class="listroman">the components <math xmlns="http://www.w3.org/1998/Math/MathML">
 <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>&#8230;</mo>
 <mo>,</mo>
 <msub>
  <mi>z</mi>
  <mrow><mi>m</mi><mo>,</mo><mi>t</mi></mrow>
 </msub>
</math>&#160;as the responses to the input series <math xmlns="http://www.w3.org/1998/Math/MathML">
 <msub>
  <mi>x</mi>
  <mrow><mn>1</mn><mo>,</mo><mi>t</mi></mrow>
 </msub>
 <mo>,</mo>
 <msub>
  <mi>x</mi>
  <mrow><mn>2</mn><mo>,</mo><mi>t</mi></mrow>
 </msub>
 <mo>,</mo>
 <mo>&#8230;</mo>
 <mo>,</mo>
 <msub>
  <mi>x</mi>
  <mrow><mi>m</mi><mo>,</mo><mi>t</mi></mrow>
 </msub>
</math>&#160;using the equations (a) or (b) above,</li><li class="listroman">the discrepancy between the output and the sum of these components, as the noise

<div class="formula"><table class="formula"><tr><td class="formula"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
 <msub>
  <mi>n</mi>
  <mi>t</mi>
 </msub>
 <mo>=</mo>
 <msub>
  <mi>y</mi>
  <mi>t</mi>
 </msub>
 <mo>-</mo>
 <mfenced separators="">
  <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>
 </mfenced>
 <mtext>,</mtext>
</math></td><td class="formula2"/></tr></table></div>
</li><li class="listroman">the residual series <math xmlns="http://www.w3.org/1998/Math/MathML">
 <msub>
  <mi>a</mi>
  <mi>t</mi>
 </msub>
</math>&#160;from <math xmlns="http://www.w3.org/1998/Math/MathML">
 <msub>
  <mi>n</mi>
  <mi>t</mi>
 </msub>
</math>&#160;by reversing the recursive equations (c), (d) and (e) above.</li></ol><div class="paramtext">
This last step again requires treatment of the effect of unknown pre-period values of <math xmlns="http://www.w3.org/1998/Math/MathML">
 <msub>
  <mi>n</mi>
  <mi>t</mi>
 </msub>
</math>&#160;and other terms in the equations regenerating <math xmlns="http://www.w3.org/1998/Math/MathML">
 <msub>
  <mi>a</mi>
  <mi>t</mi>
 </msub>
</math>.  One approach is to use a sum of squares function as the estimation criteria, which is equivalent to taking the infinite set of past values <math xmlns="http://www.w3.org/1998/Math/MathML">
 <msub>
  <mi>n</mi>
  <mn>0</mn>
 </msub>
 <mo>,</mo>
 <msub>
  <mi>n</mi>
  <mrow><mo>-</mo><mn>1</mn></mrow>
 </msub>
 <mo>,</mo>
 <msub>
  <mi>n</mi>
  <mrow><mo>-</mo><mn>2</mn></mrow>
 </msub>
 <mo>,</mo>
 <mo>&#8230;</mo>
 <mo>,</mo>
</math>&#160;as (linear) nuisance parameters.  There is no loss of degrees of freedom however, because the sum of squares function <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>S</mi>
</math>&#160;may be expressed as including the corresponding set of past residuals &#8211; see <a class="litref" href="#ref163">Box  and Jenkins (1976)</a> page 273, who prove that
</div>
<div class="formula"><table class="formula"><tr><td class="formula"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
 <mi>S</mi>
 <mo>=</mo>
 <munderover>
  <mo>&#8721;</mo>
  <mrow><mo>-</mo><mo>&#8734;</mo></mrow>
  <mi>n</mi>
 </munderover>
 <msubsup>
  <mi>a</mi>
  <mi>t</mi>
  <mn>2</mn>
 </msubsup>
 <mtext>.</mtext>
</math></td><td class="formula2"/></tr></table></div>
<div class="paramtext">
The function <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>D</mi><mo>=</mo><mi>S</mi>
</math>&#160;is the first of the three possible criteria, and is quite adequate for moderate to long series with no seasonal parameters.  The second is the exact likelihood criterion which considers the past set <math xmlns="http://www.w3.org/1998/Math/MathML">
 <msub>
  <mi>n</mi>
  <mn>0</mn>
 </msub>
 <mo>,</mo>
 <msub>
  <mi>n</mi>
  <mrow><mo>-</mo><mn>1</mn></mrow>
 </msub>
 <mo>,</mo>
 <msub>
  <mi>n</mi>
  <mrow><mo>-</mo><mn>2</mn></mrow>
 </msub>
 <mo>,</mo>
 <mo>&#8230;</mo>
</math>, not as simple nuisance parameters, but as unobserved random variables with known distribution.  Calculation of the likelihood of the observed set <math xmlns="http://www.w3.org/1998/Math/MathML">
 <msub>
  <mi>n</mi>
  <mn>1</mn>
 </msub>
 <mo>,</mo>
 <msub>
  <mi>n</mi>
  <mn>2</mn>
 </msub>
 <mo>,</mo>
 <mo>&#8230;</mo>
 <mo>,</mo>
 <msub>
  <mi>n</mi>
  <mi>n</mi>
 </msub>
</math>&#160;requires theoretical integration over the range of the past set.  Fortunately this yields a criterion of the form <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>D</mi>
 <mo>=</mo>
 <mi>M</mi>
 <mo>&#215;</mo>
 <mi>S</mi>
</math>&#160;(whose minimization is equivalent to maximizing the exact likelihood of the data), where <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>S</mi>
</math>&#160;is exactly as before, and the multiplier <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>M</mi>
</math>&#160;is a function calculated from the ARIMA model parameters.  The value of <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>M</mi>
</math>&#160;is always <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mo>&#8805;</mo>
 <mn>1</mn>
</math>, and <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>M</mi>
</math>&#160;tends to 1 for any fixed parameter set as the sample size <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>n</mi>
</math>&#160;tends to <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mo>&#8734;</mo>
</math>.  There is a moderate computational overhead in using this option, but its use avoids appreciable bias in the ARIMA model parameters and yields a better conditioned estimation problem.</div>
<div class="paramtext">The third criterion of marginal likelihood treats the coefficients of the simple inputs in a manner analogous to that given to the past set <math xmlns="http://www.w3.org/1998/Math/MathML">
 <msub>
  <mi>n</mi>
  <mn>0</mn>
 </msub>
 <mo>,</mo>
 <msub>
  <mi>n</mi>
  <mrow><mo>-</mo><mn>1</mn></mrow>
 </msub>
 <mo>,</mo>
 <msub>
  <mi>n</mi>
  <mrow><mo>-</mo><mn>2</mn></mrow>
 </msub>
 <mo>,</mo>
 <mo>&#8230;</mo>
</math>.  These coefficients, together with the constant term <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>c</mi>
</math>&#160;used to represent the mean of <math xmlns="http://www.w3.org/1998/Math/MathML">
 <msub>
  <mi>w</mi>
  <mi>t</mi>
 </msub>
</math>, are in effect treated as random variables with highly dispersed distributions.  This leads to the criterion <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>D</mi>
 <mo>=</mo>
 <mi>M</mi>
 <mo>&#215;</mo>
 <mi>S</mi>
</math>&#160;again, but with a different value of <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>M</mi>
</math>&#160;which now depends on the simple input series values <math xmlns="http://www.w3.org/1998/Math/MathML">
 <msub>
  <mi>x</mi>
  <mi>t</mi>
 </msub>
</math>.  In the presence of a moderate to large number of simple inputs, the marginal likelihood criterion can counteract bias in the ARIMA model parameters which is caused by estimation of the simple inputs.  This is particularly important in relatively short series.</div>
<div class="paramtext">nag_tsa_multi_inp_model_estim (g13bec) can be used with no input series present, to estimate a univariate ARIMA model for the ouput alone.  The marginal likelihood criterion is then distinct from exact likelihood only if a constant term is being estimated in the model, because this is treated as an implicit simple input.</div>




<h3><a name="g13becsec33" id="g13becsec33"/>3.3&#160;&#160;The Estimation Procedure</h3>

<div class="paramtext">This is the minimization of the estimation criterion or objective function <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>D</mi>
</math>&#160;(for deviance).  The function uses an extension of the algorithm of <a class="litref" href="#ref166">Marquardt (1963)</a>.  The step size in the minimization is inversely related to a parameter <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>&#945;</mi>
</math>, which is increased or decreased by a factor <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>&#946;</mi>
</math>&#160;at successive iterations, depending on the progress of the minimization.  Convergence is deemed to have occurred if the fractional reduction of <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>D</mi>
</math>&#160;in successive iterations is less than a value <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>&#947;</mi>
</math>, while <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>&#945;</mi><mo>&lt;</mo><mn>1</mn>
</math>.</div>
<div class="paramtext">Certain model parameters (in fact all excluding the <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>&#969;</mi>
</math>'s) are subject to stability constraints which are checked throughout to within a specified tolerance multiple <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>&#948;</mi>
</math>&#160;of machine accuracy.  Using the least-squares criterion, the minimization may halt prematurely when some parameters &#8216;stick&#8217; at a constraint boundary.  This can happen particularly with short seasonal series (with a small number of whole seasons).  It will not happen using the exact likelihood criterion, although convergence to a point on the boundary may sometimes be rather slow, because the criterion function may be very flat in such a region.  There is also a smaller risk of a premature halt at a constraint boundary when marginal likelihood is used.</div>
<div class="paramtext">A positive, or zero number of iterations can be specified.  In either case, the value <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>D</mi>
</math>&#160;of the objective function at iteration zero is computed at the initial parameter values, except for the estimation of any pre-period terms for the input series, backforecasts for the noise series, and the coefficients of any simple inputs, and the constant term (unless this is held fixed).</div>
<div class="paramtext">At any later iteration, the value of <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>D</mi>
</math>&#160;is computed after re-estimation of the backforecasts to their optimal values, corresponding to the model parameters presented at that iteration.  This is not true for any pre-period terms for the input series which, although they are updated from the previous iteration, may not be precisely optimal for the parameter values presented, unless convergence of those parameters has occurred.  However, in the case of marginal likelihood being specified, the coefficients of the simple inputs and the constant term are also re-estimated together with the backforecasts at each iteration, to values which are optimal for the other parameter values presented.</div>




<h3><a name="g13becsec34" id="g13becsec34"/>3.4&#160;&#160;Further Results</h3>

<div class="paramtext">The residual variance is taken as <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mrow><mi>e</mi><mi>r</mi><mi>v</mi></mrow>
 <mo>=</mo>
 <mfrac>
  <mi>S</mi>
  <mrow><mi>d</mi><mi>f</mi></mrow>
 </mfrac>
</math>&#160;where <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mrow><mi>d</mi><mi>f</mi></mrow>
 <mo>=</mo>
 <mi>N</mi>
 <mo>-</mo>
</math>&#160;(total number of parameters estimated), is the residual degrees of freedom (for definition of <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>S</mi>
</math>&#160;see Section 3.2 and for definition of <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>N</mi>
</math>&#160;see Section 3.1).  The pre-period nuisance parameters for the input series are included in the reduction of <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mrow><mi>d</mi><mi>f</mi></mrow>
</math>, as is the constant if it is estimated.</div>
<div class="paramtext">The covariance matrix of the vector of model parameter estimates is given by
</div>
<div class="formula"><table class="formula"><tr><td class="formula"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
 <mrow><mi>e</mi><mi>r</mi><mi>v</mi></mrow>
 <mo>&#215;</mo>
 <msup>
  <mi>H</mi>
  <mrow><mo>-</mo><mn>1</mn></mrow>
 </msup>
</math></td><td class="formula2"/></tr></table></div>
<div class="paramtext">
where <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>H</mi>
</math>&#160;is the linearised least-squares matrix taken from the final iteration of the algorithm of Marquardt.  From this expression are derived the vector of standard deviations, and the correlation matrix of parameter estimates.  These are approximations which are only valid asymptotically, and must be treated with great caution when the parameter estimates are close to their constraint boundaries.</div>
<div class="paramtext">The residual series <math xmlns="http://www.w3.org/1998/Math/MathML">
 <msub>
  <mi>a</mi>
  <mi>t</mi>
 </msub>
</math>&#160;is available upon completion of the iterations over the range <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>t</mi>
 <mo>=</mo>
 <mn>1</mn>
 <mo>+</mo>
 <mi>d</mi>
 <mo>+</mo>
 <mi>s</mi>
 <mo>&#215;</mo>
 <mi>D</mi>
 <mo>,</mo>
 <mo>&#8230;</mo>
 <mo>,</mo>
 <mi>n</mi>
</math>&#160;corresponding to the differenced noise series <math xmlns="http://www.w3.org/1998/Math/MathML">
 <msub>
  <mi>w</mi>
  <mi>t</mi>
 </msub>
</math>.</div>
<div class="paramtext">Because of the algorithm used for backforecasting, these are only true residuals for <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>t</mi>
 <mo>&#8805;</mo>
 <mn>1</mn>
 <mo>+</mo>
 <mi>q</mi>
 <mo>+</mo>
 <mi>s</mi>
 <mo>&#215;</mo>
 <mrow>
  <mi>Q</mi>
  <mo>-</mo>
  <mi>p</mi>
  <mo>-</mo>
  <mi>s</mi>
 </mrow>
 <mo>&#215;</mo>
 <mrow>
  <mi>P</mi>
  <mo>-</mo>
  <mi>d</mi>
  <mo>-</mo>
  <mi>s</mi>
 </mrow>
 <mo>&#215;</mo>
 <mi>D</mi>
</math>, provided this is positive.  Estimation of pre-period terms for the inputs will also tend to reduce the magnitude of the early residuals, sometimes severely.</div>
<div class="paramtext">The model component series <math xmlns="http://www.w3.org/1998/Math/MathML">
 <msub>
  <mi>z</mi>
  <mrow><mn>1</mn><mo>,</mo><mi>t</mi></mrow>
 </msub>
 <mo>,</mo>
 <mo>&#8230;</mo>
 <mo>,</mo>
 <msub>
  <mi>z</mi>
  <mrow><mi>m</mi><mo>,</mo><mi>t</mi></mrow>
 </msub>
</math>&#160;and <math xmlns="http://www.w3.org/1998/Math/MathML">
 <msub>
  <mi>n</mi>
  <mi>t</mi>
 </msub>
</math>&#160;may optionally be returned in order to assess the effects of the various inputs on the output.</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>
<p><a name="ref166" id="ref166"/>Marquardt D W (1963) An algorithm for least-squares estimation of nonlinear parameters <i>J. Soc. Indust. Appl. Math.</i> <b>11</b> 431 </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 total number of input and output series.  There may be any number of input series (including none), but always 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/Output</span></dt>
<dt class="multi-memberhead"><a name="transfv_q" id="transfv_q"/><b>q</b> &#8211; Integer&#160;*<span class="pclass">Input/Output</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/Output</span></dt><dd>
<div class="membertext"><i>On entry/exit</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>.  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>.  <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, <math xmlns="http://www.w3.org/1998/Math/MathML">
 <msub>
  <mi>r</mi>
  <mi>i</mi>
 </msub>
 <mo>=</mo>
 <mn>2</mn>
</math>&#160;for a transfer function input for which no allowance is to be made for pre-observation period effects, and <math xmlns="http://www.w3.org/1998/Math/MathML">
 <msub>
  <mi>r</mi>
  <mi>i</mi>
 </msub>
 <mo>=</mo>
 <mn>3</mn>
</math>&#160;for a transfer function input for which pre-observation period effects will be treated by estimation of appropriate nuisance parameters.  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 <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 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 transfv 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>: initial values 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 and <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 initial values of the transfer function model parameters <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>, <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 initial value of the constant <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>c</mi>
</math>, whether it is fixed or is to be estimated.</div>
<div class="paramtext"><i>On exit</i>: the latest values of the estimates of these parameters.</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>&#160;and <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>c</mi>
</math>&#160;parameters.</div>

<div class="paramtext"><i>Constraint</i>:
  <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 fixed or estimated.)
.</div>
</dd><dt class="paramhead"><a name="nxxy" id="nxxy"/>6:
 &#160;&#160;&#8194;
 <b>nxxy</b> &#8211; Integer&#160;<span class="pclass">Input</span></dt><dd>
<div class="paramtext"><i>On entry</i>: the (common) length of the original, undifferenced input and output time series.</div>
</dd><dt class="paramhead"><a name="xxy" id="xxy"/>7:
 &#160;&#160;&#8194;
 <b>xxy</b>[<a class="argref" href="#nxxy">nxxy</a>][<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 the <a class="argref" href="#nxxy">nxxy</a> original, undifferenced values of each of the input series, <math xmlns="http://www.w3.org/1998/Math/MathML">
 <msub>
  <mi>x</mi>
  <mi>t</mi>
 </msub>
</math>, and the output series, <math xmlns="http://www.w3.org/1998/Math/MathML">
 <msub>
  <mi>y</mi>
  <mi>t</mi>
 </msub>
</math>, in that order.</div>
</dd><dt class="paramhead"><a name="tdxxy" id="tdxxy"/>8:
 &#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_estim (g13bec) 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="sd" id="sd"/>9:
 &#160;&#160;&#8194;
 <b>sd</b>[<a class="argref" href="#npara">npara</a>] &#8211; double&#160;<span class="pclass">Output</span></dt><dd>
<div class="paramtext"><i>On exit</i>: the <a class="argref" href="#npara">npara</a> values of the standard deviations corresponding to each of the parameters in <a class="argref" href="#para">para</a>.  When the constant is fixed its standard deviation is returned as zero.  When the values of <a class="argref" href="#para">para</a> are valid, the values of <a class="argref" href="#sd">sd</a> are usually also valid unless the function fails to invert the second derivative matrix in which case <a class="argref" href="#fail">fail</a> will have an exit value of <a class="ifailref" href="#NE_MAT_NOT_POS_DEF">NE_MAT_NOT_POS_DEF</a>.</div>
</dd><dt class="paramhead"><a name="rss" id="rss"/>10:
 &#8194;
 <b>rss</b> &#8211; double&#160;*<span class="pclass">Output</span></dt><dd>
<div class="paramtext"><i>On exit</i>: the residual sum of squares, <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>S</mi>
</math>, at the latest set of valid parameter estimates.</div>
</dd><dt class="paramhead"><a name="objf" id="objf"/>11:
 &#8194;
 <b>objf</b> &#8211; double&#160;*<span class="pclass">Output</span></dt><dd>
<div class="paramtext"><i>On exit</i>: the objective function, <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>D</mi>
</math>, at the latest set of valid parameter estimates.</div>
</dd><dt class="paramhead"><a name="df" id="df"/>12:
 &#8194;
 <b>df</b> &#8211; double&#160;*<span class="pclass">Output</span></dt><dd>
<div class="paramtext"><i>On exit</i>: the degrees of freedom associated with <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>S</mi>
</math>.</div>
</dd><dt class="paramhead"><a name="options" id="options"/>13:
 &#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_estim (g13bec).  If the optional parameters are not required, then the null pointer, <span class="mono">G13_DEFAULT</span>, can be used in the function call to nag_tsa_multi_inp_model_estim (g13bec).  Details of the optional parameters and their types are given below in Section <a class="secref" href="#op-description">10.2</a>.</div>
</dd><dt class="paramhead"><a name="fail" id="fail"/>14:
 &#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_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 <a class="argref" href="#transfv">transfv</a>.<math xmlns="http://www.w3.org/1998/Math/MathML">
 <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 of <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_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>, has not been successfully initialised using function <a class="rtnref" href="../G13/g13byc.xml">nag_tsa_transf_orders (g13byc)</a>.
</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.  <br/>
On entry, parameter <a class="optparamref" href="#optparam_criteria">options.criteria</a> had an illegal value.  <br/>
On entry, parameter <a class="optparamref" href="#optparam_print_level">options.print_level</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>.  <br/>
On entry, <a class="optparamref" href="#optparam_max_iter">options.max_iter</a> must not be less than 0: <math xmlns="http://www.w3.org/1998/Math/MathML">
 <maction actiontype="link" dsi:href="#optparam_max_iter" dsi:type="simple"><mi mathcolor="#800080" mathvariant="bold">options.max_iter</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>.
</div>
</dd>


<dt class="errorhead"><a name="NE_REAL_ARG_LE" id="NE_REAL_ARG_LE"/><b>NE_REAL_ARG_LE</b></dt>
<dd style="margin-top: .2em;">
<div class="paramtext"> On entry, <a class="optparamref" href="#optparam_alpha">options.alpha</a> must not be less than or equal to 0.0: <math xmlns="http://www.w3.org/1998/Math/MathML">
 <maction actiontype="link" dsi:href="#optparam_alpha" dsi:type="simple"><mi mathcolor="#800080" mathvariant="bold">options.alpha</mi></maction><mo>=</mo><mfenced open="&#9001;" close="&#9002;" separators=""><mtext mathvariant="italic">value</mtext></mfenced>
</math>.  <br/>
On entry, <a class="optparamref" href="#optparam_beta">options.beta</a> must not be less than or equal to 1.0: <math xmlns="http://www.w3.org/1998/Math/MathML">
 <maction actiontype="link" dsi:href="#optparam_beta" dsi:type="simple"><mi mathcolor="#800080" mathvariant="bold">options.beta</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_REAL_ARG_LT" id="NE_REAL_ARG_LT"/><b>NE_REAL_ARG_LT</b></dt>
<dd style="margin-top: .2em;">
<div class="paramtext"> On entry, <a class="optparamref" href="#optparam_delta">options.delta</a> must not be less than 1.0: <math xmlns="http://www.w3.org/1998/Math/MathML">
 <maction actiontype="link" dsi:href="#optparam_delta" dsi:type="simple"><mi mathcolor="#800080" mathvariant="bold">options.delta</mi></maction><mo>=</mo><mfenced open="&#9001;" close="&#9002;" separators=""><mtext mathvariant="italic">value</mtext></mfenced>
</math>.  <br/>
On entry, <a class="optparamref" href="#optparam_gamma">options.gamma</a> must not be less than 0.0: <math xmlns="http://www.w3.org/1998/Math/MathML">
 <maction actiontype="link" dsi:href="#optparam_gamma" dsi:type="simple"><mi mathcolor="#800080" mathvariant="bold">options.gamma</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_REAL_ARG_GE" id="NE_REAL_ARG_GE"/><b>NE_REAL_ARG_GE</b></dt>
<dd style="margin-top: .2em;">
<div class="paramtext"> On entry, <a class="optparamref" href="#optparam_gamma">options.gamma</a> must not be greater than or equal to 1.0: <math xmlns="http://www.w3.org/1998/Math/MathML">
 <maction actiontype="link" dsi:href="#optparam_gamma" dsi:type="simple"><mi mathcolor="#800080" mathvariant="bold">options.gamma</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_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>


<dt class="errorhead"><a name="NE_ITER_FAIL_NIT" id="NE_ITER_FAIL_NIT"/><b>NE_ITER_FAIL_NIT</b></dt>
<dd style="margin-top: .2em;">
<div class="paramtext"> The function has failed to converge after <a class="optparamref" href="#optparam_max_iter">options.max_iter</a> iterations, where <math xmlns="http://www.w3.org/1998/Math/MathML">
 <maction actiontype="link" dsi:href="#optparam_max_iter" dsi:type="simple"><mi mathcolor="#800080" mathvariant="bold">options.max_iter</mi></maction><mo>=</mo><mfenced open="&#9001;" close="&#9002;" separators=""><mtext mathvariant="italic">value</mtext></mfenced>
</math>.  If steady decreases in the objective function, <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>D</mi>
</math>, were monitored up to the point where this exit occurred, see the optional parameter <a class="optparamref" href="#optparam_print_level">options.print_level</a>, then <a class="optparamref" href="#optparam_max_iter">options.max_iter</a> was probably set too small.  If so the calculations should be restarted from the final point held in <a class="argref" href="#para">para</a>.
</div>
</dd>


<dt class="errorhead"><a name="NE_DIFORDER_LEN_INCONSIST" id="NE_DIFORDER_LEN_INCONSIST"/><b>NE_DIFORDER_LEN_INCONSIST</b></dt>
<dd style="margin-top: .2em;">
<div class="paramtext"> The orders of differencing specified in the structure arimav must satisfy <math xmlns="http://www.w3.org/1998/Math/MathML">
 <maction actiontype="link" dsi:href="#nxxy" dsi:type="simple"><mi mathcolor="#EE0000" mathvariant="bold">nxxy</mi></maction>
 <mo>&gt;</mo>
 <maction actiontype="link" dsi:href="#arimav" dsi:type="simple"><mi mathcolor="#EE0000" mathvariant="bold">arimav</mi></maction>
 <mo>.</mo>
 <maction actiontype="link" dsi:href="#d" dsi:type="simple"><mi mathcolor="#FF00FF" mathvariant="bold">d</mi></maction>
 <mo>+</mo>
</math>&#160;(<a class="argref" href="#arimav">arimav</a>.<a class="memberref" href="#arimav_s">s</a> * <a class="argref" href="#arimav">arimav</a>.<a class="memberref" href="#arimav_bigd">bigd</a>), <math xmlns="http://www.w3.org/1998/Math/MathML">
 <maction actiontype="link" dsi:href="#nxxy" dsi:type="simple"><mi mathcolor="#EE0000" mathvariant="bold">nxxy</mi></maction><mo>=</mo><mfenced open="&#9001;" close="&#9002;" separators=""><mtext mathvariant="italic">value</mtext></mfenced>
</math>, <a class="argref" href="#arimav">arimav</a>.<math xmlns="http://www.w3.org/1998/Math/MathML">
 <maction actiontype="link" dsi:href="#d" dsi:type="simple"><mi mathcolor="#FF00FF" mathvariant="bold">d</mi></maction><mo>=</mo><mfenced open="&#9001;" close="&#9002;" separators=""><mtext mathvariant="italic">value</mtext></mfenced>
</math>, <a class="argref" href="#arimav">arimav</a>.<math xmlns="http://www.w3.org/1998/Math/MathML">
 <maction actiontype="link" dsi:href="#s" dsi:type="simple"><mi mathcolor="#FF00FF" mathvariant="bold">s</mi></maction><mo>=</mo><mfenced open="&#9001;" close="&#9002;" separators=""><mtext mathvariant="italic">value</mtext></mfenced>
</math>, <a class="argref" href="#arimav">arimav</a>.<math xmlns="http://www.w3.org/1998/Math/MathML">
 <maction actiontype="link" dsi:href="#bigd" dsi:type="simple"><mi mathcolor="#FF00FF" mathvariant="bold">bigd</mi></maction><mo>=</mo><mfenced open="&#9001;" close="&#9002;" separators=""><mtext mathvariant="italic">value</mtext></mfenced>
</math>.
</div>
</dd>

<dd class="errorsp">If the intermediate results of optimization are written to a file using the optional parameter <a class="optparamref" href="#optparam_outfile">options.outfile</a>, then the following errors could also occur.</dd>

<dt class="errorhead"><a name="NE_NOT_APPEND_FILE" id="NE_NOT_APPEND_FILE"/><b>NE_NOT_APPEND_FILE</b></dt>
<dd style="margin-top: .2em;">
<div class="paramtext"> Cannot open file <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mfenced open="&#9001;" close="&#9002;" separators="">
  <mi mathvariant="italic">string</mi>
 </mfenced>
</math>&#160;for appending.
</div>
</dd>


<dt class="errorhead"><a name="NE_WRITE_ERROR" id="NE_WRITE_ERROR"/><b>NE_WRITE_ERROR</b></dt>
<dd style="margin-top: .2em;">
<div class="paramtext"> Error occurred when writing to file <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mfenced open="&#9001;" close="&#9002;" separators="">
  <mi mathvariant="italic">string</mi>
 </mfenced>
</math>.
</div>
</dd>


<dt class="errorhead"><a name="NE_NOT_CLOSE_FILE" id="NE_NOT_CLOSE_FILE"/><b>NE_NOT_CLOSE_FILE</b></dt>
<dd style="margin-top: .2em;">
<div class="paramtext"> Cannot close file <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mfenced open="&#9001;" close="&#9002;" separators="">
  <mi mathvariant="italic">string</mi>
 </mfenced>
</math>.
</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_estim (g13bec) is approximately proportional to <math xmlns="http://www.w3.org/1998/Math/MathML">
 <maction actiontype="link" dsi:href="#nxxy" dsi:type="simple"><mi mathcolor="#EE0000" mathvariant="bold">nxxy</mi></maction>
 <mo>&#215;</mo>
 <maction actiontype="link" dsi:href="#optparam_iter" dsi:type="simple"><mi mathcolor="#800080" mathvariant="bold">options.iter</mi></maction>
 <mo>&#215;</mo>
 <msup>
  <maction actiontype="link" dsi:href="#npara" dsi:type="simple"><mi mathcolor="#EE0000" mathvariant="bold">npara</mi></maction>
  <mn>2</mn>
 </msup>
</math>.</div>




<h2><a name="g13becsec8" id="g13becsec8"/>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_estim (g13bec).  An example showing the use of optional parameters is given in Section <a class="secref" href="#g13becsec10">11</a> There is one example program file, the main program of which calls both examples.  The main program is given below.</div>
<div><a href="../../examples/source/g13bece.c">Program Text (g13bece.c)</a></div>


<h3><a name="g13becsec81" id="g13becsec81"/>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_estim (g13bec).</div>
<div class="paramtext">The data in the example relate to 40 observations of an output time series and of a single input time series.  The noise series has one autoregressive <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mfenced separators=""><mi>&#981;</mi></mfenced>
</math>&#160;and one seasonal moving average <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mfenced separators=""><mi>&#920;</mi></mfenced>
</math>&#160;parameter (both of which are initially set to zero) for which the seasonal period is 4.  The input series is defined by orders <math xmlns="http://www.w3.org/1998/Math/MathML">
 <msub>
  <mi>b</mi>
  <mn>1</mn>
 </msub>
 <mo>=</mo>
 <mn>1</mn>
</math>, <math xmlns="http://www.w3.org/1998/Math/MathML">
 <msub>
  <mi>q</mi>
  <mn>1</mn>
 </msub>
 <mo>=</mo>
 <mn>0</mn>
</math>, <math xmlns="http://www.w3.org/1998/Math/MathML">
 <msub>
  <mi>p</mi>
  <mn>1</mn>
 </msub>
 <mo>=</mo>
 <mn>1</mn>
</math>, <math xmlns="http://www.w3.org/1998/Math/MathML">
 <msub>
  <mi>r</mi>
  <mn>1</mn>
 </msub>
 <mo>=</mo>
 <mn>3</mn>
</math>, so that it has one <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>&#969;</mi>
</math>&#160;(initially set to 2.0) and one <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>&#948;</mi>
</math>&#160;(initially set to 0.5), and allows for pre-observation period effects.</div>
<div class="paramtext">After the successful call to nag_tsa_multi_inp_model_estim (g13bec), the following are computed and printed out: the number of full iterations required to obtain satisfactory results, the final values of the <a class="argref" href="#para">para</a> parameters and their standard errors <a class="argref" href="#sd">sd</a>, the residual sum of squares <a class="argref" href="#rss">rss</a>, the objective function <a class="argref" href="#objf">objf</a> and the degrees of freedom.</div>



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





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

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





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

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






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

<div class="paramtext">A number of optional input and output parameters to nag_tsa_multi_inp_model_estim (g13bec) 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.  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_estim (g13bec); 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 are checked within nag_tsa_multi_inp_model_estim (g13bec) 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_estim (g13bec) 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="g13becsec91" id="g13becsec91"/>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_estim (g13bec) together with their default values where relevant.  <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>&#949;</mi>
</math>&#160;is the <span class="bitalic">machine precision</span>.</div>
<div class="paramtext">
</div><div><table style="align:center" cellpadding="4">
  
  
  <tbody>
   <tr>
    <td class="libdoc" valign="top" align="left"><span class="mono">Boolean <a class="optparamref" href="#optparam_list">options.list</a></span></td>
    <td class="libdoc" valign="top" align="left"><b>TRUE</b></td>
   </tr><tr>
    <td class="libdoc" valign="top" align="left"><span class="mono"><b>Nag_PrintType</b> <a class="optparamref" href="#optparam_print_level">options.print_level</a></span></td>
    <td class="libdoc" valign="top" align="left"><b>Nag_Soln</b></td>
   </tr><tr>
    <td class="libdoc" valign="top" align="left"><span class="mono">char outfile[80]</span></td>
    <td class="libdoc" valign="top" align="left"><span class="mono">stdout</span></td>
   </tr><tr>
    <td class="libdoc" valign="top" align="left"><span class="mono">void (*<a class="optparamref" href="#optparam_print_fun">options.print_fun</a>)()</span></td>
    <td class="libdoc" valign="top" align="left"><b>NULL</b></td>
   </tr><tr>
    <td class="libdoc" valign="top" align="left"><span class="mono">Boolean <a class="optparamref" href="#optparam_cfixed">options.cfixed</a></span></td>
    <td class="libdoc" valign="top" align="left"><b>FALSE</b></td>
   </tr><tr>
    <td class="libdoc" valign="top" align="left"><span class="mono"><b>Nag_Likelihood</b> <a class="optparamref" href="#optparam_criteria">options.criteria</a></span></td>
    <td class="libdoc" valign="top" align="left"><b>Nag_Exact</b></td>
   </tr><tr>
    <td class="libdoc" valign="top" align="left"><span class="mono">Integer<a class="optparamref" href="#optparam_max_iter">options.max_iter</a></span></td>
    <td class="libdoc" valign="top" align="left">50</td>
   </tr><tr>
    <td class="libdoc" valign="top" align="left"><span class="mono">double <a class="optparamref" href="#optparam_alpha">options.alpha</a></span></td>
    <td class="libdoc" valign="top" align="left">0.01</td>
   </tr><tr>
    <td class="libdoc" valign="top" align="left"><span class="mono">double <a class="optparamref" href="#optparam_beta">options.beta</a></span></td>
    <td class="libdoc" valign="top" align="left">10.0</td>
   </tr><tr>
    <td class="libdoc" valign="top" align="left"><span class="mono">double <a class="optparamref" href="#optparam_delta">options.delta</a></span></td>
    <td class="libdoc" valign="top" align="left">1000.0</td>
   </tr><tr>
    <td class="libdoc" valign="top" align="left"><span class="mono">double <a class="optparamref" href="#optparam_gamma">options.gamma</a></span></td>
    <td class="libdoc" valign="top" align="left"><math xmlns="http://www.w3.org/1998/Math/MathML">
 <mrow><mi>max</mi><mo>&#8289;</mo><mfenced separators=""><mrow><mn>100</mn><mi>&#949;</mi></mrow><mo>,</mo><msup>
    <mn>10</mn>
    <mrow><mo>-</mo><mn>7</mn></mrow>
   </msup></mfenced></mrow>
</math></td>
   </tr><tr>
    <td class="libdoc" valign="top" align="left"><span class="mono">Integer <a class="optparamref" href="#optparam_iter">options.iter</a></span></td>
    <td class="libdoc" valign="top" align="left"><span class="mono">double *<a class="optparamref" href="#optparam_cm">options.cm</a></span></td>
   </tr><tr>
    <td class="libdoc" valign="top" align="left"><span class="mono">double *<a class="optparamref" href="#optparam_res">options.res</a></span></td>
    <td class="libdoc" valign="top" align="left"><span class="mono">Integer <a class="optparamref" href="#optparam_lenres">options.lenres</a></span></td>
   </tr><tr>
    <td class="libdoc" valign="top" align="left"><span class="mono">double *<a class="optparamref" href="#optparam_zt">options.zt</a></span></td>
    <td class="libdoc" valign="top" align="left"><span class="mono">double *<a class="optparamref" href="#optparam_noise">options.noise</a></span></td>
   </tr>
  </tbody>
 </table></div><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"/></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_estim (g13bec) will be printed.</div>




<table width="100%" class="optparam"><tr><td class="optparam" style="width:45%" align="left"><a name="optparam_print_level" id="optparam_print_level"/><b>print_level</b> &#8211; 
  Nag_PrintType&#160;</td><td class="optparam" align="center"><i>Input</i></td><td class="optparam" style="width:45%" align="right"/></tr></table>

<div class="paramtext"><i>On entry</i>: the level of results produced by nag_tsa_multi_inp_model_estim (g13bec).  The following values are available.
<div class="paramtext">
</div><table><tr>
<td style="width:10.5em;" valign="top"><b>Nag_NoPrint</b></td>
<td valign="top">No output.</td>
</tr><tr>
<td style="width:10.5em;" valign="top"><b>Nag_Soln</b></td>
<td valign="top">The final solution.</td>
</tr><tr>
<td style="width:10.5em;" valign="top"><b>Nag_Iter</b></td>
<td valign="top">One line of output for each iteration.</td>
</tr><tr>
<td style="width:10.5em;" valign="top"><b>Nag_Soln_Iter</b></td>
<td valign="top">The final solution and one line of output for each iteration.</td>
</tr><tr>
<td style="width:10.5em;" valign="top"><b>Nag_Soln_Iter_Full</b></td>
<td valign="top">The final solution and detailed printout at each iteration.</td>
</tr></table><div class="paramtext">
Details of each level of results printout are described in Section 7.3.</div>
</div>

<div class="paramtext"><i>Constraint</i>:
  <math xmlns="http://www.w3.org/1998/Math/MathML"><maction actiontype="link" dsi:href="#optparam_print_level" dsi:type="simple"><mi mathcolor="#800080" mathvariant="bold">options.print_level</mi></maction></math>&#160;<math xmlns="http://www.w3.org/1998/Math/MathML"><mo>=</mo></math>&#160;<b>Nag_PrintNotSet</b>, <b>Nag_Soln</b>, <b>Nag_Iter</b>, <b>Nag_Soln_Iter</b> or <b>Nag_Soln_Iter_Full</b>.</div>



<table width="100%" class="optparam"><tr><td class="optparam" style="width:45%" align="left"><a name="optparam_outfile" id="optparam_outfile"/><b>outfile</b> &#8211; 
  char[80]&#160;</td><td class="optparam" align="center"><i>Input</i></td><td class="optparam" style="width:45%" align="right"/></tr></table>

<div class="paramtext"><i>On entry</i>: name of file to which the results of monitoring the course of the optimization should be printed.  If <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mrow><mrow><maction actiontype="link" dsi:href="#optparam_outfile" dsi:type="simple"><mi mathcolor="#800080" mathvariant="bold">outfile</mi></maction><mfenced open="[" close="]"><mn>0</mn></mfenced></mrow></mrow>
 <mo>=</mo>
 <ms lquote="'" rquote="'"/>
 <mo>\</mo>
 <mn>0</mn>
 <ms lquote="'" rquote="'"/></math>&#160;then the <span class="mono">stdout</span> stream is used.</div>




<table width="100%" class="optparam"><tr><td class="optparam" style="width:45%" align="left"><a name="optparam_print_fun" id="optparam_print_fun"/><b>print_fun</b> &#8211; 
  pointer to function&#160;</td><td class="optparam" align="center"><i>Input</i></td><td class="optparam" style="width:45%" align="right"/></tr></table>

<div class="paramtext"><i>On entry</i>: printing function defined by the user; the prototype of <a class="optparamref" href="#optparam_print_fun">print_fun</a> is
<div class="paramtext"><span class="mono">void (*print_fun)(const Nag_UserPrintFun *bfx, Nag_Comm *Comm)</span>;</div>
<div class="paramtext">See Section <a class="secref" href="#printed-output">10.3.1</a> below for further details.</div>
</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"/></tr></table>

<div class="paramtext"><i>On entry</i>: <a class="optparamref" href="#optparam_cfixed">cfixed</a> must be set to <b>TRUE</b> if the constant <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>c</mi>
</math>&#160;is to remain fixed at its initial value, and to <b>FALSE</b> if it is to be estimated.</div>




<table width="100%" class="optparam"><tr><td class="optparam" style="width:45%" align="left"><a name="optparam_criteria" id="optparam_criteria"/><b>criteria</b> &#8211; 
  Nag_Likelihood&#160;</td><td class="optparam" align="center"><i>Input</i></td><td class="optparam" style="width:45%" align="right"/></tr></table>

<div class="paramtext"><i>On entry</i>: indicates the likelihood option for the estimation criterion.  <a class="optparamref" href="#optparam_criteria">criteria</a> must be set to <b>Nag_LeastSquares</b>, <b>Nag_Exact</b> or <b>Nag_Marginal</b>, to select the least-squares, exact or marginal likelihood, respectively.</div>

<div class="paramtext"><i>Constraint</i>:
  <math xmlns="http://www.w3.org/1998/Math/MathML"><maction actiontype="link" dsi:href="#optparam_criteria" dsi:type="simple"><mi mathcolor="#800080" mathvariant="bold">options.criteria</mi></maction></math>&#160;<math xmlns="http://www.w3.org/1998/Math/MathML"><mo>=</mo></math>&#160;<b>Nag_LeastSquares</b>, <b>Nag_Exact</b> or <b>Nag_Marginal</b>.</div>



<table width="100%" class="optparam"><tr><td class="optparam" style="width:45%" align="left"><a name="optparam_max_iter" id="optparam_max_iter"/><b>max_iter</b> &#8211; 
  Integer&#160;</td><td class="optparam" align="center"><i>Input</i></td><td class="optparam" style="width:45%" align="right"/></tr></table>

<div class="paramtext"><i>On entry</i>: the maximum required number of iterations.  If <math xmlns="http://www.w3.org/1998/Math/MathML">
 <maction actiontype="link" dsi:href="#optparam_max_iter" dsi:type="simple"><mi mathcolor="#800080" mathvariant="bold">max_iter</mi></maction><mo>=</mo><mn>0</mn>
</math>, no change is made to any of the model parameters in array <a class="argref" href="#para">para</a> except that the constant <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>c</mi>
</math>&#160;(if <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">FALSE</mi>
</math>) and any <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>&#969;</mi>
</math>&#160;relating to simple input series are estimated.  (Apart from these, estimates are always derived for the nuisance parameters relating to any backforecasts and any pre-observation period effects for transfer function inputs.)</div>

<div class="paramtext"><i>Constraint</i>:
  <math xmlns="http://www.w3.org/1998/Math/MathML">
 <maction actiontype="link" dsi:href="#optparam_max_iter" dsi:type="simple"><mi mathcolor="#800080" mathvariant="bold">options.max_iter</mi></maction><mo>&#8805;</mo><mn>0</mn>
</math>.</div>



<table width="100%" class="optparam"><tr><td class="optparam" style="width:45%" align="left"><a name="optparam_alpha" id="optparam_alpha"/><b>alpha</b> &#8211; 
  double&#160;</td><td class="optparam" align="center"><i>Input</i></td><td class="optparam" style="width:45%" align="right"/></tr></table>

<div class="paramtext"><i>On entry</i>: <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>&#945;</mi>
</math>, the value used to constrain the magnitude of the search procedure steps (see Section <a class="secref" href="#g13becsec33">3.3</a>).</div>

<div class="paramtext"><i>Constraint</i>:
  <math xmlns="http://www.w3.org/1998/Math/MathML">
 <maction actiontype="link" dsi:href="#optparam_alpha" dsi:type="simple"><mi mathcolor="#800080" mathvariant="bold">options.alpha</mi></maction><mo>&gt;</mo><mn>0.0</mn>
</math>.</div>



<table width="100%" class="optparam"><tr><td class="optparam" style="width:45%" align="left"><a name="optparam_beta" id="optparam_beta"/><b>beta</b> &#8211; 
  double&#160;</td><td class="optparam" align="center"><i>Input</i></td><td class="optparam" style="width:45%" align="right"/></tr></table>

<div class="paramtext"><i>On entry</i>: <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>&#946;</mi>
</math>, the multiplier which regulates the value of <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>&#945;</mi>
</math>&#160;(see Section <a class="secref" href="#g13becsec33">3.3</a>).</div>

<div class="paramtext"><i>Constraint</i>:
  <math xmlns="http://www.w3.org/1998/Math/MathML">
 <maction actiontype="link" dsi:href="#optparam_beta" dsi:type="simple"><mi mathcolor="#800080" mathvariant="bold">options.beta</mi></maction><mo>&gt;</mo><mn>1.0</mn>
</math>.</div>



<table width="100%" class="optparam"><tr><td class="optparam" style="width:45%" align="left"><a name="optparam_delta" id="optparam_delta"/><b>delta</b> &#8211; 
  double&#160;</td><td class="optparam" align="center"><i>Input</i></td><td class="optparam" style="width:45%" align="right"/></tr></table>

<div class="paramtext"><i>On entry</i>: <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>&#948;</mi>
</math>, the value of the stationarity and invertibility test tolerance factor (see Section <a class="secref" href="#g13becsec33">3.3</a>).</div>

<div class="paramtext"><i>Constraint</i>:
  <math xmlns="http://www.w3.org/1998/Math/MathML">
 <maction actiontype="link" dsi:href="#optparam_delta" dsi:type="simple"><mi mathcolor="#800080" mathvariant="bold">options.delta</mi></maction><mo>&#8805;</mo><mn>1.0</mn>
</math>.</div>



<table width="100%" class="optparam"><tr><td class="optparam" style="width:45%" align="left"><a name="optparam_gamma" id="optparam_gamma"/><b>gamma</b> &#8211; 
  double&#160;</td><td class="optparam" align="center"><i>Input</i></td><td class="optparam" style="width:45%" align="right"/></tr></table>

<div class="paramtext"><i>On entry</i>: <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>&#947;</mi>
</math>, the convergence criterion (see Section <a class="secref" href="#g13becsec33">3.3</a>).</div>

<div class="paramtext"><i>Constraint</i>:
  <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mn>0.0</mn>
 <mo>&#8804;</mo>
 <maction actiontype="link" dsi:href="#optparam_gamma" dsi:type="simple"><mi mathcolor="#800080" mathvariant="bold">options.gamma</mi></maction>
 <mo>&lt;</mo>
 <mn>1.0</mn>
</math>.</div>



<table width="100%" class="optparam"><tr><td class="optparam" style="width:45%" align="left"><a name="optparam_iter" id="optparam_iter"/><b>iter</b> &#8211; 
  Integer&#160;</td><td class="optparam" align="center"><i>Output</i></td><td class="optparam" style="width:45%" align="right"/></tr></table>

<div class="paramtext"><i>On exit</i>: the number of iterations carried out.  A value of <math xmlns="http://www.w3.org/1998/Math/MathML">
 <maction actiontype="link" dsi:href="#optparam_iter" dsi:type="simple"><mi mathcolor="#800080" mathvariant="bold">iter</mi></maction>
 <mo>=</mo>
 <mrow><mo>-</mo><mn>1</mn></mrow>
</math>&#160;on exit indicates that the only estimates obtained up to this point have been for the nuisance parameters relating to backforecasts, unless the marginal likelihood option is used in which case estimates have also been obtained for simple input coefficients <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>&#969;</mi>
</math>&#160;and for the constant <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>c</mi>
</math>&#160;(if <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">FALSE</mi>
</math>).  This value of <a class="optparamref" href="#optparam_iter">iter</a> usually indicates a failure in a consequent step of estimating transfer function input pre-observation period nuisance parameters.  A value of <math xmlns="http://www.w3.org/1998/Math/MathML">
 <maction actiontype="link" dsi:href="#optparam_iter" dsi:type="simple"><mi mathcolor="#800080" mathvariant="bold">iter</mi></maction><mo>=</mo><mn>0</mn>
</math>&#160;on exit indicates that estimates have been obtained up to this point for the constant <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>c</mi>
</math>&#160;(if <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">FALSE</mi>
</math>), for simple input coefficients <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>&#969;</mi>
</math>&#160;and for the nuisance parameters relating to the backforecasts and to transfer function input pre-observation period effects.</div>




<table width="100%" class="optparam"><tr><td class="optparam" style="width:45%" align="left"><a name="optparam_cm" id="optparam_cm"/><b>cm</b> &#8211; 
  double&#160;</td><td class="optparam" align="center"><i>Output</i></td><td class="optparam" style="width:45%" align="right"/></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="#npara" dsi:type="simple"><mi mathcolor="#EE0000" mathvariant="bold">npara</mi></maction><mo>&#215;</mo><maction actiontype="link" dsi:href="#npara" dsi:type="simple"><mi mathcolor="#EE0000" mathvariant="bold">npara</mi></maction>
</math>&#160;elements corresponding to <a class="argref" href="#npara">npara</a> rows by <a class="argref" href="#npara">npara</a> columns.  The <a class="argref" href="#npara">npara</a> rows and columns of <a class="optparamref" href="#optparam_cm">cm</a> contain the correlation coefficients relating to each pair of parameters in <a class="argref" href="#para">para</a>.  All coefficients relating to the constant will be zero if the constant is fixed.  However, if the function fails to invert the second derivative matrix, in which case <a class="argref" href="#fail">fail</a> will have an exit value of <a class="ifailref" href="#NE_MAT_NOT_POS_DEF">NE_MAT_NOT_POS_DEF</a>, then the contents of <a class="optparamref" href="#optparam_cm">cm</a> will be indeterminate.</div>




<table width="100%" class="optparam"><tr><td class="optparam" style="width:45%" align="left"><a name="optparam_res" id="optparam_res"/><b>res</b> &#8211; 
  double&#160;</td><td class="optparam" align="center"><i>Output</i></td><td class="optparam" style="width:45%" align="right"/></tr></table>

<div class="paramtext"><i>On exit</i>: the values of the residuals relating to the differenced values of the output series.  This pointer is allocated memory internally with <a class="optparamref" href="#optparam_lenres">options.lenres</a> elements.</div>




<table width="100%" class="optparam"><tr><td class="optparam" style="width:45%" align="left"><a name="optparam_lenres" id="optparam_lenres"/><b>lenres</b> &#8211; 
  Integer&#160;</td><td class="optparam" align="center"><i>Output</i></td><td class="optparam" style="width:45%" align="right"/></tr></table>

<div class="paramtext"><i>On exit</i>: the length of <a class="optparamref" href="#optparam_res">options.res</a>.</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"/></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="#nxxy" dsi:type="simple"><mi mathcolor="#EE0000" mathvariant="bold">nxxy</mi></maction>
 <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 <a class="argref" href="#nxxy">nxxy</a> rows by <math xmlns="http://www.w3.org/1998/Math/MathML">
 <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;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"/></tr></table>

<div class="paramtext"><i>On exit</i>: this pointer is allocated memory internally with <a class="argref" href="#nxxy">nxxy</a> 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>







<h3><a name="g13becsec93" id="g13becsec93"/>10.3&#160;&#160;Description of Printed Output</h3>

<div class="paramtext">The level of printed output can be controlled by the user with the structure members <a class="optparamref" href="#optparam_list">options.list</a> and <a class="optparamref" href="#optparam_print_level">options.print_level</a>, see section 7.2.  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">options.list</mi></maction><mo>=</mo><mi mathvariant="bold">TRUE</mi>
</math>&#160;then the parameter values to nag_tsa_multi_inp_model_estim (g13bec) are listed, whereas the printout of results is governed by the value of <a class="optparamref" href="#optparam_print_level">options.print_level</a>.  The default of <math xmlns="http://www.w3.org/1998/Math/MathML"><maction actiontype="link" dsi:href="#optparam_print_level" dsi:type="simple"><mi mathcolor="#800080" mathvariant="bold">options.print_level</mi></maction></math>&#160;<math xmlns="http://www.w3.org/1998/Math/MathML"><mo>=</mo></math>&#160;<b>Nag_Soln</b> which provides a printout of the final solution.  This section describes all of the possible levels of results printout available from nag_tsa_multi_inp_model_estim (g13bec).  When <math xmlns="http://www.w3.org/1998/Math/MathML"><maction actiontype="link" dsi:href="#optparam_print_level" dsi:type="simple"><mi mathcolor="#800080" mathvariant="bold">options.print_level</mi></maction></math>&#160;<math xmlns="http://www.w3.org/1998/Math/MathML"><mo>=</mo></math>&#160;<b>Nag_Iter</b> or <b>Nag_Soln_Iter</b> a single line of output is produced at each iteration, this gives the following values.
</div><table><tr>
<td style="width:10.5em;" valign="top">Iter</td>
<td valign="top">the current iteration number, <a class="optparamref" href="#optparam_iter">options.iter</a>.</td>
</tr><tr>
<td style="width:10.5em;" valign="top">Residual</td>
<td valign="top">the residual sum of squares, <a class="memberref" href="#printed-output_print_fun_rss">rss</a>.</td>
</tr><tr>
<td style="width:10.5em;" valign="top">Objf</td>
<td valign="top">the objective function at the latest set of parameter estimates.</td>
</tr></table><div class="paramtext">
When <math xmlns="http://www.w3.org/1998/Math/MathML"><maction actiontype="link" dsi:href="#optparam_print_level" dsi:type="simple"><mi mathcolor="#800080" mathvariant="bold">options.print_level</mi></maction></math>&#160;<math xmlns="http://www.w3.org/1998/Math/MathML"><mo>=</mo></math>&#160;<b>Nag_Soln_Iter_Full</b> a description and value for each of the parameters in the para array is output.  The descriptions are phi for <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>&#981;</mi>
</math>, theta for <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>&#952;</mi>
</math>, sphi for <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>&#934;</mi>
</math>.  stheta for <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>&#920;</mi>
</math>, omega/si for <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>&#969;</mi>
</math>&#160;in a simple input, omega for <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>&#969;</mi>
</math>&#160;in a transfer function input, <a class="optparamref" href="#optparam_delta">options.delta</a> for <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>&#948;</mi>
</math>&#160;and constant for <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>c</mi>
</math>.  In addition series 1, series 2, etc, indicate the input series relevant to the omega and <a class="optparamref" href="#optparam_delta">options.delta</a> parameters.</div>
<div class="paramtext">If <math xmlns="http://www.w3.org/1998/Math/MathML"><maction actiontype="link" dsi:href="#optparam_print_level" dsi:type="simple"><mi mathcolor="#800080" mathvariant="bold">options.print_level</mi></maction></math>&#160;<math xmlns="http://www.w3.org/1998/Math/MathML"><mo>=</mo></math>&#160;<b>Nag_Soln</b>, <b>Nag_Soln_Iter</b> or <b>Nag_Soln_Iter_Full</b> the final solution is printed out.  This consists of:</div>
<table><tr>
<td style="width:10.5em;" valign="top">i</td>
<td valign="top">the parameter number.</td>
</tr><tr>
<td style="width:10.5em;" valign="top">para[i]</td>
<td valign="top">the values of the parameter.</td>
</tr><tr>
<td style="width:10.5em;" valign="top">sd</td>
<td valign="top">the standard deviations.</td>
</tr><tr>
<td style="width:10.5em;" valign="top">options.iter</td>
<td valign="top">the number of iterations carried out.</td>
</tr><tr>
<td style="width:10.5em;" valign="top">rss</td>
<td valign="top">the residual sum of squares.</td>
</tr><tr>
<td style="width:10.5em;" valign="top">objf</td>
<td valign="top">the objective function.</td>
</tr><tr>
<td style="width:10.5em;" valign="top">df</td>
<td valign="top">the degrees of freedom.</td>
</tr></table>
<div class="paramtext">If <math xmlns="http://www.w3.org/1998/Math/MathML"><maction actiontype="link" dsi:href="#optparam_print_level" dsi:type="simple"><mi mathcolor="#800080" mathvariant="bold">options.print_level</mi></maction></math>&#160;<math xmlns="http://www.w3.org/1998/Math/MathML"><mo>=</mo></math>&#160;<b>Nag_NoPrint</b> then printout will be suppressed; the user can print the final solution when nag_tsa_multi_inp_model_estim (g13bec) returns to the calling program.</div>


<h4><a name="printed-output" id="printed-output"/>10.3.1&#160;&#160;Output of results via a user defined printing function</h4>

<div class="paramtext">The user may also specify their own print function for output of iteration results and the final solution by use of the <a class="optparamref" href="#optparam_print_fun">options.print_fun</a> function pointer, prototype</div>
<div class="paramtext">
</div><pre class="verbatim">void (*print_fun) (const Nag_UserPrintFun *bfx, Nag_Comm *Comm);</pre><div class="paramtext">
</div>
<div class="paramtext">The rest of this section can be skipped if the default printing facilities provide the required functionality.  When a user-defined function is assigned to <a class="optparamref" href="#optparam_print_fun">options.print_fun</a> this will be called in preference to the internal print function of nag_tsa_multi_inp_model_estim (g13bec).  Calls to the user-defined function are again controlled by means of the <a class="optparamref" href="#optparam_print_level">options.print_level</a> member.  Information is provided through two structure arguments to <a class="optparamref" href="#optparam_print_fun">options.print_fun</a>, the structure of type <b>Nag_UserPrintFun</b> contains the following members relevant to nag_tsa_multi_inp_model_estim (g13bec):</div>

<dl>

<dt class="memberhead"><a name="printed-output_print_fun_itc" id="printed-output_print_fun_itc"/><b>itc</b> &#8211; Integer&#160;*<span class="pclass"/></dt><dd>
<div class="membertext">the number of the particular iteration being monitored.</div>
</dd>

</dl>
<dl>
<dt class="memberhead"><a name="printed-output_print_fun_rss" id="printed-output_print_fun_rss"/><b>rss</b> &#8211; double&#160;<span class="pclass"/></dt><dd>
<div class="membertext">the residual sum of squares, <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>S</mi>
</math>, at the latest set of valid parameter estimates.</div>
</dd>

</dl>
<dl>
<dt class="memberhead"><a name="printed-output_print_fun_objf" id="printed-output_print_fun_objf"/><b>objf</b> &#8211; double&#160;<span class="pclass"/></dt><dd>
<div class="membertext">the objective function, <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>D</mi>
</math>, at the latest set of valid parameter estimates.</div>
</dd>

</dl>
<dl>
<dt class="memberhead"><a name="printed-output_print_fun_para" id="printed-output_print_fun_para"/><b>para</b> &#8211; double&#160;<span class="pclass"/></dt><dd>
<div class="membertext">the pointer to memory containing <a class="memberref" href="#printed-output_print_fun_npara">npara</a> latest values of the estimates of the multi-input model parameters.</div>
</dd>

</dl>
<dl>
<dt class="memberhead"><a name="printed-output_print_fun_npara" id="printed-output_print_fun_npara"/><b>npara</b> &#8211; Integer&#160;*<span class="pclass"/></dt><dd>
<div class="membertext">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>&#160;and <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>c</mi>
</math>&#160;parameters.</div>
</dd>

</dl>
<dl>
<dt class="memberhead"><a name="printed-output_print_fun_npe" id="printed-output_print_fun_npe"/><b>npe</b> &#8211; Integer&#160;*<span class="pclass"/></dt><dd>
<div class="membertext">the number of 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>, <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>&#920;</mi>
</math>), omega <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mfenced separators=""><mi>&#969;</mi></mfenced>
</math>, <a class="optparamref" href="#optparam_delta">options.delta</a> <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mfenced separators=""><mi>&#948;</mi></mfenced>
</math>, and <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>c</mi>
</math>&#160;parameters being estimated.</div>
</dd>

</dl>
<dl>
<dt class="memberhead"><a name="printed-output_print_fun_mtyp" id="printed-output_print_fun_mtyp"/><b>mtyp</b> &#8211; Integer&#160;*<span class="pclass"/></dt>
<dt class="multi-memberhead"><a name="printed-output_print_fun_mser" id="printed-output_print_fun_mser"/><b>mser</b> &#8211; Integer&#160;*<span class="pclass"/></dt><dd>
<div class="paramtext">the pointers to memory, each with <a class="memberref" href="#printed-output_print_fun_npe">npe</a> elements.  The value of each element in <a class="memberref" href="#printed-output_print_fun_mtyp">mtyp</a> and <a class="memberref" href="#printed-output_print_fun_mser">mser</a> corresponds to the description of each parameter estimated in <a class="memberref" href="#printed-output_print_fun_para">para</a>.  The following should be read in conjuction with the description of the parameter <b>print</b>.  The relevant description for the value of <a class="memberref" href="#printed-output_print_fun_para">para</a> is:
</div><div><table style="align:center" cellpadding="4">
  
  
  
  <tbody>
   <tr>
    <td class="libdoc" valign="top" align="center"><math xmlns="http://www.w3.org/1998/Math/MathML">
 <mrow><mrow><maction actiontype="link" dsi:href="#printed-output_print_fun_mtyp" dsi:type="simple"><mi mathcolor="#FF00FF" mathvariant="bold">mtyp</mi></maction><mfenced open="[" close="]"><mi>i</mi></mfenced></mrow></mrow>
</math></td>
    <td class="libdoc" valign="top" align="left"><b>Description</b></td>
   </tr><tr>
    <td class="libdoc" valign="top" align="center">1</td>
    <td class="libdoc" valign="top" align="left">phi</td>
   </tr><tr>
    <td class="libdoc" valign="top" align="center">2</td>
    <td class="libdoc" valign="top" align="left">theta</td>
   </tr><tr>
    <td class="libdoc" valign="top" align="center">3</td>
    <td class="libdoc" valign="top" align="left">sphi</td>
   </tr><tr>
    <td class="libdoc" valign="top" align="center">4</td>
    <td class="libdoc" valign="top" align="left">stheta</td>
   </tr><tr>
    <td class="libdoc" valign="top" align="center">5</td>
    <td class="libdoc" valign="top" align="left">omega/si</td>
    <td class="libdoc" valign="top" align="left">series <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mrow><mrow><maction actiontype="link" dsi:href="#printed-output_print_fun_mser" dsi:type="simple"><mi mathcolor="#FF00FF" mathvariant="bold">mser</mi></maction><mfenced open="[" close="]"><mi>i</mi></mfenced></mrow></mrow>
</math></td>
   </tr><tr>
    <td class="libdoc" valign="top" align="center">6</td>
    <td class="libdoc" valign="top" align="left">omega</td>
    <td class="libdoc" valign="top" align="left">series <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mrow><mrow><maction actiontype="link" dsi:href="#printed-output_print_fun_mser" dsi:type="simple"><mi mathcolor="#FF00FF" mathvariant="bold">mser</mi></maction><mfenced open="[" close="]"><mi>i</mi></mfenced></mrow></mrow>
</math></td>
   </tr><tr>
    <td class="libdoc" valign="top" align="center">7</td>
    <td class="libdoc" valign="top" align="left"><a class="optparamref" href="#optparam_delta">options.delta</a></td>
    <td class="libdoc" valign="top" align="left">series <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mrow><mrow><maction actiontype="link" dsi:href="#printed-output_print_fun_mser" dsi:type="simple"><mi mathcolor="#FF00FF" mathvariant="bold">mser</mi></maction><mfenced open="[" close="]"><mi>i</mi></mfenced></mrow></mrow>
</math></td>
   </tr><tr>
    <td class="libdoc" valign="top" align="center">8</td>
    <td class="libdoc" valign="top" align="left">constant</td>
   </tr>
  </tbody>
 </table></div><div class="paramtext">
</div>
<div class="membertext">for <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>i</mi>
 <mo>=</mo>
 <mn>0</mn>
 <mo>,</mo>
 <mn>1</mn>
 <mo>,</mo>
 <mo>&#8230;</mo>
 <mo>,</mo>
 <maction actiontype="link" dsi:href="#printed-output_print_fun_npe" dsi:type="simple"><mi mathcolor="#FF00FF" mathvariant="bold">npe</mi></maction></math>.  For the phi, theta, sphi, stheta and constant parameters, <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mrow><mrow><maction actiontype="link" dsi:href="#printed-output_print_fun_mser" dsi:type="simple"><mi mathcolor="#FF00FF" mathvariant="bold">mser</mi></maction><mfenced open="[" close="]"><mi>i</mi></mfenced></mrow></mrow>
 <mo>=</mo>
 <mn>0</mn>
</math>.</div>
</dd>

</dl>
<dl>
<dt class="memberhead"><a name="printed-output_print_fun_sd" id="printed-output_print_fun_sd"/><b>sd</b> &#8211; double&#160;<span class="pclass"/></dt><dd>
<div class="membertext">the pointer to memory containing the npara values of the standard deviations.</div>
</dd>

</dl>
<dl>
<dt class="memberhead"><a name="printed-output_print_fun_df" id="printed-output_print_fun_df"/><b>df</b> &#8211; double&#160;<span class="pclass"/></dt><dd>
<div class="membertext">the number of degrees of freedom associated with <span class="italic">S</span>.</div>
</dd>

</dl>







<h2><a name="g13becsec10" id="g13becsec10"/>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_estim (g13bec).</div>
<div class="paramtext">The data in the example relate to the same 40 observations of an output time series and of a single input time series as in Example 1.  The noise series has one autoregressive <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mfenced separators=""><mi>&#981;</mi></mfenced>
</math>&#160;and one seasonal moving average <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mfenced separators=""><mi>&#920;</mi></mfenced>
</math>&#160;parameter (both of which are initially set to zero) for which the seasonal period is 4.  The input series is defined by orders <math xmlns="http://www.w3.org/1998/Math/MathML">
 <msub>
  <mi>b</mi>
  <mn>1</mn>
 </msub>
 <mo>=</mo>
 <mn>1</mn>
</math>, <math xmlns="http://www.w3.org/1998/Math/MathML">
 <msub>
  <mi>q</mi>
  <mn>1</mn>
 </msub>
 <mo>=</mo>
 <mn>0</mn>
</math>, <math xmlns="http://www.w3.org/1998/Math/MathML">
 <msub>
  <mi>p</mi>
  <mn>1</mn>
 </msub>
 <mo>=</mo>
 <mn>1</mn>
</math>, <math xmlns="http://www.w3.org/1998/Math/MathML">
 <msub>
  <mi>r</mi>
  <mn>1</mn>
 </msub>
 <mo>=</mo>
 <mn>3</mn>
</math>, so that it has one <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>&#969;</mi>
</math>&#160;(initially set to 2.0) and one <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>&#948;</mi>
</math>&#160;(initially set to 0.5), and allows for pre-observation period effects.  The constant (initially set to zero) is to be estimated so that the flag for the constant <math xmlns="http://www.w3.org/1998/Math/MathML">
 <mi>c</mi>
</math>, <a class="optparamref" href="#optparam_cfixed">options.cfixed</a>, remains unchanged from its default value of <b>FALSE</b>.  Default values of <b>zsp</b> are used.  Up to 20 iterations are allowed so that <a class="optparamref" href="#optparam_max_iter">options.max_iter</a> is set to 20, and the progress of these is monitored and solution output by setting <math xmlns="http://www.w3.org/1998/Math/MathML"><maction actiontype="link" dsi:href="#optparam_print_level" dsi:type="simple"><mi mathcolor="#800080" mathvariant="bold">options.print_level</mi></maction></math>&#160;<math xmlns="http://www.w3.org/1998/Math/MathML"><mo>=</mo></math>&#160;<b>Nag_Soln_Iter_Full</b>.  Marginal likelihood is the chosen estimation criterion so that <math xmlns="http://www.w3.org/1998/Math/MathML"><maction actiontype="link" dsi:href="#optparam_criteria" dsi:type="simple"><mi mathcolor="#800080" mathvariant="bold">options.criteria</mi></maction></math>&#160;<math xmlns="http://www.w3.org/1998/Math/MathML"><mo>=</mo></math>&#160;<b>Nag_Marginal</b>.</div>
<div class="paramtext">After the successful call to nag_tsa_multi_inp_model_estim (g13bec), the following are computed and printed out: the correlation matrix, the residuals for the 36 differenced values and the 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>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/g13bece.c">Program Text (g13bece.c)</a></div>





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

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





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

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


<hr/><div><a href="../../pdf/G13/g13bec.pdf">g13bec (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>