Release Notes for Pumas 2.8.0
Pumas
Features and improvements
Experimental Features
- Add Monte Carlo Expectation Maximization,
MCEM, estimation method that works with regular models defined using@model - Add Variational Expectation Maximization,
VEM, estimation method that works with regular models defined using@model - Add
FiniteMarkovdistribution to model discrete time finite (state) Markov processes.
Features
Add
ProportionalNormal,CombinedNormalandCombinedCorrelatedNormalto automatically safe guard against negative values and to provide a coherent interface for common error models.Add
OrderedLogitcategorical distributions to simplify modeling of ordered categorical data.Add metadata to
DataFrameconstructed from Pumas output objects. The metadata will automatically be used as labels when usingAlgebraOfGraphics.jlbased plotting and in some tables fromSummaryTables.jl.Allow multiple iterations of SIR following www.page-meeting.org/?abstract=2907 and www.page-meeting.org/?abstract=3546.
Add support for
MvNormalwith missing values in@derivedforLaplaceIandNaivePooled.Allow named models such as
Central1,Central1Periph1, etc to be used in models that are not possible to solve with closed form solutions by switching to a numerical ODE solver when needed.Add support for
vcov/infercalculations withensemblealgset toEnsembleDistribted()orEnsembleSplitThreads().Add support for random effects following
NormalCanon,JohnsonSU, andMvNormalCanondistributions.Add control of the initial empirical bayes estimate value used when finding the mode in inner iterations of
FOCEandLaplaceI. Both constructors accept therandeffs_initializationkeywoard with possible options being:RandeffsInitialization.Center,RandeffsInitialization.CenterOrPreviousOrth,RandeffsInitialization.PreviousOrth. The default isRandeffsInitialization.PreviousOrththat carries over the estimate from the previous iteration. The description of each option can be found in the docstrings.Reexport
cor2covfromStatsBase.jlto complementcov2corfor working with conversion between correlation and covariance matrices.Reexport
doffromStatsAPI.jland add a method forFittedPumasModelto get the degrees of freedom of the model. Note, the interpretation of degrees of freedom in mixed effects models is not straightforward and this method provides a simple approximation. Please see the following references for more information and what it means for things like test statistic distributions and AIC calculations.- https://bbolker.github.io/mixedmodels-misc/glmmFAQ.html#why-doesnt-lme4-display-denominator-degrees-of-freedomp-values-what-other-options-do-i-have
- https://bbolker.github.io/mixedmodels-misc/glmmFAQ.html#can-i-use-aic-for-mixed-models-how-do-i-count-the-number-of-degrees-of-freedom-for-a-random-effect
- https://www.jstatsoft.org/article/view/v107i06
- https://www.sciencedirect.com/science/article/abs/pii/S0167947319300283
Reexport
BlockDiagonalfromBlockDiagonals.jlto be used in Pumas when defining block-diagonal covariance matrices.Perform bootstrap inference with stratification over several variables at once. The variables must be present in the subjects as covariates and the stratification is specified as a vector of symbols (
stratify = [:AGE, :WEIGHT]). All stratification variable must be constant since subjects are sampled as whole units.Pumas now run natively on AppleSilicon (M) chips. This improves performance and avoids issues with multi-threading.
Improvements
- Improve performance of
@delayby computing normalizing constants only once. - Improve performance of some derivative computations by combing primal and derivative evaluations.
- Improve the way weighted residuals are computed to reduce unnecessary computations and allocations.
- Improve the sampling in
SIRby using log weights and reducing allocations in SIR. - Ignore non-Gaussian error models in ϵ-shrinkage calculation to allow for proper handling of models with a mix of Gaussian and non-Gaussian error models.
- Reuse ensemble algorithm when re-computation of Empirical Bayes Estimates is necessary with
FittedPumasModelas input.
Documentation and error messages
- Show warning if overlapping steady-state infusions are detected. Users may want to adjust their dosing regimen to avoid situations where infusions overlap in time.
- Fix typo in the
optim_optionsusage section of thefitdocstring. - Fix docstring of
Central1Periph2the incorrectly described the model as a two-compartment model. - Update the description of
obstimesinpredictdocstring to correctly reflect the way the input is used. - Improve markdown formatting in several docstrings.
- Use Pumas-specific warnings for the ODE solver and suppress warnings when
fitting to avoid writing warnings to the terminal or logs that are irrelevant to the user because the parameter is rejected eventually as part of the estimation process. - Display a warning if a variable is defined in the
@derivedblock using=. - Do not treat internal assertion error as numerical errors. Numerical errors are expected during estimation and should not be confused with internal errors that should actually halt the fitting process.
- Improve checks of valid right hand sides in the
@derivedblock and improve error messages. - Improve checks of valid named on the right hand side of definitions and assignments to avoid confusing errors if the left hand side has invalid characters such as
theta-1that should betheta_1.
Bugs
- Fix handling of reset events with negative time.
- Fix situation where sampling from censored distributions could fail if only one side was censored.
- Respect reset events in distributed
@delay. - Fix support time-varying covariates in
@modelwhen used directly in other blocks than@pre. - Fix
CensoredVPCfor models with multiple dependent variables where some are non-Censored. - Correctly throw bounds errors in
@pre. - Use unicode subscript for ebes in
DataFrame(simobs(...))as was already the case inDataFrame(inspect(...)). - Fix reset-dose events (
evid = 4) with absorption lag. Previously, the reset happened at event time + lag time instead of at event time. - Fix padding of NCA quantities when used in
@observed. Previously, some NCA quantities were not padded correctly.
Deprecations
- Deprecate
omegasand improve error message forNaivePooled. Instead, users should set the corresponding parameters to zero inconstantcoef. - Deprecate
simobs(::FittedPumasModel; kwargs...)in favor of more explicit calls tosimobs. - Deprecate
simobsandpredictused withBayesMCMCResultsin favor of more explicit calls tosimobsandpredictwithmodel,population,param, andrandeffsarguments. This allows for more explicit control over the simulations and predictions and avoids confusion about what is being used as input for the simulations and predictions.
PumasPlots
Features and improvements
- Plot trace of gradient norm in log-scale.
- Show both plots together for censored VPCs in
vpc_plot, displaying continuous and discrete components stacked. - Add
RTsingle sequence cross-over design.
Documentation and error messages
- General improvements to docstrings for
pumas_beandrun_be. - Improved error message if covariate based plots are requested but no covariates are present in the data.
Bugs
- Fix
vpcto handle observation names with underscores. Previously, underscores caused an error to be thrown. - Make
goodness_of_fituse population weighted residuals and population predictions by default for consistency withnpdeplots and literature. - Use dependent variable to correctly set the
yaxisinvpc_plot. - Fix NTID FDA when
CVr>CV_max. Previously, this caused an error to be thrown but NTID FDA does not needCV_max.
NCAUtilities
Features and improvements
- Improve handling of LLQ in plots by adding keywords to control how LLQ is displayed and improving docstrings.
Bugs
- Fix
subject_fitswithpaginate=trueinreport. Previously, an error was thrown.
Bioequivalence
Features and improvements
- Add functionality to use mixed models for 2x2 crossover designs using the keyword
custom_model = LinearMixedModelinpumas_be. - Improved specification of significance levels using
level_keyword arguments. Please see the docstring forpumas_be.
Documentation and error messages
- Improve docstrings for
BioequivalenceEndpointOutput. - Replace
->with::in docstrings when referring to output types.
Bugs
- Fixed a bug that would cause printed lines to have the wrong width.
- Display "with REML" or "without REML" for Mixed Models in the
Model:part of the header of the output.
Deprecations
SummaryTables
Features and improvements
- Added
numeric_defaultandcategorical_defaultkeywords totable_oneto change the default analyses for all columns in a table at once. These parameters can also be changed globally withdefaults!. - All table functions now use the
"label"column metadata as a label by default if it's present. A different key can be set as the default settinglabel_key, ornothingto disable the feature. - Added
recursive = falsekeyword toReplacepostprocessor which causes it to recurse into SummaryTables' own wrapper types likeConcatandMultiline.ReplaceMissingis set to be recursive by default and is considered a bugfix as the intent was always to replace all missings, not just top-level. - Added global defaults system which allows to override float rounding behavior and annotation label styles, among others.
Bugs
- Corrected the docstring of
table_onewhich erroneously listedshow_testnamesand notshow_tests. - Fixed inconsistent classification of categorical data, now the rules are the same for
table_oneandoverview_table. A numeric column is a column with some non-missing values, all of which are subtypes ofRealbut notBool. All other columns are categorical. - Simplified typst escaping, all custom rules were removed and text is simply wrapped in
""with\"as the only escaped character. This avoids bugs where some text is interpreted as special typst markup. - Fixed internal alignment of
Multilinein the LaTeX backend so that it matches the cell alignment. - Fixed unintended enumeration markup in
overview_tablerendered with Typst. - Fixed rendering of concat/styled annotations and footnotes in docx.
AlgebraOfGraphics
Behavior change
- As Makie 0.23 split up
ArrowsinArrows2DandArrows3D,visual(Arrows2D)needs to be specified explicitly now in AlgebraOfGraphics. AsArrows2Dplots polygon shapes now and not a mixture of scatters and lines, the categoricalarrowheadmarker aesthetic had to be removed. - The internal
LinesFillrecipe was removed. This had been used forlinearanddensitytransformations. Instead, both transformations now createProcessedLayerswithBands andLineslayers. This means that certainvisuals multiplied with those transformations may lead to incompatible attribute errors now when callingdrawif they use attributes thatBandandLinesdo not share. On the other hand, you can style layers completely independently withsubvisualnow. To replacedensity() * visual(direction = :y)you can now dodensity(direction = :y)directly. - Added a confidence interval layer to
smoothwhich is enabled by default and can be disabled withinterval = nothing. This will cause breakage wheresmooth() * visual(...)was used with attributes thatBanddoes not know. You can usesmooth() * You can usesmooth() * subvisual(:ci/:prediction, ...)` to target the components specifically. Note that Loess confidence intervals have quadratic memory scaling so they should not be used with very large numbers of observations.
Experimental Features
- Added the experimental
draw_to_specfunction. This can be used as an alternative todrawto create a Makie.SpecApi spec that can be updated interactively using observables.
Features and improvements
- Added the
show_aestheticsfunction which can be used to print information about the aesthetic mappings supported for a given Makie plot type. - Make the
visualsBarPlot,BoxPlot,DensityandCrossBaraware of thestrokecoloraesthetic. Note that, for somevisuals, it is necessary to specify astrokewidthstrictly larger than 0 to appreciate the effect of thestrokecolormapping. Note also that thestrokecoloraesthetic in itself was already available, and it is defined so that it behaves as theColoraesthetic (for example, in terms of scales). Indeed, thevisualsScatter,ScatterLinesandHistwere already aware ofstrokecolor. There are othervisuals that also could usestrokecolor(for example, violin plots), but implementingstrokecolorfor all of them is left for later. - Added
subvisualwhich is a version ofvisualthat restricts its effect to only those layers specified by atargetargument. Intended for the styling of transformations creating multiple plot layers.subvisual(:ci/:prediction, ...)to target the components specifically. Note that Loess confidence intervals have quadratic memory scaling so they should not be used with very large numbers of observations. - Added an auto-label mechanism when using
dimswhich picks up the column labels from the positional arguments ofmappingand assigns them to the categorical values created bydims. Slightly breaking in that the categorical scale now does not consist ofCartesianIndexvalues anymore but the custom typeDimsIndexthat contains information about which dims were requested. - Added
QQPlotandQQNormaesthetics for use with Makie 0.24.7 and up.QQPlotcan take one positional argument and adistributionkeyword from that version on which makes it compatible with AlgebraOfGraphics. - Added
singlexlabelandsingleylabelkeywords todraw(facet = (; ...))with which the behavior can be disabled where the same label across multiple axes is replaced with a single spanning one. - Added
scaletoAesColorscale properties which allows to transform continuous colors with functions such aslog10. - Always treat
layout,row,colandgroupmappings as categorical to simplify common scenarios where grouping information is stored as integers. - Make
mapping(key = (:col1, :col2))work automatically, equivalent to(:col1, :col2) => tuple. - Added the ability to set
scale,ticksandtickformatfor continuous X, Y and Z scales via thescalesoptions which allows to set these in multi-scale facet scenarios. - Added support for Makie's new
TextLabelrecipe.
Documentation and error messages
- Improved error message when two layers with incompatible continuous data are combined.
Bugs
- Improved handling of all-missing subgroups in some cases.
- Fixed a bug where adding a layer without
layoutmapping could result inlayoutfacets that should not have been visible at all.
PumasAide
Initial release of PumasAide, which allows connecting coding agents directly to Pumas sessions.