# tvar

##### Time Varying Coefficients AR Model

Estimate time varying coefficients AR model.

- Keywords
- ts

##### Usage

```
tvar(y, trend.order = 2, ar.order = 2, span, outlier = NULL, tau2.ini = NULL,
delta, plot = TRUE)
```

##### Arguments

- y
a univariate time series.

- trend.order
trend order (1 or 2).

- ar.order
AR order.

- span
local stationary span.

- outlier
positions of outliers.

- tau2.ini
initial estimate of variance of the system noise \(\tau^2\). If

`tau2.ini`

=`NULL`

, the most suitable value is chosen in \(\tau^2 = 2^{-k}\).- delta
search width.

- plot
logical. If

`TRUE`

(default), '`parcor`

' is plotted.

##### Details

The time-varying coefficients AR model is given by

$$y_t = a_{1,t}y_{t-1} + \ldots + a_{p,t}y_{t-p} + u_t$$

where \(a_{i,t}\) is \(i\)-lag AR coefficient at time \(t\) and \(u_t\) is a zero mean white noise.

The time-varying spectrum can be plotted using AR coefficient `arcoef`

and variance of the observational noise `sigma2`

by plot.tvspc
(see tvspc).

##### Value

time varying AR coefficients.

variance of the observational noise \(\sigma^2\).

variance of the system noise \(\tau^2\).

log-likelihood of the model.

AIC.

partial autocorrelation coefficient.

##### References

Kitagawa, G. (2010)
*Introduction to Time Series Modeling*. Chapman & Hall/CRC.

Kitagawa, G. and Gersch, W. (1996)
*Smoothness Priors Analysis of Time Series*.
Lecture Notes in Statistics, No.116, Springer-Verlag.

Kitagawa, G. and Gersch, W. (1985)
*A smoothness priors time varying AR coefficient modeling of
nonstationary time series*. IEEE trans. on Automatic Control, AC-30, 48-56.

##### Examples

```
# NOT RUN {
# seismic data
data(MYE1F)
z <- tvar(MYE1F, trend.order = 2, ar.order = 8, span = 20,
outlier = c(630, 1026), tau2.ini = 6.6e-06, delta = 1.0e-06)
z
spec <- tvspc(z$arcoef, z$sigma2)
plot(spec, theta = 30, phi = 40, expand = 0.5)
# }
```

*Documentation reproduced from package TSSS, version 1.2.3, License: GPL (>= 2)*