| cable.ar.p.diag {bentcableAR} | R Documentation |
Bent-Cable AR(p>0) Diagnostics
Description
ACF, PACF, and other plots are produced for diagnosing an AR(p) bent-cable fit when p>0.
Usage
cable.ar.p.diag(ar.p.fit, resid.type = "p", xlab = "time", ylab = "",
main = NULL, main.all = NULL, ctp.ci = NULL)
Arguments
ar.p.fit |
A |
resid.type |
A |
xlab |
Character string: x-axis label. |
ylab |
Character string: y-axis label. |
main |
Character string: title for the time series plot. |
main.all |
Character string: title for the entire set of plots. |
ctp.ci |
A |
Details
This function splits the plotting canvas into several panels. For
one panel, ar.p.fit is fed to cable.ar.p.plot that
produces a scatterplot of the data and overlays on it the fitted
bent cable with the estimated transition. The optioinal
ctp.ci is also fed to cable.ar.p.plot to add the
CTP confidence interval to the same panel. Additionally,
ar.p.fit is fed to cable.ar.p.resid to extract the
fitted residuals and innovations, which are then plotted in
separate panels that again show the estimated transition and
confidence interval. Finally, four panels show ACF and PACF
diagnostics for the fitted residuals and innovations, via the
built-in R functions acf and pacf.
Warning
See the warnings from cable.ar.p.plot and
cable.ar.p.resid.
Note
This function is intended for internal use by bentcable.ar.
Author(s)
Grace Chiu
References
See the bentcableAR package references.
See Also
cable.lines, plot, par,
acf, pacf
Examples
data(sockeye)
# AR(2) cable fit
fit.ar2 <- cable.ar.p.iter( c(13,.1,-.5,11,4,.5,-.5),
sockeye$logReturns, tol=1e-4 )
cable.ar.p.diag( fit.ar2, main="bent cable", main.all="Sockeye",
ctp.ci=cable.change.conf( fit.ar2, .9 ) )
# compare to this:
# fit.ar2 <- bentcable.ar( sockeye$logReturns,
# init.cable=c(13,.1,-.5,11,4), p=2, main="Sockeye bent cable",
# ci.level=.9 )
# AR(4) stick fit
fit.ar4 <- cable.ar.p.iter( c(13,.1,-.5,11,.5,-.5,.5,-.5),
sockeye$logReturns, tol=1e-4, stick=TRUE )
cable.ar.p.diag( fit.ar4, ctp.ci=cable.change.conf( fit.ar4, .95 ) )
# compare to this:
# fit.ar4 <- bentcable.ar( sockeye$logReturns,
# init.cable=c(13,.1,-.5,11), p=4, stick=TRUE )