Given an approximate design and a number of points, computes all the possible combinations of roundings of each point to the nearest integer, keeps the ones that amount to the requested number of points, and returns the one with the best value for the criterion function
combinatorial_round(
design,
n,
criterion = NULL,
model = NULL,
parameters = NULL,
par_values = NULL,
weight_fun = function(x) 1,
par_int = NULL,
reg_int = NULL,
matB = NULL
)
A data.frame with the rounded design to n number of points
either a dataframe with the design to round, or an object of class "optdes". If the former, the criterion, model and parameters must be specified. The dataframe should have two columns:
Point
contains the support points of the design.
Weight
contains the corresponding weights of the Point
s.
integer with the desired number of points of the resulting design.
character variable with the chosen optimality criterion. Can be one of the following:
'D-Optimality'
'Ds-Optimality'
'A-Optimality'
'I-Optimality'
'L-Optimality'
formula describing the model. Must use x as the variable.
character vector with the parameters of the models, as written in the formula
.
numeric vector with the parameters nominal values, in the same order as given in parameters
.
optional one variable function that represents the square of the structure of variance, in case of heteroscedastic variance of the response.
optional numeric vector with the index of the parameters
of interest for Ds-optimality.
optional numeric vector with the ranges of integration, for I-optimality.
optional matrix of dimensions k x k, for L-optimality.
aprox_design <- opt_des("D-Optimality", y ~ a * exp(-b / x), c("a", "b"), c(1, 1500), c(212, 422))
combinatorial_round(aprox_design, 27)
Run the code above in your browser using DataLab