reform_data function

Reform data

Reform data

reform_data reforms the data into a form that is easier to use when calculating log-likelihood values etc.

reform_data(data, p)

Arguments

  • data: a matrix or class 'ts' object with d>1 columns. Each column is taken to represent a univariate time series. Missing values are not supported.
  • p: a positive integer specifying the autoregressive order

Returns

Returns the data reformed into a ((nobsp+1)×dp)((n_{obs}-p+1)\times dp) matrix. The i:th row of the matrix contains the vector (yi1,...,yip)(y_{i-1},...,y_{i-p}) (dp×1)(dp\times 1), where yi=(y1i,...,ydi)y_{i}=(y_{1i},...,y_{di}) (d×1)(d \times 1).

Details

Assumes the observed data is yp+1,...,y0,y1,...,yTy_{-p+1},...,y_0,y_1,...,y_{T}.

Warning

No argument checks!

  • Maintainer: Savi Virolainen
  • License: GPL-3
  • Last published: 2025-02-27