R/pc2stat.R

Defines functions pc2stat

# Convert periodically correlated multivariate time series to
# stacked stationary form
pc2stat = function(X,period=2){
  n = nrow(X)
  d = ncol(X)
  # add zeros

  extra = ceiling(n/period)*period - n
  X = rbind(X,matrix(0,nrow = extra, ncol=d))
  # convert

  matrix(t(X), ncol=period*d, byrow = T)
}

Try the pcdpca package in your browser

Any scripts or data that you put into this service are public.

pcdpca documentation built on Sept. 3, 2017, 9:02 a.m.