Learn R Programming

opera (version 1.2.0)

seriesToBlock: Convert a 1-dimensional series to blocks

Description

The functions seriesToBlock and blockToSeries convert 1-dimensional series into series of higher dimension. For instance, suppose you have a time-series that consists of \(T = 100\) days of \(d = 24\) hours. The function seriesToBlock converts the time-series X of \(Td = 2400\) observations into a matrix of size c(T=100,d =24), where each line corresponds to a specific day. This function is usefull if you need to perform the prediction day by day, instead of hour by hour. The function can also be used to convert a matrix of expert prediction of dimension c(dT,K) where K is the number of experts, into an array of dimension c(T,d,K). The new arrays of observations and of expert predictions can be given to the aggregation rule procedure to perform d-dimensional predictions (i.e., day predictions).

Usage

seriesToBlock(X, d)

blockToSeries(X)

Arguments

X

An array or a vector to be converted.

d

A positive integer defining the block size.

Details

The function blockToSeries performs the inverse operation.