mood: Setting up the parameters of a factorial experiment to search...

View source: R/mood.R

moodR Documentation

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

Description

Creates an object containing the parameters of the experiment, compound optimality criterion with the weights and parameters of the search.

Usage

mood(
  K,
  Levels,
  Nruns,
  criterion.choice = c("GD", "GL", "GDP", "GLP", "MSE.D", "MSE.L", "MSE.P"),
  kappa = list(),
  control = list(),
  prob = list(),
  model_terms = list(primary.model = "first_order")
)

Arguments

K

Number of factors.

Levels

Either (a) a common number of levels for each factor or (b) a list of length K of the vectors containing levels of each factor.

Nruns

Number of runs of the experiment.

criterion.choice

Compound criterion to be used for the optimal design search or evaluation. Possible values are:

  • GL, GD for Generalised D- and L-optimality \insertCiteGoos2005modelMOODE

  • GDP and GLP for Generalised DP- and LP-optimality \insertCiteGilmourandTrinca2012MOODE

  • MSE.D, MSE.L and MSE.P for compound criteria with MSE-component: determinant-based, trace-based and determinant-based but with point estimates for the MSE(D)-component

kappa

List specifying the weights used in the compound criterion. Each named entry must be between 0 and 1.

  • kappa.Ds Weight of the Ds-criterion (default = 1 if criterion.choice = GD)

  • kappa.DP Weight of the DP-criterion (default = 1 if criterion.choice = GDP)

  • kappa.L Weight of the L-criterion (default = 1 if criterion.choice = GL)

  • kappa.LP Weight of the LP-criterion (default = 1 if criterion.choice = GLP)

  • kappa.LoF Weight of the lack-of-fit criterion

  • kappa.bias Weight of the bias criterion

  • kappa.mse Weight of the MSE criterion (default = 1 if 'criterion.choice = MSE.*')

control

Named list specifying control parameters for the design search.

  • Nstarts The number of randomly generated start designs of the search algorithm (default = 10).

  • Cubic Indicator of whether the experimental region is cubic (TRUE, default) or spherical (FALSE).

  • tau2 The variance scaling parameter for the prior distribution of the potential terms (default = 1).

  • Biter Number of samples for evaluating the MSE determinant-based component criterion (default = 50).

  • MC Indicator of whether to apply a multiple comparison (Bonferroni) correction for trace-based criteria (TRUE, default) or not (FALSE).

  • orth Indicator of whether to orthonormalise the potential and primary terms (⁠TRUE', default) or not (⁠FALSE').

prob

Named list specifying confidence levels for DP- (prob.DP), LP- (prob.LP) and Lack-of-fit (prob.LoF) criteria (pre-Bonferroni correction). All default to 0.95.

model_terms

A list specifying the primary (fitted) and potential (biased) models with the following named elements (see Details).

  • primary.model The order of the fitted polynomial model. Alternatively polynomial terms can be directly specified through the primary.terms parameter.

  • potential.model The order of the potential/extra polynomial terms. Alternatively can be specified through the potential.terms parameter.

  • primary.terms Alternative specification of the primary model via character vector of the names of the primary terms.

  • potential.terms Alternative specification of the potential model via character vector of the names of the potential terms.

Details

The function provides different ways of specifying the levels of the factors and the models. Although some default options are provided for, e.g., criterion.choice and ⁠kappa.*⁠ values, specification of these input parameters should be carefully chosen to reflect the aims of the experiment and available prior information.

Specifying the factors and levels

If all K factors have the same number of levels, Levels parameter is used to input that number. Otherwise, Levels is set to be a list of vectors containing the values of the factors, e.g. list(1:3, 1:2, 1:4) for 3 factors with equally spaced 3, 2 and 4 levels respectively.

Specifying the fitted model and the potential terms

