greta-dev / greta

simple and scalable statistical modelling in R
https://greta-stats.org
Other
524 stars 63 forks source link

Improve documentation on non-independent sampling using greta_array() #571

Open frederikziebell opened 1 year ago

frederikziebell commented 1 year ago

It should be stated in the documentation of greta_array(), that using the dim argument with a scalar data argument results in identical copies of all elements and not independent ones. Compare the output of

set.seed(1)
x <- normal(0,1,dim=3)
simulate(model(x))

y <- greta_array(normal(0,1),dim=3)
simulate(model(y))

resulting in

$x
, , 1
          [,1]      [,2]      [,3]
[1,] -1.036807 -0.414638 0.7169058

$y
, , 1
          [,1]      [,2]      [,3]
[1,] 0.2973163 0.2973163 0.2973163