Release Notes for Pumas 2.7.0
Pumas
Features and improvements
- Add the parallel absorption two compartment model
Depots2Central1Periph1
- Add the three compartment model
Central1Periph2
- Add steady state options to
diffeq_options
to set tolerances for steady state calculations. - Allow for
init_randeffs
input inempirical_bayes
to choose initial estimates. - Allow user to pass
init_randeffs
toJointMAP
as a vector ofNamedTuple
s. - Support deconstruction of variables in
@pre
such asη₁, η₂ = η
to unpack and provide elementwise names to a multidimensional random effect. - Require the number of samples to be set when using
simobs
with only a model/bayesresult and subject/population input to avoid the confusing default of 10 samples. - Print convergence measure instead of Successful Minimization: true/false in
fit
output. - Introduce
sample_params
for inference to enable simulation with uncertainty in a more controlled way. - Introduce
center_randeffs
for more appropriate initialization of random effects in the non-Gaussian case. The choice of "center" for each distribution can be found by callingPumas.center_stat(dist)
for a given distributiondist
. - Make input order consistent for
center_randeffs
,init_randeffs
,zero_randeffs
, andsample_randeffs
(see deprecations at the bottom of this page). - Use the same solver and tolerances between simobs and fit.
- Extend
StatsAPI.pvalue
to be used with the output of lrtest. - Make
icoef
s more useful in theDataFrame
based oninspect
. Previouslyicoef
s would only be populated at covariate times, but now they will be populated at all times in theDataFrame
output. - Make constant covariates available in
@random
to enable more flexible random effects definitions. - Use
Optim.LBFGS
as default optimization algorithm forJointMAP
due to the large number of parameters to be optimized. - Only support whitelisted
diffeq_options
settings to avoid users from setting options that might not be compatible with the internal handling of integrator options used in Pumas. Supported options are::alg
,:abstol
,:reltol
,:maxiters
,:continuity
,:ss_abstol
,:ss_reltol
,:ss_maxiters
. - Add
symbolic_jacobian
(default:false
) to@options
to enable symbolic calculation of the Jacobian of the ODE system. - Show what's fixed and optimized in tables derived from fit calls.
- Support events with zero bolus doses (amt = 0).
- Restrict eta shrinkage computation to
Normal
andMvNormal
to avoid inappropriately calculating shrinkage for non-Gaussian random effects where the interpretation is unclear. - Allow for
ensemblealg
input inicoef
when empirical bayes estimates will be computed. - Made the gradient calculation slightly more efficient by changing the order of the linear algebra operations.
- Reordered some checks for finite likelihood and gradients to not evaluate the initial likelihood several times when fitting.
- Support a zero
Matrix
inPDiagDomain
such thatzero(n,n)
can be used in the parameterNamedTuple
when simulating.
Documentation and error messages
- Improve
findinfluential
docstring to cover supported inputs. - Add docstring to
NaivePooled
to clarify how and when to use it. - Better error messages for non-sensical Bayesian cross-validation method specifications.
- Always error if
id
andtime
columns are not present in the input toread_pumas
and do the same foramt
whenevent_date==true
. - Add missing backtick in
infer
-docstring forMarginalMCMC
. - Throw an error if a block in
@emmodel
is defined twice. - Fix
vpc
docstring that referencedensemblealg
twice. - Avoid tabs in formula printing for
PumasEMModel
. - Fix
show
method forFittedPumasEMModel
that would fail if the model had multiple endpoints with different numbers of parameters. - Improve docstrings of closed form models in general.
- Abort simulation if steady-state computation fails to converge.
- Improve docstring of
MarginalMCMC
and inherit likelihood approximation ininfer
by @devmotion in https://github.com/PumasAI/Pumas.jl/pull/4242 - Add missing docstrings for
loglikelihood
by @devmotion in https://github.com/PumasAI/Pumas.jl/pull/4247 - Fix typo in warning when using adjust_evid34 and print the warnings only once.
- Document Pumas definition of eta-shrinkage in docstring of
ηshrinkage
. - Clarify docstring of
init_randeffs
(see deprecations below). - Document the keyword
init_randeffs
used to initialize the empirical bayes estimate optimization infit
s docstring. - Fix log message generated by
simobs(::BayesMCMCResult)
` that would previously throw an error. - Throw descriptive error if absorption lag time is negative.
- Add examples for truncation and censoring in the docstring of
censored_latent
andtruncated_latent
. - Clarify
event_data
comment in docstring ofread_pumas
. - Fix typo in error message when
ByObservation(allsubjects = true)
is used and subjects have different numbers of observations. - Add a warning in the docstring for Constrained to clarify that the type should only be used in
@param
.
Bugs
- Fix checks for unbounded parameters in
gsa
such that an appropriate error is thrown. - Respect
iterations
setting infit
continuation withJointMAP
. - Convert parameters of
RealDomain
s to floating point numbers to support integer input. - Forward RNG to
AdvancedHMC.find_good_stepsize
to ensure reproducibility of bayesian inference. - Fix support of
NamedTuples
of random effects inPumasEMModel
s. https://github.com/PumasAI/Pumas.jl/pull/4087 - Fix a bug where the order of ODE parameters in
PumasEMModel
s internals would sometimes be wrong causing incorrect model evaluations. - Fix
show
method forfit
results if there areInf
values among estimates. - Fix simulation with zero omegas used to turn off specific random effects.
- Fix a bug where user might get the error message
ERROR: UndefVarError: terminate! not defined in Pumas.jl
when using steady-state. - Fix FOCE type inference inefficiencies that could cause a small overhead in some situations.
- Fix
PSDDomain
constructor with diagonal matrices. - Fix estimation of absorption lag model with non-constant covariates that would throw an error for an unsupported
Event
constructor. - Fix inconsistent
covariates_direction
inSubject
constructor. Previously, it would be:right
for subjects constructed from subjects through theSubject(subject;...)
constructor. - Fix
empirical_bayes
forMAP(NaivePooled())
. Previously, an error would be thrown. - Fix conversion of
PumasEMModel
toPumasModel
. Previously, the reported parameters in the model output would not be correct. - Fix
Subject
constructors withmissing
covariates. Previously, an error would be thrown. - Respect likelihood approximation setting in
MarginalMCMC
. - Fix
LogitNormal
and supportMvLogitNormal
random effects. Previously, an internal transformation to orthogonal representations would be incorrect. - Fix display and analysis of MCMC samples without population parameters.
- Fix covariates output in
DataFrame(::SimulatedObservations)
. Previously, covariate information would only be added if the subject also had events. - Use
center_stat(dist)
as the random effect value for population predictions instead of zero. This is more appropriate for non-Gaussian random effects. - Fix return code of analytical solution that would sometimes return an indication of success even if the solution was not found.
- Fix inspect DataFrame constructor for parameters defined directly in
@random
. Previously, an error would be thrown if the parameter defined in@random
was used directly in the model later on without being redefined in@pre
. - Correctly handl constant parameters (instead of ignoring the
constantcoef
) in simulatedstderror
andvcov
calculations. - Fix checks and handling of reserved identifiers
:id
and:time
in read_pumas. - Fix a bug in the calculation of the correaltions in
correlation_diagnostic
. - Make linearity detection safer and faster. Previously, linearity detection could fail and an error would be thrown. Some rare edge cases could also lead to a false positive linearity detection.
- Fix NaivePooled and restrict it to transformed Gaussians.
- Fix parsing of @covariates in @emmodel.
Deprecations
- The method
simobs(fpm)
is deprecate and the full signature should be used instead:simobs(fpm.model, fpm.data, coef(fpm))
. Pumas.truncate
is deprecated anddiscard
should be used to trim bayesian samples insteadzero_randeffs(model, param, population)
is deprecated andzero_randeffs(model, population, param)
should be used insteadinit_randeffs
is deprecated in favor ofcenter_randeffs
.
PumasPlots
Features and improvements
- Many plotting functions use open circle markers by default now which can be discriminated better than filled circles when overplotting.
convergence_trace
: Colormaps are not given via color anymore but via the keyword colormap.npde_vs_covariates
: The y-label now includes the observation for which the NPDEs are shown because there can be multiple different observations.sim_plot
: Color palettes are given viacolor_palette
andmarkercolor_palette
now because otherwise it's not possible to usefrom_continuous
and other helpers known from AoG which are notSymbol
s.wresiduals_vs_covariates
: The type of observation is specified in the row labels, not in separate titles per axis.ridgeline_plot
: The first HPDI is not plotted twice anymore.- Some Bayesian diagnostic plots have different axis linking defaults, disabling axis linking in one dimension because the variables along that dimension can have very different ranges.
trace_plot
andcummean_plot
disable y-axis linking,density_plot
disables x-axis linking.
Deprecations
- All plots except
corner_plot
use AlgebraOfGraphics in the backend now and expose the standard keywords fromAoG.draw
likefacet
orlegend
. All keywords that are made obsolete by AoG functionality are deprecated, such asfigurelegend
,include_legend
,combinelabels
,combinexlabels
,combineylabels
,hidelabels
,hidexlabels
,hideylabels
,hideticks
,hidexticks
,hideyticks
. - The
corner_plot
function is deprecated, the third party packagePairPlots.jl
offers a comprehensive solution for this type of plot.
NCAUtilities
Deprecations
- All plots use AlgebraOfGraphics in the backend now and expose the standard keywords from
AoG.draw
likefacet
orlegend
. All keywords that are made obsolete by AoG functionality are deprecated, such asfigurelegend
,include_legend
,combinelabels
,combinexlabels
,combineylabels
,hidelabels
,hidexlabels
,hideylabels
,hideticks
,hidexticks
,hideyticks
.
AlgebraOfGraphics
AlgebraOfGraphics is updated from v0.8.3 to v0.10.8 which includes the following breaking changes:
paginate
now splits facet plots into pages after fitting scales and not before. This means that, e.g., categorical color mappings are consistent across pages where before each page could have a different mapping if some groups were not represented on a given page. This change also makes pagination work with the split X and Y scales feature enabled by version 0.8.14.paginate
's return type changes fromPaginatedLayers
toPagination
because no layers are stored in that type anymore. The interface to usePagination
withdraw
and other functions doesn't change compared toPaginatedLayers
.paginate
now also accepts an optional second positional argument which are the scales that are normally passed todraw
when not paginating, but which must be available prior to pagination to fit all scales accordingly.- The
colorbar!
function now returns aVector{Colorbar}
with zero or more entries. Before it would returnUnion{Nothing,Colorbar}
, but now it's possible to draw more than one colorbar if there are multiple colorscales. filled_contours
does not create a legend by default but a colorbar. The colorbar can be disabled again by setting, e.g.,scales(Color = (; colorbar = false))
.- Changed the behavior of the
from_continuous
palette in combination with a scale consisting ofBin
s. Colors will now be sampled relative to the positions of their bins' midpoints, meaning that smaller bins that lie closer together have more similar colors. The previous behavior with colors sampled evenly can be regained by usingfrom_continuous(cmap; relative = false)
.
PumasUtilities
Features and improvements
- The
report
function now uses Typst for PDF rendering instead of LaTeX. This improves performance on large documents while the interface remains unchanged.
Bugs
- Fix a bug where large inputs to
report
sometimes caused failure to render a final PDF due to too many subjects.
OptimalDesign
Features and improvements
TimeUnitTransform
andinv(TimeUnitTransform)
to convert time back and forth betweenFloat
andDateTime
.- New function
compare_designs
to compare designs by their parameters' Cramer-Rao lower bounds. - New methods for
evaluate_design
andcrlb
.
Bugs
- Fix
subject_multiples
keyword argument inevaluate_design
to appropriately calculate the population FIM. - Fix rounding error in
inv(TimeUnitTransform)
. - Improve control over optimization duration.
Bioequivalence
Features and improvements
- The output of
pumas_be
now includes marginal means (similar to "least squares means") calculations for all parametric model based designs. - The output of
detect_design
now includes the number of periods and number of formulations. - The implementation of the non-parametric test is now a pure Julia efficient computation (it used lookup tables previously).
- Output of
pumas_be
via summary tables has ashow
method fortext/html MIME
.
Bugs
- The within subject variability estimation for multi-period parallel designs was previously faulty and is now fixed.
Deprecations
FDA
is deprecated and is replaced byFDA_HighlyVariable
.EMA_CMAX
is deperacted and is replaced byEMA_HighlyVariable
.