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_algandoptim_optionsas separate keywords instead of using theoptimize_fninterface.optim_algcan be set to an optimizer from Optim.jl, andoptim_optionsis aNamedTuplethat specifies options according to theOptim.Optionsinterface. See?fitfor more information.Add
nobsmethods forSubjectandPopulation. 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/LaplaceIand 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
?crossvalidatefor more information.Added a special
ZeroSumDomainfor vector parameters that are restricted to sum to zero. See?ZeroSumDomainfor more information.Added
constantcoefkeyword toBayesMCMCandMarginalMCMCto match thefitfeature for linearized models. See?BayesMCMCand?MarginalMCMCfor 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 optionalrngallows for reproducible sampling.Added the
LKJCholeskyto allow for inference of objects that are Cholesky factorizations. This is commonly used in Bayesian inference. See?LKJCholeskyfor more information.Add the option to choose the mode of parallelization in
predictwith aPopulationas 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
fitcall 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 somefitcalls 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
vpccall. 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_bayesforPumasModels. 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 > 0as multiple reset doses. Only the first dose is a reset dose, and the followingaddldoses are just regularevid == 1doses. - Check that input
constantcoefandomegasare consistent with the model infitcalls. - Added a descriptive error message for definitions of functions in the
@preblock that are not defined using thex -> f(x)notation. - Improve
@emmodelerror messages when required blocks are missing from the model definition. - Mention prediction correction in the
vpcdocstring. See?vpcfor more information. - Add information about loglikelihood values, number of subjects, number of estimated parameters, etc to the
FittedPumasEMModeloutput. - 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
LinearODEthat 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
simobsorfit. The calls would fail with a reference to a missing method of the internal_event_cmt_sym_to_intfunction. - Fixed a bug where the content of the
@preblock would be stored in place of the content of@dosecontrolblock in the output of simobs. - Fixed a bug where
inspectwould fail for@emmodels with@dosecontrolblocks. - Fixed a bug where the types of
idandtimewould not be well-defined in the construction ofDataFrameoutput fromSubjects causing the construction to fail. - Added a missing check for valid
ssconfigurations 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
NCASubjects fromSubjects 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 causemdvhandling to be turned on even if the user did not provide the column name inread_pumas. - Change negative
bioav/durationcheck from an assertion toDomainError. These errors are then automatically handled by the numerical error handling described in theFeaturesection. - Add compartment names for dose control parameters in model generation using the model builder.
- Fix
DataFrameconstructors forinspectoutput. Spuriousmissingentries would be added at time0if some edge case conditions were met. - Adjust
findinfluentialto 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 aDataFramecould not contain missings. This could also occur duringvpccalls ifprediction_correctionwas set totrue. - Fixed a bug where parameter bounds were not respected in
gsacalls. - Fixed a bug where the
@ncamacro failed to handle data with multiple infusions. - Fixed a bug where it was not possible to use
init_paramsto 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_tableoutput: 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-2LLfor easy comparison with NONMEM OFV including the constant term and conducting likelihood ratio tests from tables.
PumasApps
- Fix regression in
coefusage with theexplore_estimatesapp where the wrong coefficients would be store the in target variable. - Improve
evaluate_diagnosticscapture 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_plotwith no simulated data.