tvARFiSm: Filtering and Smoothing for Time-Varying AR Models

tvARFiSmR Documentation

Filtering and Smoothing for Time-Varying AR Models

Description

This function performs forward filtering and backward smoothing for a fitted time-varying AR model with parameters in 'par'.

Usage

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

Arguments

x

a time series of data.

lags

the lag of AR order.

include.mean

a logical value indicating whether the constant terms are included.

par

the fitted time-varying AR models. It can be an object returned by function. tvAR.

Value

trARFiSm function return values returned by function dlmFilter and dlmSmooth.

Examples

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)
tvARFiSm(x,1,FALSE,est$par)

NTS documentation built on Sept. 25, 2023, 1:08 a.m.

Related to tvARFiSm in NTS...