Skip to content

Commit

Permalink
Fix saem inPars
Browse files Browse the repository at this point in the history
  • Loading branch information
mattfidler committed May 22, 2024
1 parent 8de50da commit b8c7292
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion R/saemRxUiGet.R
Original file line number Diff line number Diff line change
Expand Up @@ -625,7 +625,7 @@ rxUiGet.saemInitTheta <- function(x, ...) {
.n <- vapply(.theta, function(x) ifelse(x, "FIXED", ""),
character(1), USE.NAMES=FALSE)
.ret <- vapply(seq_along(.logEta),
function(i){
function(i) {
.isEta <- any(.names[i] %in% .etaNames)
if (.logEta[i]) {
if (.isEta) {
Expand Down
7 changes: 6 additions & 1 deletion R/saem_fit.R
Original file line number Diff line number Diff line change
Expand Up @@ -322,11 +322,16 @@
.rx <- attr(model$saem_mod, "rx")
.pars <- .rx$params
.pars <- setNames(rep(1.1, length(.pars)), .pars)
.pars <- .pars[!(names(.pars) %in% inPars)]
opt$.rx <- .rx
opt$.pars <- .pars
## opt$.dat <- dat;
dat <- .as.data.frame(dat[, -6])
names(dat) <- toupper(names(dat))
names(dat) <- vapply(names(dat), function(n) {
if (n %in% inPars) return(n)
return(toupper(n))
}, character(1), USE.NAMES = FALSE)

dat$ID <- as.integer(dat$ID)

evt <- dat
Expand Down
2 changes: 1 addition & 1 deletion src/saem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2015,7 +2015,7 @@ mat user_function(const mat &_phi, const mat &_evt, const List &_opt) {
int k=0;
for (int _j = 0; _j < nPar; _j++){
if (doParam[_j] == 1) {
ind->par_ptr[_j] = _phi(_i, k++);
ind->par_ptr[_j] = _phi(_i, k++);
}
}
}
Expand Down

0 comments on commit b8c7292

Please sign in to comment.