Function to create objects from class slMatrix
slMatrix.Rd
Provides a flexible way to create objects from class
slMatrix
. The entries may be specified in several ways.
Usage
slMatrix(init = NA, period, maxlag, seasonnames = seq(length = period),
lagnames = as.character(0:maxlag), periodunit = "season",
lagunit = "lag", f = NA, type = "sl")
Arguments
- init
values for the the autocovariances, see also argument
f
.- period
the number of seasons in an epoch
- maxlag
maximum lag to be stored
- seasonnames
names of seasons (?)
- lagnames
names of lags
- periodunit
name of the period unit
- lagunit
name of the unit for lags
- f
function to evaluate or matrix to get the values of the autocovariances.
- type
format or the arguments of
f
, see details.
Details
The internal representation of slMatrix
is a matrix slot, m
, of size
period x (maxlag+1)
. It is created by a call to matrix()
with init
supplying the values (may be NA
s). If
init
is a matrix values for period
and maxlag
are deduced (if not supplied) from its size.
Change on 21/06/2006: Now, if the length of
init
is smaller than that of m
, the remaining values are
filled with NA's (in the past the normal recycling rules of
matrix()
applied). The previous behaviour used to hide
puzzling and difficult to track errors. I cannot be sure but this
change should not affect old code.
If f
is given it is used to populate the slot
m
by a call to fill.slMatrix
. Normally in this case
init=NA
but this is not required.
Currently fill.slMatrix
has methods for f
of class
"matrix" and "function". The arguments (or the indices)
can be controlled by the argument type
.
type="sl"
- standard season-lag pair
type="tt"
- time-time pair
type="tl"
- standard season-lag pair
Note
To do: additional work is needed on the case when the dimensions of init and the result are not the same (see the details section)