plot.lpacf {lpacf} | R Documentation |
Plot localized partial autocorrelation information in an
lpacf
object.
Description
Plots information contained within a lpacf
object.
Plot arrangement and options are similar to that in plot.lacf
in the locits
package.
Usage
## S3 method for class 'lpacf'
plot(x, type = "line", lags = 1:min(as.integer(10 * log10(nrow(x$lpacf))),
ncol(x$lpacf) - 1), tcex = 1, lcol = 1, llty = 1, the.time = NULL, plot.it = TRUE,
xlab, ylab, ...)
Arguments
x |
The |
type |
The type of plot you want. This can be |
lags |
A vector of integers containing the lags you wish to show. Note that, unlike regular autocorrelation, the smallest lag is lag one. |
tcex |
For the |
lcol |
A vector of colors, the same length as the |
llty |
As for |
the.time |
A time has to be specified for the |
plot.it |
If |
xlab |
A label for the x-axis. |
ylab |
A label for the y-axis |
... |
Other arguments to plot. |
Details
Produces a graphical representation of localized partial autocorrelation.
Value
The localized partial autocorrelation values are returned.
Essentially the ones that are, or would have been, plotted are
returned. The lags can be selected using the lags
argument.
A matrix is returned: each row corresponds to a time point, each
column corresponds to a lag. All time points are returned.
Only the lags specified in the lags
component are returned.
The dimnames
component indicates which lags were returned.
Note
This function was adapted from plot.lacf
from the locits
package.
Author(s)
Guy Nason
References
Killick, R., Knight, M. I., Nason, G.P. and Eckley, I. A. (2020) The local partial autocorrelation function and some applications. Electron. J. Statist. 14 (2), 3268-3314. DOI: 10.1214/20-EJS1748.
See Also
Examples
#
# Generate a test series
#
x.test <- tvar2sim()
#
# Compute its localized partial autocorrelation
#
x.lpacf <- lpacf(x.test)
#
# Perform a line plot of the localized partial autocorrelation of x
# draw the lags in colours 1 thru 5
#
#
plot(x.lpacf, lags=1:5, lcol=1:5)
#
# Now produce the same plot, but omit lag 3
#
plot(x.lpacf, lags=c(1,2,4,5), lcol=c(1,2,4,5))
#
# Now plot localized autocovariance around time 175 using the regular acf
# style plot.
#
plot(x.lpacf, type="acf", the.time=175)