lagplot: Lagged Regression Plot

Description Usage Arguments Value Author(s) References Examples

View source: R/lagplot.R

Description

Computes and plots the nonparametric regression function of a time series against its various lags.

Usage

1
lagplot(x, lag.max = 6, deg = 1, nn = 0.7, method = c("locfit", "gam", "both")[1])

Arguments

x

time series

lag.max

maximum lag

deg

degree of local polynomial, needed only for the locfit method

nn

fraction of nearest data contained in a window, needed only for the locfit method

method

Two methods for nonparametric estimation: "locfit" is the default which uses the local polynomial approach via the locfit library to estimate the conditional mean function of E(X_t|X_{t-k}=x) for 1≤ k ≤ lag.max; Another method is GAM, via the mgcv library.

Value

Side effects: The nonparametric lagged regression functions are plotted lag by lag, with the raw data superimposed on the plots.

Author(s)

Kung-Sik Chan

References

"Time Series Analysis, with Applications in R" by J.D. Cryer and K.S. Chan

Examples

1
2
3
4
set.seed(2534567)
par(mfrow=c(3,2))
y=arima.sim(n=61,model=list(ar=c(1.6,-0.94),ma=-0.64))
# lagplot(y)

TSA documentation built on July 2, 2018, 1:04 a.m.