ts.diag.summary: Time Series Diagnostic Plots for AR Models

View source: R/ts.diag.summary.R

ts.diag.summaryR Documentation

Time Series Diagnostic Plots for AR Models

Description

Plots the time series and predicted values together, a time series plot of the residuals, a plot of the ACF function of the residuals, and a normal Q-Q plot of the residusls.

Usage

ts.diag.summary(ts.fit, data.tsd, all.on.one = TRUE)

Arguments

ts.fit

Results object from an lm fit of an autoregressive model.

data.tsd

Time series data object corresponding to the AR model that was fit.

all.on.one

If TRUE, all of the plot will be included in one frame. Fefault is TRUE.

Examples

spotlag.frame <- as.data.frame(cbind(Spot=c(spot.tsd,NA,NA,NA,NA),
                                     Spot1=c(NA,spot.tsd,NA,NA,NA),
                                     Spot2=c(NA,NA,spot.tsd,NA,NA),
                                     Spot3=c(NA,NA,NA,spot.tsd,NA),
                                     Spot4=c(NA,NA,NA,NA,spot.tsd)))
spot.ar1.fit <- lm(Spot ~ Spot1, data=spotlag.frame)
ts.diag.summary(spot.ar1.fit, data.tsd=spot.tsd)
spot.ar1.fit <- lm(Spot ~ Spot1, data=spotlag.frame)
ts.diag.summary(spot.ar1.fit, data.tsd=spot.tsd)
spot.ar2.fit <- lm(Spot ~ Spot1 + Spot2, data=spotlag.frame)
ts.diag.summary(spot.ar2.fit, data.tsd=spot.tsd)


wqmeeker/RTseries documentation built on Dec. 31, 2022, 10 a.m.