Learn R Programming

MOODE

Multi-objective Optimal Design of experiments (MOODE) for targeting the experimental objectives directly, ensuring as such that the full set of research questions is answered as economically as possible.

Installation

Install from CRAN with:

install.packages("MOODE")

You can install the development version of MOODE from GitHub with:

# install.packages("devtools")
devtools::install_github("vkstats/MOODE")

Example

As a basic example, consider an experiment with K=2 factors, each having Levels = 3 levels. The primary (assumed) model contains first-order terms, and the potential model also contains squared terms. The experiment will have Nruns = 24 runs. An optimal compound design will be sought combining $DP_S$-, $LoF-D$- and $MSE(D)$-optimality; see Koutra et al. (2024). We define the parameters for this experiment using the mood function.

library("MOODE")
ex.mood <- mood(K = 2, Levels = 3, Nruns = 24, 
                model_terms = list(primary.terms = c("x1", "x2"), 
                                   potential.terms = c("x12", "x22")), 
                criterion.choice = "MSE.D", 
                kappa = list(kappa.DP = 1 / 3, kappa.LoF = 1 / 3, 
                             kappa.mse = 1 / 3))

The kappa list defines weights for each criterion, with $\kappa_i\ge 0$ and $\sum \kappa_i = 1$.

Optimal designs are found using a point exchange algorithm, via the Search function.

search.ex <- Search(ex.mood)
#> ✔ Design search complete. Final compound objective function value = 0.19717

The best design found is available as element X.design, ordered here by treatment number.

fd <- search.ex$X.design[order(search.ex$X1[, 1]),]
cbind(fd[1:12, ], fd[13:24, ])
#>       x1 x2 x1 x2
#>  [1,] -1 -1  0  1
#>  [2,] -1 -1  0  1
#>  [3,] -1 -1  1 -1
#>  [4,] -1  0  1 -1
#>  [5,] -1  0  1 -1
#>  [6,] -1  1  1 -1
#>  [7,] -1  1  1  0
#>  [8,] -1  1  1  0
#>  [9,] -1  1  1  1
#> [10,]  0 -1  1  1
#> [11,]  0 -1  1  1
#> [12,]  0  0  1  1

The path element records the compound objective function value from each of the (by default) 10 attempts of the algorithm from different random starting designs.

search.ex$path
#>  [1] 0.1971797 0.1971700 0.1971714 0.1971458 0.1971621 0.1971951 0.1971238
#>  [8] 0.1972105 0.1979960 0.1971959

Copy Link

Version

Install

install.packages('MOODE')

Monthly Downloads

151

Version

1.1.0

License

GPL (>= 3)

Issues

Pull Requests

Stars

Forks

Maintainer

Vasiliki Koutra

Last Published

August 18th, 2025

Functions in MOODE (1.1.0)

criteria.GLP

Calculates the values of the Generalised LP-criterion and its components
candidate_set_orth

Forms the orthonormalised full candidate set
criteria.GDP

Calculates the values of the Generalised DPs-criterion and its components
candidate_set_full

Forms the full candidate set of treatments for all polynomial terms
criteria.mseD

Calculates the values of the MSE DPs-criterion and its components
criteria.GL

Calculates the values of the Generalised L-criterion and its components
candidate_trt_set

Forms the labelled candidate set of treatments
criteria.mseL

Calculates the values of the MSE LP-criterion and its components
criteria.mseP

Calculates the values of the MSE DPs-criterion using the point prior for the MSE(D)-component estimation
Search

Searching for a multi-objective optimal completely randomised design.
criteria.GD

Calculates the values of the Generalised Ds-criterion and its components
criteria.values.G

Evaluating individual criteria of the designs, from the Generalized compound criteria Goos2005model,Olga2017MOODE
criteria.values.mse

Evaluating individual criteria of the designs
mood

Setting up the parameters of a factorial experiment to search for multi-objective optimal completely randomised design.
point.swap

Swapping points between the current design and candidate set
MOODE-package

MOODE: Multi-Objective Optimal Design of Experiments