Skip to content

Commit

Permalink
skpr v1.6.4: Fix bug where minimizing optimality criteria would retur…
Browse files Browse the repository at this point in the history
…n the wrong design in the rare case a numeric singularity resulted in a negative optimality value
  • Loading branch information
tylermorganwall committed Feb 20, 2024
1 parent 06266e6 commit 8cf49f2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: skpr
Title: Design of Experiments Suite: Generate and Evaluate Optimal Designs
Date: 2024-02-20
Version: 1.6.3
Version: 1.6.4
Authors@R: c(person("Tyler", "Morgan-Wall", email = "[email protected]", role = c("aut", "cre")),
person("George", "Khoury", email = "[email protected]", role = c("aut")))
Description: Generates and evaluates D, I, A, Alias, E, T, and G optimal designs. Supports generation and evaluation of blocked and split/split-split/.../N-split plot designs. Includes parametric and Monte Carlo power evaluation functions, and supports calculating power for censored responses. Provides a framework to evaluate power using functions provided in other packages or written by the user. Includes a Shiny graphical user interface that displays the underlying code used to create and evaluate the design to improve ease-of-use and make analyses more reproducible. For details, see Morgan-Wall et al. (2021) <doi:10.18637/jss.v099.i01>.
Expand Down
6 changes: 4 additions & 2 deletions R/gen_design.R
Original file line number Diff line number Diff line change
Expand Up @@ -1097,7 +1097,6 @@ gen_design = function(candidateset, model, trials,
genOutput = run_search(seq_len(repeats), advancedoptions$GUI)
}
}

designs = list()
rowindicies = list()
criteria = list()
Expand Down Expand Up @@ -1177,7 +1176,10 @@ gen_design = function(candidateset, model, trials,
}

if (optimality == "A" || optimality == "I" || optimality == "ALIAS" || optimality == "G") {
criteria = criteria[criteria > 0]
negative_criteria = criteria < 0
criteria = criteria[!negative_criteria]
rowindicies = rowindicies[!negative_criteria]
designs = designs[!negative_criteria]
if (length(criteria) == 0) {
stop("skpr: No non-singular designs found--increase number of repeats.")
}
Expand Down

0 comments on commit 8cf49f2

Please sign in to comment.