Class "slMatrix"
slMatrix-class.Rd
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.
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
slMatrix
objects 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
. Bothi
andj
can be vectors. The interpretation ofi
andj
depends ontype
.x[i,j]
(orx[i,j,type="sl"]
) refers to the value for seasoni
and lagj
. This is referred to as standard season-lag pair, meaning that the elements ofi
must 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" buti
is 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 thanmaxlag
are 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. Ifi
andj
are scalars the pairi,j
is converted to standards,l
pair and the value assigned to the relevant element. Ifi
and/orj
are vectors, they are crossed and the procedure is done for each pair.If several values need to be assigned to the same
s,l
pair 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.