MyNixOS website logo
Description

Calculating Optimal and D-Augmented Designs.

Calculates D-, Ds-, A- and I-optimal designs for non-linear models, via an implementation of the cocktail algorithm (Yu, 2011, <doi:10.1007/s11222-010-9183-2>). Compares designs via their efficiency, and D-augments any design with a controlled efficiency. An efficient rounding function has been provided to transform approximate designs to exact designs.

optedr

CRANstatus Lifecycle:stable

Overview

The package optedr is an optimal experimental design suite for calculating optimal designs, D-augmenting designs and efficiently rounding approximate design. Among its capabilities are:

  • Calculating D-, Ds-, A- and I-optimal designs for non-linear models.
  • D-augment designs controlling the loss of efficiency.
  • Evaluate the efficiency of a given design against the optimum.
  • Efficiently rounding approximate designs to exact designs.

Installation

You can install the released version of optedr from CRAN with:

install.packages("optedr")

You can install the latest version of the package from GitHub with:

devtools::install_github("kezrael/optedr")

Functions

The user available functions are:

  • opt_des() calculates optimal designs.
  • design_efficiency() evaluates the efficiency of a design against the optimum.
  • augment_design() augments designs, allowing the user to add points controlling the D-efficiency.
  • efficient_round() efficiently round approximate designs.
  • shiny_optimal() demo of optimal designs calculation with a graphical interface, applied to Antoine’s Equation.
  • shiny_augment() demo of augmenting design with a graphical interface, usable for a handful of models.

The optdes object generated by opt_des() has its own implementation of print(), summary() and plot().

Usage

library(optedr)

The calculation of an optimal design requires a to specify the Criterion, the model, the parameters and their initial values and the design_space.

resArr.D <- opt_des(Criterion = "D-Optimality",
                    model = y ~ a*exp(-b/x),
                    parameters = c("a", "b"),
                    par_values = c(1, 1500),
                    design_space = c(212, 422))
#> i Stop condition not reached, max iterations performed
#> i The lower bound for efficiency is 99.9986396401789%

resArr.D$optdes
#>      Point    Weight
#> 1 329.2966 0.5000068
#> 2 422.0000 0.4999932
resArr.D$sens
resArr.D$convergence

After calculating the D-optimal design, the user might want to add points to the design to fit their needs:

aug_arr <- augment_design(resArr.D$optdes, 0.3, y ~ a * exp(-b/x),
               parameters = c("a", "b"),
               par_values = c(1, 1500),
               design_space = c(212, 422),
               F)
#> The region(s) are  [250.98-422]The region(s) are  [250.98-422]The region(s) are  [250.98-422]
aug_arr
#>      Point    Weight
#> 1 329.2966 0.3500048
#> 2 422.0000 0.3499952
#> 3 260.0000 0.1500000
#> 4 380.0000 0.1500000

This new design can be rounded to the desired number of points:

(exact_design <- efficient_round(aug_arr, 20))
#>      Point Weight
#> 1 329.2966      7
#> 2 422.0000      7
#> 3 260.0000      3
#> 4 380.0000      3

And its efficiency compared against the optimum:

aprox_design <- exact_design
aprox_design$Weight <- aprox_design$Weight /sum(aprox_design$Weight)

design_efficiency(resArr.D, aprox_design)
#> i The efficiency of the design is 86.0744365761564%
#> [1] 0.8607444
Metadata

Version

2.0.0

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows