https://github.com/cran/pcdpca
Raw File
Tip revision: 994e42225542c81cc02708658f24865826071d4c authored by Lukasz Kidzinski on 03 September 2017, 04:17:18 UTC
version 0.4
Tip revision: 994e422
stat2pc.R
# Convert a time series from the stacked stationary form
# back to periodically correlated
# Not exported
stat2pc = function(Y,period=2,n=NULL){
  nr = nrow(Y)
  d = ncol(Y)
  if (is.null(n))
    n = nr*period
  dnew = d / period

  X = c()
  for (i in 1:dnew){
    X = cbind(X,matrix(t(Y[,1:period + period*(i-1)]),ncol=1))
  }
  X[1:n,]
}
back to top