There are two ways to describe the primary and potential sets of model terms via the model_terms list. Named elements primary.model and potential.model can be used to specify the fitted model and the potential terms via a string form. They are used to generate the sets of primary.terms and potential.terms which alternatively can be input directly. Possible values of primary.model are:

  • main_effects – main effects for all the factors (default for all criteria)

  • first_order – main effects and linear interactions

  • second_order – full second order polynomial

  • third_order – full second order polynomial model and all interactions of degree 3

  • cubic – third order polynomial model with cubic terms

The intercept is always included as a primary term.

Possible elements of the potential.model vector argument:

  • linear_interactions – linear interactions among the factors (default for MSE criteria)

  • quadratic_terms – quadratic terms for all the factors

  • third_order_terms – all interactions of degree 3: linear-by-linear-by-linear and quadratic-by-linear terms

  • cubic_terms – cubic terms for all the factors

  • fourth_order_terms – all interactions of degree 4, similar to third_order_terms

primary.terms and potential.terms arguments are used to specify the fitted model and the potential terms explicitly – up to the total power of 4.

  • Single factor powers, are coded as a string starting with with "x" and followed by the index of the factor and the power: "x32". For example, x_3^2 is coded as "x32"; "x22" stands for x_2^2, and "x4" stands for the linear term x_4.

  • Interaction of factors' powers are coded by merging the individual factors' powers, ordered by the factors' indexes. For example, x_2^2\times x_1 is coded as "x1x22", x_3x_12x_4 – as "x12x3x4".

Value

Object of class mood specifying parameters of the experiment, compound criterion of choice, and primary and potential model terms.

  • K Number of factors.

  • Klev Number of levels of each factor, if all factors have the same number of levels.

  • Levels List of length K of the vectors containing values of the factors.

  • Nruns Number of runs of the experiment.

  • criterion.choice Compound criterion to be used for the optimal design search or evaluation.

  • Nstarts The number of randomly generated start designs of the search algorithm.

  • Biter Number of samples for evaluating the MSE determinant-based component criterion.

  • tau2 The variance scaling parameter for the prior distribution of the potential terms.

  • tau The square root of tau2

  • Cubic Whether the experimental region is cubic (TRUE) or spherical (FALSE).

  • MC Indicator of the multiple comparison (Bonferroni) correction for trace-based criteria.

  • ⁠prob.DP, prob.LP, prob.LoF, prob.LoFL⁠ Confidence levels for the DP-, LP-, lack of fit determinant- and trace-based criteria.

  • ⁠alpha.DP, alpha.LP, alpha.LoF, alpha.LoFL⁠ Significance levels for the DP-, LP-, lack of fit determinant- and trace-based criteria.

  • orth Whether the candidate sets are orthonormalised (TRUE) or not (FALSE).

  • Z0 Z0 matrix.

  • W Weight matrix for Ls criterion.

  • primary.terms Fitted (primary) model terms.

  • potential.terms Potential terms.

  • P The number of terms in the fitted model (including intercept).

  • Q The number of potential terms.

  • ⁠kappa.Ds, kappa.DP, kappa.L, kappa.LP, kappa.LoF, kappa.bias, kappa.mse⁠ Compound criterion weights.

  • warning.msg Warning messages.

References

\insertAllCited

Examples


example1 <- mood(K = 5, Levels = 3, Nruns = 40, criterion.choice = "GDP", 
kappa = list(kappa.Ds = 1./3, kappa.DP = 1./3, kappa.LoF = 1./3), 
control = list(Nstarts = 50, tau2 = 0.1),
model_terms = list(primary.model = "second_order", 
potential.terms = c("x12x2", "x22x3", "x32x4", "x42x5")))
example1

example2 <- mood(K = 3, Nruns = 12, Levels = list(1:3, 1:2, 1:2), criterion.choice = "MSE.L",
kappa = list(kappa.LP = 1./2, kappa.LoF = 1./4, kappa.mse = 1./4),
control = list(Nstarts = 50, tau2 = 1), 
model_terms = list(primary.terms = "first_order",
potential.terms = c("x12", "x12x2", "x12x3")))
example2


MOODE documentation built on Aug. 19, 2025, 1:11 a.m.