Skip to content

Commit

Permalink
Imply Ds optimality when using important/unimportant flagging
Browse files Browse the repository at this point in the history
  • Loading branch information
mattfidler committed Sep 12, 2024
1 parent 8145ece commit b8bce66
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
4 changes: 4 additions & 0 deletions R/poped.R
Original file line number Diff line number Diff line change
Expand Up @@ -2566,6 +2566,10 @@ popedControl <- function(stickyRecalcN=4,
grad_all_switch <- match.arg(grad_all_switch)
grad_all_switch <- c("central"=1, "complex"=0)[grad_all_switch]
}
if (missing(ofv_calc_type) && (!missing(important) || !missing(unimportant))) {
.minfo("Using Ds-optimality for PopED")
ofv_calc_type <- "Ds"
}
if (!checkmate::testIntegerish(ofv_calc_type, len=1, lower=1, upper=7)) {
ofv_calc_type <- match.arg(ofv_calc_type)
ofv_calc_type <- c("lnD"=4, "d"=1, "a"=2, "Ds"=6, "inverse"=7)[ofv_calc_type]
Expand Down
13 changes: 11 additions & 2 deletions inst/poped/ex.2.d.warfarin.ED.babelmixr2.R
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,20 @@ babel.db <- create.poped.database(babel.db, bpop=bpop_vals_ed,
## increase ED_samp_size for a more accurate calculation
tic();evaluate_design(babel.db,d_switch=FALSE,ED_samp_size=20); toc()

## Note that this is a simulation procedure so each time you run it
## you may get different results

## Also note that babelmixr2 values are similar

## $rse
## CL V KA d_CL d_V d_KA SIGMA[1,1] SIGMA[2,2]
## 4.991010 2.977982 14.014207 29.802546 36.711408 26.754059 31.477157 25.297312

## optimization with line search search
output_ls <- poped_optim(babel.db, opt_xt=T, parallel=T, method = "LS", d_switch=F, ED_samp_size=20)

## Fixme:
## laplace does not seem to work with babelmixr2
## laplace does not seem to work with babelmixr2 or example:
## See

## ED: E(det(FIM)) using Laplace approximation
## deterministic calculation, relatively fast
Expand Down

0 comments on commit b8bce66

Please sign in to comment.