# Description of the program: ar-model

This program fits a simple autoregressive (AR) model to the data. The model is given by the equation

> xn=a1xn-1+...+apxn-p + noise.

The output file contains the coefficients of the model and the residuals. Note that now the mean is subtracted first, conforming with common practice. If you want to run the resulting model to generate a time series, you can pipe the output to ar-run. Note that no attempt has been made to generate a stable model.

## Usage:

ar-model [Options]

Everything not being a valid option will be interpreted as a potential datafile name. Given no datafile at all, means read stdin. Also - means stdin

Possible options are:

Option | Description | Default
--- | --- | ---
-l# | number of data to use | whole file
-x# | number of lines to be ignored | 0
-c# | column to be read | 1
-p# | order of the model | 5
-o# | output file name | without file name: 'datafile'.ar (or stdin.ar if stdin was used) if no -o is given stdout is used
-V# | verbosity level 0: only panic messages 1: add input/output messages | 1
-h | show these options | none

## Description of the Output:

The first line is just the average forecast error of the model, the next p lines contain the AR coefficients and the rest of the file are the individual errors (residuals), not the forecasted values.

View the C-sources

Table of Contents * TISEAN home