Simulate X variables
make_x.Rd
Simulates independent variables.
Arguments
- n
the number of values to simulate.
- mu
the sample average.
- cor
correlation between bivariate normal
- var
the sample variance. The
sqrt(var)
is passed tornorm()
andrlnorm()
for normal and laplace distributions.sqrt(var / 2)
is used forlaplace()
.- method
must be one of
"uniform"
(default),"normal"
, or"bivnormal"
(bivariate normal).
Examples
make_x(10, mu = c(0.5, 1.2), var = c(1, 0.5))
#> x_1 x_2
#> 1 1.7628590 0.3082836
#> 2 1.4454462 2.2979954
#> 3 2.5182247 1.9627152
#> 4 2.2090075 1.8568446
#> 5 1.3732044 1.3045129
#> 6 3.3237453 1.3393927
#> 7 1.0345818 0.2349710
#> 8 0.1739019 0.9512587
#> 9 1.9959718 0.4221742
#> 10 0.7548479 1.6919259