paa <- function(data, window) {
ret = NULL
start = 1
while (start <= nrow(data)) {
end = min(start + window - 1, nrow(data))
ret = rbind(ret, colMeans(data[start:end,]))
start = start + window
}
return(ret)
}
Tuesday, February 02, 2010
Piece-wise Aggregate Approximation
Piece-wise Aggregate Approximation in R
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment