| cable.ar.p.diag | R Documentation |
ACF, PACF, and other plots are produced for diagnosing an AR(p) bent-cable fit when p>0.
cable.ar.p.diag(ar.p.fit, resid.type = "p", xlab = "time", ylab = "", main = NULL, main.all = NULL, ctp.ci = NULL)
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 |
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.
See the warnings from cable.ar.p.plot and
cable.ar.p.resid.
This function is intended for internal use by bentcable.ar.
Grace Chiu
See the bentcableAR package references.
cable.lines, plot, par,
acf, pacf
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 )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.