Release Notes for Pumas 2.3.0
Pumas
Features
Steady-state solutions for dynamic models with analytical solutions (
Central1
,Central1Periph1Meta1
, linear ordinary differential equations, etc) are now calculated using a closed form expression. This avoids fixed point iterations that can be slow or fail to converge.Expose
optim_alg
andoptim_options
as separate keywords instead of using theoptimize_fn
interface.optim_alg
can be set to an optimizer from Optim.jl, andoptim_options
is aNamedTuple
that specifies options according to theOptim.Options
interface. See?fit
for more information.Add
nobs
methods forSubject
andPopulation
. The function returns the number of non-missing data entries. The feature is useful on its own and when comparing objective function values to other software.Added marginal MCMC inference where the subject-specific parameters are marginalized using
FO
/FOCE
/LaplaceI
and the posterior of the population parameters are the only quantities being sampled.Added several summary statistics for Bayesian inference (
gewekediag
,heideldiag
,gelmandiag
,rafterydiag
,mcse
,ess_rhat
,rstar
). See the section on Bayesian inference in the documentation for more information, or the individual doc strings using?gewekediag
,?heideldiag
, etc.Added cross-validation for Bayesian inference. See
?crossvalidate
for more information.Added a special
ZeroSumDomain
for vector parameters that are restricted to sum to zero. See?ZeroSumDomain
for more information.Added
constantcoef
keyword toBayesMCMC
andMarginalMCMC
to match thefit
feature for linearized models. See?BayesMCMC
and?MarginalMCMC
for more information.Added
sample_params(::PumasModel; rng)
andsample_params(::PumasEMModel; rng)
to allow for sampling from the prior distribution of parameters for both Pumas models and SAEM Pumas models. The optionalrng
allows for reproducible sampling.Added the
LKJCholesky
to allow for inference of objects that are Cholesky factorizations. This is commonly used in Bayesian inference. See?LKJCholesky
for more information.Add the option to choose the mode of parallelization in
predict
with aPopulation
as input. The new default isEnsembleThreads
.Export many functions and types that previously required to be qualified (needed
Pumas.
in front):FO
,FOCE
,LaplaceI
,NaivePooled
,MAP
,JointMAP
,BayesMCMC
,MarginalMCMC
,SAEM
,postprocess
,crossvalidate
,ExactCrossvalidation
,PSISCrossvalidation
,SubspaceCrossvalidation
,BySubject
,ByObservation
,KFold
,LeaveK
,LeaveFutureK
,elpd
,get_params
,get_randeffs
,truncate
,waic
,psis_ic
,nobs
, andaicc
. For example,fit(model, data, param, Pumas.FOCE()
) can now be written asfit(model, data, param, FOCE())
without thePumas.*
prefix.During a
fit
call extreme population parameters can cause internally used functions to throw errors. If the errors are of the types:TaskFailedException
,DomainError
,PosDefException
,SingularException
; we now gracefully reject the trial parameter vector and attempt to continue with less extreme trial values. This means that somefit
calls that would previously fail now continue searching for the optimal values.A VPC can now be constructed using pre-simulated observations to avoid simulations to occur during the
vpc
call. This allows users to construct several VPCs from the same underlying simulations. This is useful when creating several VPC plots using different stratifications while keeping the underlying data and simulations fixed.Add a method to
empirical_bayes
forPumasModel
s. This allows for empirical bayes estimates to be calculated for a given population parameter specification using model, data, and population parameters.
Bug fixes and minor improvements
- Add one to the offset when adjusting the time vector for evid 3 and 4 events.
- Don't parse reset doses with
addl > 0
as multiple reset doses. Only the first dose is a reset dose, and the followingaddl
doses are just regularevid == 1
doses. - Check that input
constantcoef
andomegas
are consistent with the model infit
calls. - Added a descriptive error message for definitions of functions in the
@pre
block that are not defined using thex -> f(x)
notation. - Improve
@emmodel
error messages when required blocks are missing from the model definition. - Mention prediction correction in the
vpc
docstring. See?vpc
for more information. - Add information about loglikelihood values, number of subjects, number of estimated parameters, etc to the
FittedPumasEMModel
output. - Suppress type parameter info when displaying
SimulatedObservations
. - Warn on specifying initial variability parameters in SAEM fits when users manually specify initial random effect or error model variability parameters.
- Fixed type stability problems for
LinearODE
that could cause very long compile times. - Fixed random draws from
Constrained(<:PDiagNormal}
when bounds were not finite. - Fixed a bug where populations where some subjects had time constant covariates and others had time varying covariations would not work when calling
simobs
orfit
. The calls would fail with a reference to a missing method of the internal_event_cmt_sym_to_int
function. - Fixed a bug where the content of the
@pre
block would be stored in place of the content of@dosecontrol
block in the output of simobs. - Fixed a bug where
inspect
would fail for@emmodel
s with@dosecontrol
blocks. - Fixed a bug where the types of
id
andtime
would not be well-defined in the construction ofDataFrame
output fromSubject
s causing the construction to fail. - Added a missing check for valid
ss
configurations when parsing events. - Fixed the handling of some edge cases in time-varying interpolant construction. The new behavior is to throw an informative error if the data has different covariate values at the same point in time. This could happen if an event row had a different value of a covariate than an observation row where both rows referred to the same current "time".
- Fixed a bug that affected the construction of
NCASubject
s fromSubject
s when infusions where in the event list. The event to turn off the infusion would be handled as a separate event causing incorrect output for the NCA analyses. - Fixed a bug where the existence of an
:mdv
-column would automatically causemdv
handling to be turned on even if the user did not provide the column name inread_pumas
. - Change negative
bioav
/duration
check from an assertion toDomainError
. These errors are then automatically handled by the numerical error handling described in theFeature
section. - Add compartment names for dose control parameters in model generation using the model builder.
- Fix
DataFrame
constructors forinspect
output. Spuriousmissing
entries would be added at time0
if some edge case conditions were met. - Adjust
findinfluential
to reflect the correct inputs. - Fixed an error where SAEM would fail to run if parameters were input with different numerical types (integer and floating point numbers mixed together).
- Fixed a bug where
DataFrame(predict([...]))
failed with an error that a column in aDataFrame
could not contain missings. This could also occur duringvpc
calls ifprediction_correction
was set totrue
. - Fixed a bug where parameter bounds were not respected in
gsa
calls. - Fixed a bug where the
@nca
macro failed to handle data with multiple infusions. - Fixed a bug where it was not possible to use
init_params
to initialize parameters in a format that would be accepted bysimobs
.
Pumas Utilities
NCAUtilities
- Support for sparse NCA in
summary_observations_vs_time
. - Support nominal time in plots.
PumasReports
- Fix typo in warning messages printed from
report
. - Print additional information in
metrics_table
output: success status of the fit, number of subjects, number of total observations, number of missing observations, number of estimated parameters, the likelihood approximation type, and-2LL
for easy comparison with NONMEM OFV including the constant term and conducting likelihood ratio tests from tables.
PumasApps
- Fix regression in
coef
usage with theexplore_estimates
app where the wrong coefficients would be store the in target variable. - Improve
evaluate_diagnostics
capture of variable names from the REPL. - Display static plots by default in diagnostics UI with modal view to display interactive versions.
PlottingUtilities
- Include Pumas logo at bottom of title pages of all reports.
PumasPlots
- Fix error in OLS computations.
- Remove "conditional" wording in plot labels and docstrings.
- Fix
vpc_plot
with no simulated data.