View source: R/series_double.R
| series_double | R Documentation | 
This function changes the format of a matrix transforming a
T \times M matrix in a 
\lfloor T/\code{k} \rfloor \times \code{k}\,M matrix in the 
following way.
First, the matrix is divided into k matrices 
\lfloor T/\code{k} \rfloor \times M, containing the rows whose 
remainder of the division of the row number by k is 
1,2,\ldots,\code{k}-1,0, respectively;
and secondly those matrices are cbinded.
series_double(X, k = 2)
X | 
 A numeric vector, matrix (or data frame).  | 
k | 
 Integer   | 
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 M (number of columns) to be applied.
If M is low and the time period of observation, T, is high 
enough, the following procedure can be applied in order to multiply by
k the value M.
The approach  consists of considering that the observations at two 
(or more) consecutive times, t and t+1 (or t+\code{k}-1),
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 \lfloor T/\code{k} \rfloor.
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.
A \lfloor T/\code{k} \rfloor \times \code{k}\,M matrix.
Jorge Castillo-Mateo
series_record, series_rev,
series_split, series_ties
series_uncor, series_untie
series_double(matrix(1:100, 10, 10))
series_double(ZaragozaSeries, k = 4)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.