cable.ar.p.diag(ar.p.fit, resid.type = "p", xlab = "time", ylab = "",
main = NULL, main.all = NULL, ctp.ci = NULL)
cable.ar.p.iter
object for AR(p) data, p>0. type
argument for the plot
function; used to control the way fitted residuals and
innovations are displayed. Default is "p"
for
points. cable.change.conf
object. cable.ar.p.plot
and
cable.ar.p.resid
.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
.
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 )
Run the code above in your browser using DataLab