rNormalPrior returns a random vector generator
rNormalPrior.RdThe return value is a function that generates random vectors of the same size as mean and sd from a multivariate normal distribution with independent components with mean "mean" and standard deviation "sd". The random vectors are returned as n rows of a matrix, where n is the only argument of the returned function.
Value
an independentent multivariate normal random vector generating function: rprior(n), where n is the requested number of vectors (rows)
Examples
rnp<-rNormalPrior(mean=c(0,1,2),sd=c(1,2,3))
rnp(12)
#> [,1] [,2] [,3]
#> [1,] -0.57534222 5.2796394 6.1480535
#> [2,] 2.33176229 2.4341477 1.3777953
#> [3,] -1.75609415 -1.9999705 2.5196558
#> [4,] 0.04964564 0.3129936 2.9857473
#> [5,] -0.49397886 2.1315120 2.8957075
#> [6,] -0.08145809 3.6361399 5.8499022
#> [7,] 0.90754402 0.5707226 -1.2214872
#> [8,] -0.61035204 -1.2611242 3.3575072
#> [9,] -0.49935603 -2.4498062 -0.3871895
#> [10,] -1.41738373 0.5371633 2.8921468
#> [11,] -0.46527817 1.5912074 0.3807219
#> [12,] -0.48468134 1.4705309 0.3757530