plot.lacv {costat} | R Documentation |
Plot localized autocovariance (lacv) object.
Description
Produces various ways of looking at a localized autocovariance (lacv) object.
Usage
## S3 method for class 'lacv'
plot(x, plotcor = TRUE, type = "line",
lags = 0:min(as.integer(10 * log10(nrow(x$lacv))), ncol(x$lacv) - 1),
tcex = 1, lcol = 1, llty = 1, the.time = NULL, ...)
Arguments
x |
The localized autocovariance object you want to plot (lacv) |
plotcor |
If TRUE then plot autocorrelations, otherwise plot autocovariances. |
type |
The lacv objects are fairly complex and so there are
different ways you can plot them. The |
lags |
The |
tcex |
In the |
lcol |
Controls the colours of the lines in the |
llty |
Controls the line types of the lines in the |
the.time |
If the |
... |
Other arguments to plot. |
Details
This function produces pictures of the
two-dimensional time-varying autocovariance
or autocorrelation, c(t, \tau)
,
of a locally stationary time series.
There are three types of plot depending on the argument to
the type
argument.
The line
plot draws the autocorrelations as a series of
lines, one for each lag, as lines over time. E.g. a sequence
#of lines c(t, \tau_i)
is drawn, one for each \tau_i
.
The zeroth lag line is the autocorrelation at lag 0 which is
always 1. By default all the lags are drawn which can result
in a confusing picture. Often, one is only interested in the low
level lags, so only these can be plotted by changing the lags
argument and any selection of lags can be plotted. The colour
and line type of the plotted lines can be changed with the
lcol
and the llty
arguments.
The acf
plot produces pictures similar to the standard
R acf()
function plot. However, the regular acf is a
1D function, since it is defined to be constant over all time.
The time-varying acf supplied to this function is not constant
over all time (except for stationary processes, theoretically).
So, this type of plot requires the user to specify a fixed
time at which to produce the plot, and this is supplied by
the the.time
argument.
The persp
plot plots the 2D function c(t, \tau)
as a perspective plot.
Value
For the acf
type plot the acf values are returned
invisibly. For the other types nothing is returned.
Author(s)
G.P. Nason
References
Cardinali, A. and Nason, Guy P. (2013) Costationarity of Locally Stationary Time Series Using costat. Journal of Statistical Software, 55, Issue 1.
Cardinali, A. and Nason, G.P. (2010) Costationarity of locally stationary time series. J. Time Series Econometrics, 2, Issue 2, Article 1.
See Also
Examples
#
# Make some dummy data, e.g. white noise
#
v <- rnorm(256)
#
# Compute the localized autocovariance (ok, the input is stationary
# but this is just an example. More interesting things could be achieved
# by putting the results of simulating from a LSW process, or piecewise
# stationary by concatenating different stationary realizations, etc.
#
vlacv <- lacv(v, lag.max=30)
#
# Now let's do some plotting of the localized autocovariance
#
## Not run: plot(vlacv, lags=0:6)
#
# Should get a plot where lag 0 is all up at value 1, and all other
# autocorrelations are near zero (since its white noise).
#
#
# How about just looking at lags 0, 2 and 4, and some different colours.
#
## Not run: plot(vlacv, lags=c(0,2,4), lcol=c(1,2,3))
#
# O.k. Let's concentrate on time t=200, let's look at a standard acf
# plot near there.
#
## Not run: plot(vlacv, type="acf", the.time=200)
#
# Now plot the autocovariance, rather than the autocorrelation.
#
## Not run: plot(vlacv, type="acf", the.time=200, plotcor=FALSE)
#
# Actually, the plot doesn't look a lot different as the series is white
# noise, but it is different if you look closely.