# [R] Autoregressive Model with Independent Variable

Prof Brian Ripley ripley at stats.ox.ac.uk
Thu Mar 2 08:03:57 CET 2006

```On Wed, 1 Mar 2006, Janusz Kawczak wrote:

> It looks like just simple ARMA model; there is no visible I-part
> in Jarrett's specification. Unless it's hidden in the '...' part :)

If it were an ARMA model, x would be (unknown) white noise but we were
told its [integer] values. So in no useful sense is it an ARMA model.

Without an error term, this is a set of linear equations.  With a
white-noise error term, this would be an AR model with an exogeneous
input, as handled by arima().

>
> Janusz.
>
> On Wed, 1 Mar 2006, Dirk Eddelbuettel wrote:
>>
>> On 1 March 2006 at 20:06, Jarrett Byrnes wrote:
>> | Hey, all, I may just be missing something, but I'm trying to construct
>> | a temporal autoregression with an independant variable other than just
>> | what is happened at a previous point in time.  So, the model structure
>> | would be something like
>> |
>> | y(t)=b0+b1*y(t-1)+b2*y(t-2)...+a*x(t)
>> |
>> | I'm even considering a model of
>> |
>> | y(t)=b0+b1*y(t-1)+b2*y(t-2)...+a1*x(t)+a2*x(t-1)...
>> |
>> | So, my data looks like
>> |
>> | Time		y 	x
>> | 1		4	6
>> | 2		5	10
>> | 3		10	1
>> | etc.
>> |
>> | When looking at ar() and similar methods, however, it seemed that the
>> | input was a single vector - say, in this case, the value y.  Is there a
>> | method that allows me to specify an explicit model that would then
>> | incorporate x?
>>
>> Yes: arima(), see in particular the xreg argument.
>>
>> Dirk
>>
>>
>> --
>> Hell, there are no rules here - we're trying to accomplish something.
>>                                                   -- Thomas A. Edison
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
>

--
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

```