Re: [R] avoid loop with three-dimensional array

2008-07-21 Thread Charles C. Berry
On Mon, 21 Jul 2008, Michela Cameletti wrote: Dear R user, I'm trying to find a solution for optimizing my code. I have to run a 50.000 iteration long simulation and it is absolutely necessary to have an optimized code. What you have is just a quadratic form, so t( y ) %*% A %*% y will do it.

[R] avoid loop with three-dimensional array

2008-07-21 Thread Michela Cameletti
Dear R user, I'm trying to find a solution for optimizing my code. I have to run a 50.000 iteration long simulation and it is absolutely necessary to have an optimized code. I have to do this operation *sum_t ( t(X_t) %*% A %*% X_t )* where X_t is a (d*k) matrix which changes in time and A is a co

[R] Avoid loop with three-dimensional array

2008-07-21 Thread Michela Cameletti
Dear R users, I'm trying to find a solution for optimizing my code. I have to run a 50.000 iteration long simulation and it is absolutely necessary to have an optimized code. I have to do this operation *sum_t ( t(X_t) %*% A %*% X_t )* where X_t is a (d*k) matrix which changes in time and A is a c