<?xml version="1.0" encoding="UTF-8"?>

<!--
 *
 * This help file was generated from autoreg_matrix.sci using help_from_sci().
 *
 -->

<refentry version="5.0-subset Scilab" xml:id="autoreg_matrix" xml:lang="en"
          xmlns="http://docbook.org/ns/docbook"
          xmlns:xlink="http://www.w3.org/1999/xlink"
          xmlns:svg="http://www.w3.org/2000/svg"
          xmlns:ns3="http://www.w3.org/1999/xhtml"
          xmlns:mml="http://www.w3.org/1998/Math/MathML"
          xmlns:scilab="http://www.scilab.org"
          xmlns:db="http://docbook.org/ns/docbook">

  <refnamediv>
    <refname>autoreg_matrix</refname>
    <refpurpose>Generate a regressor matrix for autoregressions from a time series.</refpurpose>
  </refnamediv>


<refsynopsisdiv>
   <title>Syntax</title>
   <synopsis>
   x = autoreg_matrix(y, k)
   
   </synopsis>
</refsynopsisdiv>

<refsection>
   <title>Parameters</title>
   <variablelist>
        <varlistentry>
            <term>y:</term>
            <listitem><para> Vector. Input time series.</para></listitem>
        </varlistentry>
        <varlistentry>
            <term>k:</term>
            <listitem><para> Scalar. Number of lagged values to include.</para></listitem>
        </varlistentry>
   </variablelist>
</refsection>

<refsection>
   <title>Description</title>
   <para>
Given a time series (vector) `y`, this function returns a matrix with ones in the first column and the first `k` lagged values of `y` in the other columns.
For T &gt; k, `[1, y(T-1), ..., y(T-k)]` is the t-th row of the result. The resulting matrix can be used as a regressor matrix in autoregressions.
   </para>
   <para>
</para>
</refsection>

<refsection>
   <title>Examples</title>
   <programlisting role="example"><![CDATA[
autoreg_matrix([1, 2, 3], 2)

   ]]></programlisting>
</refsection>
</refentry>
