A common interface to creating a variety of random draws used to simulate the log likelihood function

make_draws(n_id, n_draws, n_dim, seed, type)

Arguments

n_id

Number of individuals in your sample

n_draws

Number of draws per respondent

n_dim

Number of dimensions

seed

A seed to change the scrambling of the sobol sequence.

type

A character string indicating the type of draw: "pseudo-random", "mlhs", "standard-halton", "scrambled-halton", "standard-sobol", "scrambled-sobol"

Value

A matrix of dimensions n_id*n_draws x n_dim of standard uniform draws

Examples

n_id <- 10
n_draws <- 5
n_dim <- 3

draws <- make_draws(n_id, n_draws, n_dim, seed = 10, "scrambled-sobol")
#> Warning: scrambling is currently disabled.
head(draws)
#>       [,1]  [,2]  [,3]
#> [1,] 0.500 0.500 0.500
#> [2,] 0.750 0.250 0.750
#> [3,] 0.250 0.750 0.250
#> [4,] 0.375 0.375 0.625
#> [5,] 0.875 0.875 0.125
#> [6,] 0.625 0.125 0.375

draws <- make_draws(n_id, n_draws, n_dim, seed = 10, "scrambled-halton")
head(draws)
#>       [,1]     [,2] [,3]
#> [1,] 0.500 0.666667 0.60
#> [2,] 0.250 0.333333 0.20
#> [3,] 0.750 0.222222 0.80
#> [4,] 0.125 0.888889 0.40
#> [5,] 0.625 0.555556 0.12
#> [6,] 0.375 0.111111 0.72