Skip to content

Commit 370a7eb

Browse files
authored
Merge pull request #50 from generable/develop
v0.3.3
2 parents 4e0cf09 + 67c8755 commit 370a7eb

7 files changed

Lines changed: 8 additions & 11 deletions

File tree

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package: bmstate
22
Type: Package
33
Title: Bayesian multistate modeling
4-
Version: 0.3.1
4+
Version: 0.3.3
55
Authors@R:
66
c(person(given = "Juho",
77
family = "Timonen",

R/MultistateModel.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ MultistateModel <- R6::R6Class("MultistateModel",
4747
categorical = NULL,
4848
normalizer_locations = NULL,
4949
normalizer_scales = NULL,
50-
xpsr_normalizer_loc = 7.5,
50+
xpsr_normalizer_loc = 5.5, # corresponds to about dose=30
5151
xpsr_normalizer_scale = 0.5,
5252
n_grid = NULL,
5353
simulate_log_hazard_multipliers = function(df_subjects, beta) {

R/MultistateModelFit.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ msmfit_exposure <- function(fit, oos = FALSE, data = NULL) {
414414
out <- list()
415415
for (s in seq_len(S)) {
416416
if (sd$do_pk == 1) {
417-
x_xpsr <- log_ss_area_under_conc(sd$dose_ss, log_pkpar[[s]]) # log D/(CL*V2)
417+
x_xpsr <- log_ss_area_under_conc(sd$dose_ss, log_pkpar[[s]]) # log D/CL
418418
} else {
419419
x_xpsr <- NULL
420420
}

R/PKModel.R

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,11 +110,9 @@ PKModel <- R6::R6Class("PKModel",
110110
#' @return A numeric value
111111
compute_xpsr = function(theta, dose) {
112112
CL <- theta[2]
113-
V2 <- theta[3]
114113
checkmate::assert_number(CL, lower = 0)
115-
checkmate::assert_number(V2, lower = 0)
116114
checkmate::assert_number(dose, lower = 0)
117-
log(dose) - log(CL) - log(V2)
115+
log(dose) - log(CL)
118116
},
119117

120118
#' @description Simulate data with many subjects

R/stan.R

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,7 @@ fit_stan <- function(model, data,
102102
model$set_normalizers(data)
103103
if (!is.null(data$dosing)) {
104104
log_mu_CL <- -2 # should match msm.stan
105-
log_mu_V2 <- -2 # should match msm.stan
106-
aaa <- log(data$dosing$dose_ss) - log_mu_CL - log_mu_V2
105+
aaa <- log(data$dosing$dose_ss) - log_mu_CL
107106
loc <- mean(aaa)
108107
sca <- stats::sd(aaa)
109108
model$set_xpsr_normalizers(loc, sca)

inst/stan/msm.stan

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ functions {
22

33
// log SS AUC
44
vector log_ss_area_under_conc(vector dose_ss, matrix log_theta_pk){
5-
return(log(dose_ss) - log_theta_pk[:,2] - log_theta_pk[:,3]) ; // log D/(CL*V2)
5+
return(log(dose_ss) - log_theta_pk[:,2]) ; // log D/CL
66
}
77

88
// log of hazard multiplier
@@ -448,7 +448,7 @@ model {
448448
if(do_haz == 1){
449449
if(nc_haz > 0){
450450
for(k in 1:nc_haz){
451-
beta_oth[1, k] ~ normal(0, 2);
451+
beta_oth[1, k] ~ normal(0, 1);
452452
}
453453
}
454454
if(I_xpsr==1){

vignettes/analysis.Rmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ mod$get_knots()
142142
We fit the model by optimizing.
143143

144144
```{r}
145-
fit <- fit_stan(mod, data = pd, method = "optimize")
145+
fit <- fit_stan(mod, data = pd, method = "optimize", init = 0.1)
146146
```
147147

148148
## Inferred baseline hazards

0 commit comments

Comments
 (0)