Description Usage Arguments Details Value
View source: R/mnl_model_functions.R
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).
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
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 |
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 |
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. |
Verbosity levels: each level prints the previous plus additional things:
Print the efficiency value in each iteration and a final summary
Print the values of k, s, i, and efficiency value in each subiteration
Print the resulting X after each iteration, i.e., after each complete pass on the data
Print efficiency value for each point in the Cox direction discretization
Print the resulting X and information matrix after each subiteration
Print the resulting X or each point in the Cox direction discretization
The function returns a list with 11 elements:
X_orig
: The original design. A 3-dimensional array of size (q, J, S)
.
X
: The optimized design. A 3-dimensional array of size (q, J, S)
.
beta
: The original beta
vector or matrix.
opt_crit_value_orig
: efficiency of the original design.
opt_crit_value
: efficiency of the optimized design.
n_iter
: Number of iterations performed.
efficiency_value_per_iteration
: Efficiency value in each iteration of the algorithm.
opt_crit
: The optimality criterion used.
q
: Number of mixture ingredients.
seed
: seed used to generate the final design. If a design was used as input by the user, this will be NA.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.