# 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 and optim_options as separate keywords instead of using the optimize_fn interface. optim_alg can be set to an optimizer from Optim.jl, and optim_options is a NamedTuple that specifies options according to the Optim.Options interface. See ?fit for more information.

• Add nobs methods for Subject and Population. 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 to BayesMCMC and MarginalMCMC to match the fit feature for linearized models. See ?BayesMCMC and ?MarginalMCMC for more information.

• Added sample_params(::PumasModel; rng) and sample_params(::PumasEMModel; rng) to allow for sampling from the prior distribution of parameters for both Pumas models and SAEM Pumas models. The optional rng 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 a Population as input. The new default is EnsembleThreads.

• 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, and aicc. For example, fit(model, data, param, Pumas.FOCE()) can now be written as fit(model, data, param, FOCE()) without the Pumas.* 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 some fit 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 for PumasModels. 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 following addl doses are just regular evid == 1 doses.
• Check that input constantcoef and omegas are consistent with the model in fit calls.
• Added a descriptive error message for definitions of functions in the @pre block that are not defined using the x -> 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 or fit. 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 @emmodels with @dosecontrol blocks.
• Fixed a bug where the types of id and time would not be well-defined in the construction of DataFrame output from Subjects 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 NCASubjects from Subjects 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 cause mdv handling to be turned on even if the user did not provide the column name in read_pumas.
• Change negative bioav/duration check from an assertion toDomainError. These errors are then automatically handled by the numerical error handling described in the Feature section.
• Add compartment names for dose control parameters in model generation using the model builder.
• Fix DataFrame constructors for inspect output. Spurious missing entries would be added at time 0 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 a DataFramecould not contain missings. This could also occur during vpc calls if prediction_correction was set to true.
• 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 by simobs.

## 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 the explore_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.