Re: [R] Creating an array from correlation matrices

2012-08-31 Thread Rui Barradas
Hello, You create a 3d array X and then index it as if it were 1d. Correction: TS <- EuStockMarkets [...etc...] for (t in T[1:(length(T)-n)]){ X[ , , t] <- cor(TS[t:(t+n), 1:ncol(TS)], use = "pairwise.complete.obs") } # Calculate correlation matrices Also, 't' and 'T' are not good names, th

[R] Creating an array from correlation matrices

2012-08-31 Thread Max Frisch
Hello everyone, a hopefully easy to solve problem from an R novice... I try to calculate a number of correlation matrices that finally should be combined in a three-dimensional array. Here the my code with an R dataset as an example. --- ## Creation an array of