Skip to content
Prev 371575 / 398506 Next

building random matrices from vectors of random parameters

On 27/09/2017 8:47 PM, Evan Cooch wrote:
Peter's mapply solution is probably the best.  Another that might be a 
little faster (but more obscure) is to use a 3-index array.  I think 
this is what you'd want, with sa, so, and m as defined above:

ms <- array(c(rep(0, 5),sa*m,so,sa), c(5, 2, 2))

Then matrix i will be stored as ms[i,,].

Duncan Murdoch