X = arf(X,A,Z,RANGE,...)
X
[ tseries ] - Input data from which initial condition will be taken.
A
[ numeric ] - Vector of coefficients of the autoregressive polynomial.
Z
[ numeric | tseries ] - Exogenous input or constantn in the autoregressive process.
RANGE
[ numeric | Inf ] - Date range on which the new time series observations will be computed; RANGE
does not include pre-sample initial condition. Inf
means the entire possible range will be used (taking into account the length of pre-sample initial condition needed).
X
[ tseries ] - Output data with new observations created by running an autoregressive process described by A
and Z
.The autoregressive process has one of the following forms:
a1*x + a2*x(-1) + ... + an*x(-n) = z,
or
a1*x + a2*x(+1) + ... + an*x(+n) = z,
depending on whether the range is increasing (running forward in time), or decreasing (running backward in time). The coefficients a1
,...an
are gathered in the A
vector,
A = [a1,a2,...,an].
The following two lines create an autoregressive process constructed from normally distributed residuals,
$$ x_t = \rho x_{t-1} + \epsilon_t $$
rho = 0.8;
X = tseries(1:20,@randn);
X = arf(X,[1,-rho],X,2:20);