R/gp_data.R

Defines functions gp_data

gp_data <- function(x,d,nT, times) {
  nS <- ncol(x)
  y <- matrix(NA, nrow = nT*nS, ncol=d)
  time_idx <- rep(as.numeric(factor(times)), each = nS)
  for(i in 1:nT) {
    y_rows <- 1:nS + (i-1) * nS
    x_rows <- 1:d + (i-1) * d
    y[y_rows, ] <- t(x[x_rows,])
  }
  return(list(y = y, time = time_idx))
}
eifer4/CoarsePosteriorSummary documentation built on April 10, 2021, 12:40 p.m.