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 lpacf class object you wish to plot.

type

The type of plot you want. This can be "line" where each partial autocorrelation is plotted as a line over time, or "persp" where the partial autocorrelation across time and lag is plotted or "acf" where a regular-style plot is drawn, like the one produced by the standard R acf function, and this is the partial autocorrelation fixed at a given point in time.

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 type="line" plot integers are displayed along the lines of their corresponding partial autocorrelations. This parameter controls the scaling of the lag numbers.

lcol

A vector of colors, the same length as the lags vector which controls the colour of each line corresponding to each partial autocorrelation line.

llty

As for lcol but the line types of each line.

the.time

A time has to be specified for the type="acf" plot, as this argument supplies it.

plot.it

If TRUE a plot is produced. If FALSE then no plot is produced but the function still executes and produces the same (invisible) output.

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

lpacf

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)

[Package lpacf version 1.0.1 Index]