tvAR: Estimate Time-Varying Coefficient AR Models

Description Usage Arguments Value Examples

Description

Estimate time-varying coefficient AR models.

Usage

1
tvAR(x, lags = c(1), include.mean = TRUE)

Arguments

x

a time series of data.

lags

the lagged variables used, e.g. lags=c(1,3) means lag-1 and lag-3 are used as regressors. It is more flexible than specifying an order.

include.mean

a logical value indicating whether the constant terms are included.

Value

trAR function returns the value from function dlmMLE.

Examples

1
2
3
4
5
6
7
8
t=50
x=rnorm(t)
phi1=matrix(0.4,t,1)
for (i in 2:t){
   phi1[i]=0.7*phi1[i-1]+rnorm(1,0,0.1)
	x[i]=phi1[i]*x[i-1]+rnorm(1)
}
est=tvAR(x,1)

ConvFuncTimeSeries/test_t documentation built on May 29, 2019, 1:39 p.m.