series_double {RecordTest} | R Documentation |
Double the Number of Series
Description
This function changes the format of a matrix transforming a
matrix in a
matrix in the
following way.
First, the matrix is divided into k
matrices
, containing the rows whose
remainder of the division of the row number by
k
is
, respectively;
and secondly those matrices are
cbind
ed.
Usage
series_double(X, k = 2)
Arguments
X |
A numeric vector, matrix (or data frame). |
k |
Integer |
Details
This function is used in the data preparation (or pre-processing) often required to apply the exploratory and inference tools based on theory of records within this package.
Most of the record inference tools require a high number of independent
series (number of columns) to be applied.
If
is low and the time period of observation,
, is high
enough, the following procedure can be applied in order to multiply by
k
the value .
The approach consists of considering that the observations at two
(or more) consecutive times,
and
(or
),
are independent observations measured at the same time unit.
That means that we are doubling (or multiplying by
k
) the original
time unit of the records, so that the length of the observation period
will be .
This function rearranges the original data matrix into the new format.
If the number of rows of the original matrix is not divisible by k
,
the first nrow(X) %% k
rows are deleted.
Value
A matrix.
Author(s)
Jorge Castillo-Mateo
See Also
series_record
, series_rev
,
series_split
, series_ties
series_uncor
, series_untie
Examples
series_double(matrix(1:100, 10, 10))
series_double(ZaragozaSeries, k = 4)