model_averaging()
to make averaged predictions over estimations performed from several models. Also exports do_model_averaging()
and compute_weights()
for low-level implementations.mapbayr_vpc()
to make prediction-corrected visual predictive checks (pcvpc
) from a given model and dataset. Control the independent variable (idv
), and the stratification on a numeric variable in the dataset (stratify_on
).hist()
method (hist.mapbayests()
) now shows the values of eta-shrinkage in multiple subjects setting. New argument shk
to control the definition of shrinkage, either based on the standard deviation ("sd"
) or on the variance ("var"
) (@LauraMvn, #192).mapbayr_plot()
in order to plot results from tables (data.frame). This is the function now called by plot.mapbayests()
internally. Can plot the results of multiple estimation object (informed in the column "MODEL"), useful when model averaging is performed. Argument MODEL_color
to force the color of a model on the plot.do_mapbayr_sims()
as an engine to simulate from estimation results. Experimental. Now mostly useful for internal or programmatic uses, but might be extended in the future.augment.mapbayests()
. Now easier to debug and much more faster, especially when uncertainty on predictions is required.$PARAM
, however the definition on "ETA" in $PARAM
remains mandatory.$PARAM
to avoid hazardous behaviours (@jbwoillard, #187).augment()
now simulates at least 200 points per individual. Fix a bug where delta was miscalculated and strange-looking plots were sometimes generated (@LauraMvn, #191).mapbay_tab
now has the same number of rows as original data especially if it did not have observation rows (@LauraMvn, #193)..datehour
column is updated after realize_addl
is being called (@LauraMvn, #194).etasrc
specification.adm_rows()
and obs_rows()
replace and improve adm_lines()
and obs_lines()
, respectively. See ?data_helpers
for a comprehensive documentation (#175).adm_rows()
, obs_rows()
, and add_covariates()
, the first argument x
:
adm_rows(amt = 100, cmt = 1) %>%
obs_rows(time = 24, cmt = 2, DV = 0.123)
adm_rows()
and obs_rows()
, new argument .datehour
in order to compute time
as function of date and hours provided as character. The value passed to .datehour
is parsed with parse_datehour()
into a date-time value ("POSIXct"). For example:
obs_rows(.datehour = c("2023/02/01 12:00", "2023/02/01 12:34"), DV = c(0.123, 0.456), cmt = 1)
LLOQ
(lower limit of quantification, e.g. 0.22 mg/L) and BLQ
(below limit of quantification, e.g. 1 or 0) are in the data (@pchelle, #182).LLOQ
and BLQ
to the data by yourself.LLOQ
to the data by yourself: BLQ
will automatically be inferred from LLOQ
and DV
.mapbayest(lloq = )
to automatically add the LLOQ
and BLQ
variables in the data.mapbayest()
, new argument lloq
in order to add a variable LLOQ
to the data. For example: mapbayest(model, data, lloq = 0.22)
.In mapbayest()
, new argument select_eta
in order to select the numbers of the ETAs to estimate. Default are ETAs related to an OMEGA not equal to zero. Non-selected ETAs will not be estimated and returned equal to zero. This can be useful in order to ignore the estimation of ETAs not of interest, e.g. in case of inter-occasion variability or non-identifiability. For example: mapbayest(model, data, select_eta = c(1,3))
(#170).
In mapbayest()
, new argument lambda
in order to modify the weight of the priors in the Bayesian estimation. This could be useful in order to flatten the priors with the objective to favor observed data instead of a priori information. For example: mapbayest(model, data, lambda = 0.1)
to decrease the weight of priors of a ten-fold (#174).
adm_rows.data.frame()
, adm_rows.missing()
, adm_rows.mrgmod()
, obs_rows.data.frame()
, obs_rows.missing()
, obs_rows.mrgmod()
, and add_covariates.data.frame()
, as new methods for data helpers.parse_datehour()
, used to parse arguments passed to .datehour
in adm_rows()
and obs_rows()
.filter.mrgmod()
, a method, wrapper around dplyr::filter()
for dataset stored in mrgsolve model object ('mrgmod').adm_lines()
and obs_lines()
. Stop exporting adm_lines.mrgmod()
and obs_lines.mrgmod()
.see_data()
. Was deprecated since 0.4. Use get_data()
instead.lubridate
.arg.optim$select_eta
element, arg.ofv.fix$omega_inv
now has the dimensions of the number of ETAs selected.select_eta
argument. This condition is not tested anymore with check_mapbayr_model()
.print.mapbayests()
, now only shows the estimated ETAs.hist()
, new argument select_eta
in order to select the ETAs to plot. Default are ETAs estimated with mapbayest()
(#167).eta()
properly sorts vectors of length superior to 9 (#159).use_posterior()
works if covariates had not been defined in data (#160).hist()
, get_phi()
and plot_phi()
, ETAs are now properly re-ordered if they are more than 9 (#165).tidyverse
packages (#171).ggplot2 >= 3.4.0
.add_covariates()
accepts empty arguments.mapbayest()
, new argument ...
in order to fix compatibility issues, not used yet.summarise_phi()
and bar_phi()
summarizes the comparison of estimation of 'mapbayr' and 'NONMEM' (i.e. classifies it as Excellent/Acceptable/Discordant) and graphically represents it as a bar plot.eta()
generates numerical values named ETA1, ETA2, ETA3...
, either from scratch, from a pre-existing vector or from a 'mrgsolve' model object.plot()
, PREDICTION = c("IPRED", "PRED")
controls to plot either "PRED", "IPRED" or both (#113).add_covariates()
, covariates
is relocated in last position, in the favor of ...
which now accepts covariate values. Calling add_covariates(list(BW = 90))
will still works (with a warning) for the sake of compatibility but will be deprecated. Instead, just use add_covariates(BW = 90)
or explicitly call add_covariates(covariates = list(BW = 90))
if you want to pass covariate values as a list (#156).get_eta()
, output = "num"
returns a matrix if multiple IDs are available instead of an error message (#145).postprocess.optim()
and postprocess.output()
. Removed due to refactoring of internal post-processing.adm_0_cmt()
.mapbayest()
, reset
is now a numeric and drives the maximum allowed reset during optimization.check_mapbayr_model()
now returns an error if a check fails instead of a table that summarized the errors.check_mapbayr_model()
now only checks critical points and not suggested features.check_mapbayr_model()
now explicitly forbids IPRED
, PRED
and ETA1, ETA2...
(#148).mapbayest(output = )
(#134).stats::optim()
if method is 'L-BFGS-B' and minqa::newuoa()
if method is 'newuoa'. These replace optimx::optimx()
(#136).optimx
package.tibble
package from dependency to suggestion.vs_nonmem()
and get_phi()
works even if covariance was missing/failing in mapbayests object (#126).pred()
does not generate NaN
if small negative concentrations were predicted after log-transformation (#140).pred()
does not propagate 'mrgsolve' error when lag time is longer than inter-dose interval at steady-state (#142).NA
values in DV
if mdv == 0
is checked (#131).check_mapbayr_model()
is now called before any use the model inside mapbayest()
(#149).DV
if error is exponential (#150).obs_lines()
, mdv
will be 1 if DV
is set to NA
(#147).qmod
, omega_inv
and all_cmt
now replace mrgsolve_model
, omega.inv
and obs_cmt
. For individual-related elements, idDV
replaces DVobs
, data
is removed, idvaliddata
and idcmt
are added. This can have an impact for the user since these elements are reported in the standard output. However, it does not change the behaviour of get_data()
.mapbayest(verbose = TRUE)
now only displays the messages related to optimization reset, and not the progression of ID being optimized which is now controlled by mapbayest(progress = TRUE)
.derivatives()
, now replaced by mapbayr:::h()
.mbrlib()
and associated models. See the "Model examples" section below.The example models system was totally re-thought around a new function: exmodel()
. It now embeds several models that were used in the validation study, with a small corresponding dataset that can be loaded automatically (the default). They are used in multiple places inside the package, especially in tests and examples. More models could be added in the future.
exmodel()
. See the list of available models in the documentation.exdata()
, to load data only.mapbayest(progress = TRUE)
displays a progress bar with the number of the ID being optimized. #118 #28mapbayest(output = "eta")
returns only estimated ETA in order to skip most of post-processing steps. #106eta_descr()
now always returns a non-NA value even if description is missing. #87do_compute_ofv()
, a wrapper around do.call(compute_ofv, ...)
.{progress}
.{testthat}
, {minqa}
. #120R CMD check
.plot_phi()
now plots correct values on the x-axis. #108NA
. #114This version of mapbayr introduces several features that aim to express uncertainty around the point estimate. Please note that the results of these functions were not validated vs a gold-standard software such as NONMEM. This is why they are referred as "experimental features" in the following subsections. They are exported with the objective to ease their future validation, and to provide a very rough idea of the estimation uncertainty.
data
slot in estimation object. Use get_data()
instead. #64$model@args$data
is now always NULL
in the estimation object. It was carried out if the data was initially passed with data_set()
or built with adm_lines()
/obs_lines()
. #64augment
). Also use recsort=3
to deal with steady-state administrations. #85plot()
are now directly passed to augment()
.collapse_omega()
function. (thanks @kylebaron)mapbayest(hessian = )
is used to compute the hessian with stats::optimHess()
by default. The variance-covariance matrix is returned in a covariance
slot in the estimation object, and can be accessed with get_cov()
.use_posterior(update_omega = TRUE)
update the OMEGA matrix with the covariance matrix, in order to simulate with uncertainty and derive confidence intervals.plot(ci = TRUE)
displays approximate confidence intervals on predicted concentrations. Parameter uncertainty is approximated with the covariance matrix. Confidence interval computation relies on the delta approximation (ci_method = "delta"
), but can also be computed thanks to simulations (see augment()
documentation).get_cov()
: function to get the covariance matrix of estimation. #43get_phi()
, read_nmphi()
, merge_phi()
and plot_phi()
: functions to compare the estimations vs NONMEM. #55est001
: an example mapbayests
estimation object. #94update_omega
, update_cov
, and update_eta
arguments to control what to update..zero_re
default behavior now depends on update_
arguments values.mapbayest(verbose = )
now mutes the message that indicates a reset during optimization. #96opt.value
inherited from optimx
. #95get_data()
can now return a list of individual data sets with output = "list"
. #64@annotated
tag in model code, especially for $PARAM
and $CMT
blocks. #73adm_lines()
and obs_lines()
don't need the [ADM] and [OBS] tags in model code anymore (yet strongly recommended, otherwise it errors cleanly).testthat
bugs due to upgrade of R and French translation of warnings.plot()
legend, due to new version of ggplot2
3.3.4 #82Features:
Fix bugs:
Miscellaneous:
NEWS.md
file to track changes to the package.NEWS.md