mnl_mixture_coord_exch: Coordinate exchange algorithm for a Multinomial Logit Scheffé...

Description Usage Arguments Details Value

View source: R/mnl_model_functions.R

Description

Performs the coordinate exchange algorithm for a Multinomial Logit Scheffé model as described in Bayesian D-optimal choice designs for mixtures by Ruseckaite, Goos & Fok (2017).

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
mnl_mixture_coord_exch(
  q = NULL,
  J = NULL,
  S = NULL,
  n_random_starts = 100,
  X = NULL,
  beta,
  transform_beta = T,
  order = 3,
  opt_method = "B",
  max_it = 10,
  tol = 1e-04,
  n_cox_points = NULL,
  plot_designs = F,
  verbose = 1,
  opt_crit = 0,
  seed = NULL,
  n_cores = 1,
  save_all_designs = F
)

Arguments

q

number of mixture ingredient proportions.

J

number of alternatives within a choice set.

S

number of choice sets.

n_random_starts

number or random starts. Defaults to 100.

X

If an initial design is to be supplied, then it must be a 3-dimensional array of size (q, J, S), with q, J, and S defined above.

beta

Prior parameters. For a locally optimal design, it should be a numeric vector of length m = (q^3 + 5*q)/6. For a pseudo-Bayesian design, it must be a matrix with prior simulations of size (nxm) where m is previously defined and m is the number of prior draws, i.e., there is a prior draw per row.

transform_beta

boolean parameter. Should the beta vector/matrix be transformed by subtracting the q-th element?

order

integer corresponding to a Scheffé model order (1, 2, 3).

opt_method

Optimization method in each step of the coordinate exchange algorithm. It can be "B" (Brent's algorithm) or "D" (discretization of Cox direction)

max_it

integer for maximum number of iterations that the coordinate exchange algorithm will do

tol

A positive error tolerance in Brent's method.

n_cox_points

number of points to use in the discretization of Cox direction. Ignored if opt_method is Brent.

plot_designs

boolean. If TRUE, shows a plot of the initial and the final design. Only works if q is 3 or 4.

verbose

level of verbosity. See below for details.

opt_crit

optimality criterion: D-optimality ("D" or 0) or I-optimality ("I" or 1).

seed

Seed for reproducibility.

n_cores

Number of cores for parallel processing.

save_all_designs

Whether the function should return a list with all the designs created at random or only the best.

Details

Verbosity levels: each level prints the previous plus additional things:

  1. Print the efficiency value in each iteration and a final summary

  2. Print the values of k, s, i, and efficiency value in each subiteration

  3. Print the resulting X after each iteration, i.e., after each complete pass on the data

  4. Print efficiency value for each point in the Cox direction discretization

  5. Print the resulting X and information matrix after each subiteration

  6. Print the resulting X or each point in the Cox direction discretization

Value

The function returns a list with 11 elements:

  1. X_orig: The original design. A 3-dimensional array of size (q, J, S).

  2. X: The optimized design. A 3-dimensional array of size (q, J, S).

  3. beta: The original beta vector or matrix.

  4. opt_crit_value_orig: efficiency of the original design.

  5. opt_crit_value: efficiency of the optimized design.

  6. n_iter: Number of iterations performed.

  7. efficiency_value_per_iteration: Efficiency value in each iteration of the algorithm.

  8. opt_crit: The optimality criterion used.

  9. q: Number of mixture ingredients.

  10. seed: seed used to generate the final design. If a design was used as input by the user, this will be NA.


mariobecerra/opdesmixr documentation built on Aug. 13, 2021, 9:44 p.m.