Skip to content
Back to formatted view

Raw Message

Message-ID: <1342191256650-4636442.post@n4.nabble.com>
Date: 2012-07-13T14:54:16Z
From: Cren
Subject: Multivariate apply.rolling()

# I've read that rollapply, and its wrapper apply.rolling()
# from PerformanceAnalytics package, do not work with multivariate
# time series neither their output can be a multivariate time series.

# Then I was wondering if any other function like those exists, or
# if I need to write my own function to perform multivariate
# time serie rolling analysis.

# Something like this:

# Let 'X' be your multivariate time series:
# output <- matrix(NA, ncol = ncol(X), nrow = nrow(X))
# width <- 199
# for(i in 1:(nrow(output) - width) {
#     data <- X[i:(i + width),]   
#     output[i,] <- function(data)
#}
# rownames(output) <- rownames(as.timeSeries(X))

# ...and this should be a (probably not efficient) way to do it.
# Any better idea?

# Thanks,


--
View this message in context: http://r.789695.n4.nabble.com/Multivariate-apply-rolling-tp4636442.html
Sent from the R help mailing list archive at Nabble.com.