Skip to content
Prev 371572 / 398506 Next

building random matrices from vectors of random parameters

I would try something like

n = 5
a <- rnorm(n,0.8,0.1)
so <- rnorm(n,0.5,0.1)
m <- rnorm(n,1.2,0.1)
mats = mapply(function(sa1, so1, m1) matrix(c(0,sa1*m1,so1,sa1),2,2,byrow=T),
                       a, so, m, SIMPLIFY = FALSE)
[[1]]
          [,1]      [,2]
[1,] 0.0000000 0.9129962
[2,] 0.4963598 0.7067311

[[2]]
          [,1]      [,2]
[1,] 0.0000000 1.0150316
[2,] 0.5489887 0.8469046

[[3]]
          [,1]      [,2]
[1,] 0.0000000 0.9516137
[2,] 0.3724521 0.8306535

[[4]]
          [,1]      [,2]
[1,] 0.0000000 1.0525355
[2,] 0.8075108 0.8314638

[[5]]
          [,1]      [,2]
[1,] 0.0000000 0.9400074
[2,] 0.4803386 0.7901753
On Wed, Sep 27, 2017 at 5:47 PM, Evan Cooch <evan.cooch at gmail.com> wrote: