| slMatrix-class {lagged} | R Documentation |
Class "slMatrix"
Description
slMatrix is a matrix-like object for storing values
of periodic autocovariance functions, i.e. of functions of two
arguments which are periodic in the first argument,
r[t,k]=r[t+d,k]. The first argument has the meaning of "time" or
"season" (when taken modulo the period),
the second is "lag".
This class provides various access and assignment methods for
such objects. slMatrix was created as the storage for values of
periodic autocovariance functions and is used for other related quantities.
Objects from the Class
Objects can be created by calls of the form new("slMatrix", m),
where m is a matrix with m[i,k] giving the values for season i
and lag (k-1), k=1,2,\dots.
The number of rows in m is taken to be the number of
seasons. The function slMatrix provides several ways to specify
the data for the slMatrix object.
Slots
m:Object of class
"matrix".
Methods
- [<-
signature(x = "slMatrix", i = "ANY", j = "ANY", value = "ANY"): ...- [
signature(x = "slMatrix", i = "ANY", j = "ANY", drop = "ANY"):The indexing method is quite flexible and allows to extract parts of
slMatrixobjects in a variety of ways. It returns an ordinary matrix or, ifdrop = TRUE, vector.The syntax for indexing is similar to that for ordinary matrices with some features specific to the periodic nature of the first index. The named parameters are
i,j, andtype. Bothiandjcan be vectors. The interpretation ofiandjdepends ontype.x[i,j](orx[i,j,type="sl"]) refers to the value for seasoniand lagj. This is referred to as standard season-lag pair, meaning that the elements ofimust be in the range 1,...,d, where d is the number of seasons and the lags must be non-negative. Negative indices have the usual effect of removing the corresponding elements. A zero element for lag is admissible.x[i,j,type="tl"]is similar to "sl" butiis allowed to take any (integer) values. These are reduced modulo the number of seasons to the 1,...,d, range.x[i,j,type="tl+-"]This allows also the lags to be negative.x[i,j,type="co"]("co" stands for "coefficient") This assumes that the values for negative lags and lags larger thanmaxlagare 0. If assignment is attempted for such lags, a message is issued and the assignment is ignored.x[i,j,type="tt"]both arguments have the meaning of time. Ifiandjare scalars the pairi,jis converted to standards,lpair and the value assigned to the relevant element. Ifiand/orjare vectors, they are crossed and the procedure is done for each pair.If several values need to be assigned to the same
s,lpair a warning is isssued if these values are not all equal.Obviously, whereever negative arguments are allowed, elements to omit cannot be specified with negative indices.
see
[-methods.- maxLag
signature(x = "slMatrix"): maximum lag available for storage.
Note
The current implementation of the indexing is inefficient, I simply
added features and patches as the need arose. Maybe some day I will
replace it with C code.
Author(s)
Georgi N. Boshnakov
See Also
Examples
m1 <- rbind(c(1, 0.81, 0), c(1, 0.4972376, 0.4972376))
x <- slMatrix(m1)
x[1, 0]
x[1:2, 0:1]
x[1:3, 1:3, type = "tt"]