PumasPlots Docstrings

PlottingUtilities.observations_vs_time — Method
observations_vs_time([model,] subject | population | fit | inspect)
observations_vs_time(figpos, [model,] subject | population | fit | inspect)

Plot observations versus time profiles for the given population. Optionally the associated model can be given as the first argument which can provide more detailed axis labels based on the descriptions and metadata from the model's definition. A single fit or inspect object can be passed in instead of providing the model and population pair.

Keywords

  • loess: Add a loess fit line to the plot. Default is true.

  • observations: The observations to be plotted. When not specified then all observations for the given model will be shown. A subset of observations can be plotted by providing a Symbol or Vector{Symbol} of observation names.

  • separate: Choose whether to overlay all plots or place each in a separate subplot.

  • labels: The custom name to use for each individual series within in the plot such as a scatter or line. Provide a NamedTuple with any of the following keys and your custom label string: observed, and loess.

  • paginate: (default false) When true sets the return type of a plot to a Vector{AlgebraOfGraphics.FigureGrid} rather than a single AlgebraOfGraphics.FigureGrid, splitting the returned plot over several "pages" if there are too many to fit on a single figure comfortably. See also limit, rows, and columns for controlling page size and grid shape.

  • limit: Sets the maximum number of axes that can be plotted per page when pagination is active. Cannot be combined with rows and columns.

  • rows: Sets the number of rows per page when pagination is active. For plots with a layout scale, must be specified together with columns. The grid shape is controlled via AlgebraOfGraphics.wrapped(; cols = columns) and the page limit is computed as rows × columns. For plots with row/col scales, translates directly to the corresponding pagination parameter.

  • columns: Sets the number of columns per page when pagination is active. For plots with a layout scale, must be specified together with rows. The grid shape is controlled via AlgebraOfGraphics.wrapped(; cols = columns) and the page limit is computed as rows × columns. For plots with row/col scales, translates directly to the corresponding pagination parameter.

  • axis: A key-value object with axis options that gets passed to the underlying AlgebraOfGraphics.draw call.

  • figure: A key-value object with figure options that gets passed to the underlying AlgebraOfGraphics.draw call. (Does not apply when plotting into an existing figure.)

  • legend: A key-value object with legend options that gets passed to the underlying AlgebraOfGraphics.draw call. (Does not apply when plotting into an existing figure.) A legend will be drawn automatically unless legend = (; show = false) is set.

  • facet: A key-value object with facet options that gets passed to the underlying AlgebraOfGraphics.draw call.

  • colorbar: A key-value object with colorbar options that gets passed to the underlying AlgebraOfGraphics.draw call. (Does not apply when plotting into an existing figure.)

Supported Style Keywords

  • color
  • linewidth
  • linestyle
  • marker
  • markercolor
  • markersize
  • loess_color
  • loess_linestyle
  • loess_linewidth
PlottingUtilities.subject_fits — Method
subject_fits(inspect | [model], predict)
subject_fits(figpos, inspect | [model], predict)

Plot the population and individual predictions overlaid over observations for the provided observations by ID and the given inspect object, or the combination of a model and the results of predict.

Keywords

  • ids: Select which subject IDs to display. Can be either a single ID or a Vector of IDs. Note that the type of the ID must match those in the population, i.e. a value 1 is not the same as a "1".

  • observations: The observations to be plotted. When not specified then all observations for the given model will be shown. A subset of observations can be plotted by providing a Symbol or Vector{Symbol} of observation names.

  • separate: Choose whether to overlay all plots or place each in a separate subplot.

  • labels: The custom name to use for each individual series within in the plot such as a scatter or line. Provide a NamedTuple with any of the following keys and your custom label string: data, pred, and ipred.

  • paginate: (default false) When true sets the return type of a plot to a Vector{AlgebraOfGraphics.FigureGrid} rather than a single AlgebraOfGraphics.FigureGrid, splitting the returned plot over several "pages" if there are too many to fit on a single figure comfortably. See also limit, rows, and columns for controlling page size and grid shape.

  • limit: Sets the maximum number of axes that can be plotted per page when pagination is active. Cannot be combined with rows and columns.

  • rows: Sets the number of rows per page when pagination is active. For plots with a layout scale, must be specified together with columns. The grid shape is controlled via AlgebraOfGraphics.wrapped(; cols = columns) and the page limit is computed as rows × columns. For plots with row/col scales, translates directly to the corresponding pagination parameter.

  • columns: Sets the number of columns per page when pagination is active. For plots with a layout scale, must be specified together with rows. The grid shape is controlled via AlgebraOfGraphics.wrapped(; cols = columns) and the page limit is computed as rows × columns. For plots with row/col scales, translates directly to the corresponding pagination parameter.

  • axis: A key-value object with axis options that gets passed to the underlying AlgebraOfGraphics.draw call.

  • figure: A key-value object with figure options that gets passed to the underlying AlgebraOfGraphics.draw call. (Does not apply when plotting into an existing figure.)

  • legend: A key-value object with legend options that gets passed to the underlying AlgebraOfGraphics.draw call. (Does not apply when plotting into an existing figure.) A legend will be drawn automatically unless legend = (; show = false) is set.

  • facet: A key-value object with facet options that gets passed to the underlying AlgebraOfGraphics.draw call.

  • colorbar: A key-value object with colorbar options that gets passed to the underlying AlgebraOfGraphics.draw call. (Does not apply when plotting into an existing figure.)

Supported Style Keywords

  • marker
  • markersize
  • markercolor
  • ipred_color
  • ipred_linewidth
  • ipred_linestyle
  • pred_color
  • pred_linewidth
  • pred_linestyle
PumasPlots.autocor_plot — Function
autocor_plot(results::BayesMCMCResults, kw...)

Plot autocorrelations for chains from BayesMCMCResults.

Keyword arguments

  • subjects = nothing: If set to nothing, the population parameters are plotted. If set to an Int n, the individual parameters of the nth subject are plotted. If set to an AbstractVector{<:Int}, the parameters for all chosen subjects are plotted.
  • parameters = nothing: If set to nothing, all parameters for the chosen subjects are plotted. If set to a vector of Symbols, only this subset is plotted.
  • collapse = false: If set to true, all chains are collapsed or concatenated into one chain and plotted as such.
  • colordim = :chain: If set to :chain, each chain is plotted in a different color. If set to :parameter, each parameter is plotted in a different color. If :chain is chosen, the different parameter values create facets, and vice versa.

Deprecated keyword arguments

  • linkxaxes: Can be set to :all to link all x axes, to :minimal to link only within columns, and to :none to unlink all x axes. Pass this via AlgebraOfGraphics's generic facet option instead.
  • linkyaxes: Can be set to :all to link all y axes, to :minimal to link only within rows, and to :none to unlink all y axes. Pass this via AlgebraOfGraphics's generic facet option instead.
PumasPlots.convergence_trace — Function
convergence_trace(fit | inspect)
convergence_trace(figpos, fit | inspect)

Plot the fitting trace for a given fit or inspect object. When a SAEM fit is plotted then traces for $μ$, $Ω$, and $σ$ are plotted, otherwise the -Log-Likelihood and Gradient Norm are plotted side-by-side.

Keywords

  • trace: select which trace to plot. When plotting into a figure position or axis then only a single trace is plotted, otherwise several can be plotted. Available trace names are as follows:

    • @model-based: :loglikelihood and :gradientnorm, or their abbreviations :ll and :gn.
    • @emmodel-based: :μ, :Ω, and :σ, or their fullnames :mu, :Omega, and :sigma.
  • paginate: (default false) When true sets the return type of a plot to a Vector{AlgebraOfGraphics.FigureGrid} rather than a single AlgebraOfGraphics.FigureGrid, splitting the returned plot over several "pages" if there are too many to fit on a single figure comfortably. See also limit, rows, and columns for controlling page size and grid shape.

  • limit: Sets the maximum number of axes that can be plotted per page when pagination is active. Cannot be combined with rows and columns.

  • rows: Sets the number of rows per page when pagination is active. For plots with a layout scale, must be specified together with columns. The grid shape is controlled via AlgebraOfGraphics.wrapped(; cols = columns) and the page limit is computed as rows × columns. For plots with row/col scales, translates directly to the corresponding pagination parameter.

  • columns: Sets the number of columns per page when pagination is active. For plots with a layout scale, must be specified together with rows. The grid shape is controlled via AlgebraOfGraphics.wrapped(; cols = columns) and the page limit is computed as rows × columns. For plots with row/col scales, translates directly to the corresponding pagination parameter.

  • axis: A key-value object with axis options that gets passed to the underlying AlgebraOfGraphics.draw call.

  • figure: A key-value object with figure options that gets passed to the underlying AlgebraOfGraphics.draw call. (Does not apply when plotting into an existing figure.)

  • legend: A key-value object with legend options that gets passed to the underlying AlgebraOfGraphics.draw call. (Does not apply when plotting into an existing figure.) A legend will be drawn automatically unless legend = (; show = false) is set.

  • facet: A key-value object with facet options that gets passed to the underlying AlgebraOfGraphics.draw call.

  • colorbar: A key-value object with colorbar options that gets passed to the underlying AlgebraOfGraphics.draw call. (Does not apply when plotting into an existing figure.)

Supported Style Keywords

  • color
  • colormap
  • linewidth
  • linestyle
PumasPlots.corner_plot! — Method
corner_plot(results::BayesMCMCResults; figure, kw...)
corner_plot!(g::Union{GridPosition, GridSubposition}, results::BayesMCMCResults; kw...)

Creates a corner plot from BayesMCMCResults.

Keyword arguments

  • parameters = nothing: If set to nothing, all parameters for the chosen subject are plotted. If set to a vector of Symbols, only this subset is plotted.
  • subject = nothing: If set to nothing, the population parameters are plotted. If set to an Int n, the individual parameters of the nth subject are plotted.
  • figure: If you use corner_plot (without the !) which creates an implicit Figure, you can pass keyword arguments for the Figure constructor as a NamedTuple with the figure keyword, such as corner_plot(args...; figure = (; size = (500, 600))).
PumasPlots.corner_plot — Method
corner_plot(results::BayesMCMCResults; figure, kw...)
corner_plot!(g::Union{GridPosition, GridSubposition}, results::BayesMCMCResults; kw...)

Creates a corner plot from BayesMCMCResults.

Keyword arguments

  • parameters = nothing: If set to nothing, all parameters for the chosen subject are plotted. If set to a vector of Symbols, only this subset is plotted.
  • subject = nothing: If set to nothing, the population parameters are plotted. If set to an Int n, the individual parameters of the nth subject are plotted.
  • figure: If you use corner_plot (without the !) which creates an implicit Figure, you can pass keyword arguments for the Figure constructor as a NamedTuple with the figure keyword, such as corner_plot(args...; figure = (; size = (500, 600))).
PumasPlots.covariates_check — Function
covariates_check([model,] subject | population | fit | inspect)
covariates_check(figpos, [model,] subject | population | fit | inspect)
Warning

covariates_check is deprecated and will be removed in a future breaking release. To check covariate values against a study protocol, use overview_table or covariates_dist instead.

Plot a scatter plot of IDs against covariates of the given population. Optionally the associated model may also be passed in as the first argument which can provide more detailed y-axis labels based on the descriptions provided in the model definition. Passing a fit or inspect do not require the model argument as well.

Keywords

  • covariates: The covariates to be plotted. When not specified then all covariates for the given model will be shown. A subset of covariates can be plotted by providing a Symbol or Vector{Symbol} of covariate names.

  • paginate: (default false) When true sets the return type of a plot to a Vector{AlgebraOfGraphics.FigureGrid} rather than a single AlgebraOfGraphics.FigureGrid, splitting the returned plot over several "pages" if there are too many to fit on a single figure comfortably. See also limit, rows, and columns for controlling page size and grid shape.

  • limit: Sets the maximum number of axes that can be plotted per page when pagination is active. Cannot be combined with rows and columns.

  • rows: Sets the number of rows per page when pagination is active. For plots with a layout scale, must be specified together with columns. The grid shape is controlled via AlgebraOfGraphics.wrapped(; cols = columns) and the page limit is computed as rows × columns. For plots with row/col scales, translates directly to the corresponding pagination parameter.

  • columns: Sets the number of columns per page when pagination is active. For plots with a layout scale, must be specified together with rows. The grid shape is controlled via AlgebraOfGraphics.wrapped(; cols = columns) and the page limit is computed as rows × columns. For plots with row/col scales, translates directly to the corresponding pagination parameter.

  • axis: A key-value object with axis options that gets passed to the underlying AlgebraOfGraphics.draw call.

  • figure: A key-value object with figure options that gets passed to the underlying AlgebraOfGraphics.draw call. (Does not apply when plotting into an existing figure.)

  • legend: A key-value object with legend options that gets passed to the underlying AlgebraOfGraphics.draw call. (Does not apply when plotting into an existing figure.) A legend will be drawn automatically unless legend = (; show = false) is set.

  • facet: A key-value object with facet options that gets passed to the underlying AlgebraOfGraphics.draw call.

  • colorbar: A key-value object with colorbar options that gets passed to the underlying AlgebraOfGraphics.draw call. (Does not apply when plotting into an existing figure.)

Supported Stype Keywords

  • color
  • marker
  • markersize
PumasPlots.covariates_dist — Function
covariates_dist([model,], subject | population | fit | inspect)
covariates_dist(figpos, [model,], subject | population | fit | inspect)

Plot the distribution of covariates for the given population. An optional associated model may be passed in as the first argument which will be used to provide more detailed axis labels based on the metadata and descriptions provided in the model definition, if any. A single fit or inspect object may also be used in place of the model and population arguments.

Each subject contributes a single value per covariate. For time-varying covariates, the baseline (first) value of each subject is used.

Keywords

  • covariates: The covariates to be plotted. When not specified then all covariates for the given model will be shown. A subset of covariates can be plotted by providing a Symbol or Vector{Symbol} of covariate names.

  • categorical: Select which of the variables should be interpreted as categorical. Provide a vector of symbols corresponding to the names of the categorical variables. By default all variables are treated as continuous.

  • paginate: (default false) When true sets the return type of a plot to a Vector{AlgebraOfGraphics.FigureGrid} rather than a single AlgebraOfGraphics.FigureGrid, splitting the returned plot over several "pages" if there are too many to fit on a single figure comfortably. See also limit, rows, and columns for controlling page size and grid shape.

  • limit: Sets the maximum number of axes that can be plotted per page when pagination is active. Cannot be combined with rows and columns.

  • rows: Sets the number of rows per page when pagination is active. For plots with a layout scale, must be specified together with columns. The grid shape is controlled via AlgebraOfGraphics.wrapped(; cols = columns) and the page limit is computed as rows × columns. For plots with row/col scales, translates directly to the corresponding pagination parameter.

  • columns: Sets the number of columns per page when pagination is active. For plots with a layout scale, must be specified together with rows. The grid shape is controlled via AlgebraOfGraphics.wrapped(; cols = columns) and the page limit is computed as rows × columns. For plots with row/col scales, translates directly to the corresponding pagination parameter.

  • axis: A key-value object with axis options that gets passed to the underlying AlgebraOfGraphics.draw call.

  • figure: A key-value object with figure options that gets passed to the underlying AlgebraOfGraphics.draw call. (Does not apply when plotting into an existing figure.)

  • legend: A key-value object with legend options that gets passed to the underlying AlgebraOfGraphics.draw call. (Does not apply when plotting into an existing figure.) A legend will be drawn automatically unless legend = (; show = false) is set.

  • facet: A key-value object with facet options that gets passed to the underlying AlgebraOfGraphics.draw call.

  • colorbar: A key-value object with colorbar options that gets passed to the underlying AlgebraOfGraphics.draw call. (Does not apply when plotting into an existing figure.)

Supported Style Keywords

  • color
  • strokecolor
  • strokewidth
PumasPlots.cummean_plot — Function
cummean_plot(results::BayesMCMCResults, kw...)

Plot cumulative means for chains from BayesMCMCResults.

Keyword arguments

  • subjects = nothing: If set to nothing, the population parameters are plotted. If set to an Int n, the individual parameters of the nth subject are plotted. If set to an AbstractVector{<:Int}, the parameters for all chosen subjects are plotted.
  • parameters = nothing: If set to nothing, all parameters for the chosen subjects are plotted. If set to a vector of Symbols, only this subset is plotted.
  • collapse = false: If set to true, all chains are collapsed or concatenated into one chain and plotted as such.
  • colordim = :chain: If set to :chain, each chain is plotted in a different color. If set to :parameter, each parameter is plotted in a different color. If :chain is chosen, the different parameter values create facets, and vice versa.

Deprecated keyword arguments

  • linkxaxes: Can be set to :all to link all x axes, to :minimal to link only within columns, and to :none to unlink all x axes. Pass this via AlgebraOfGraphics's generic facet option instead.
  • linkyaxes: Can be set to :all to link all y axes, to :minimal to link only within rows, and to :none to unlink all y axes. Pass this via AlgebraOfGraphics's generic facet option instead.
PumasPlots.density_plot — Function
density_plot(results::BayesMCMCResults)

Plot densities for chains from BayesMCMCResults.

Keyword arguments

  • subjects = nothing: If set to nothing, the population parameters are plotted. If set to an Int n, the individual parameters of the nth subject are plotted. If set to an AbstractVector{<:Int}, the parameters for all chosen subjects are plotted.
  • parameters = nothing: If set to nothing, all parameters for the chosen subjects are plotted. If set to a vector of Symbols, only this subset is plotted.
  • collapse = false: If set to true, all chains are collapsed or concatenated into one chain and plotted as such.
  • colordim = :chain: If set to :chain, each chain is plotted in a different color. If set to :parameter, each parameter is plotted in a different color. If :chain is chosen, the different parameter values create facets, and vice versa.

Deprecated keyword arguments

  • linkxaxes: Can be set to :all to link all x axes, to :minimal to link only within columns, and to :none to unlink all x axes. Pass this via AlgebraOfGraphics's generic facet option instead.
  • linkyaxes: Can be set to :all to link all y axes, to :minimal to link only within rows, and to :none to unlink all y axes. Pass this via AlgebraOfGraphics's generic facet option instead.
PumasPlots.empirical_bayes_dist — Function
empirical_bayes_dist(inspect)
empirical_bayes_dist(figpos, inspect)

Plot the distribution of random effects for the given inspect object. Axis label will be based on the metadata and descriptions provided in the model's definition, if any.

Since the empirical bayes estimates are constant within each subject, the data is reduced to one row per subject before plotting, so subjects contribute equally regardless of their number of observations.

Keywords

  • ebes: Select which variable, as a Symbol, to plot. By default plots all available. Provide a Vector{Symbol} to plot a subset of all available variables.

  • zeroline: Include a zeroline in the plot. Default is false.

  • paginate: (default false) When true sets the return type of a plot to a Vector{AlgebraOfGraphics.FigureGrid} rather than a single AlgebraOfGraphics.FigureGrid, splitting the returned plot over several "pages" if there are too many to fit on a single figure comfortably. See also limit, rows, and columns for controlling page size and grid shape.

  • limit: Sets the maximum number of axes that can be plotted per page when pagination is active. Cannot be combined with rows and columns.

  • rows: Sets the number of rows per page when pagination is active. For plots with a layout scale, must be specified together with columns. The grid shape is controlled via AlgebraOfGraphics.wrapped(; cols = columns) and the page limit is computed as rows × columns. For plots with row/col scales, translates directly to the corresponding pagination parameter.

  • columns: Sets the number of columns per page when pagination is active. For plots with a layout scale, must be specified together with rows. The grid shape is controlled via AlgebraOfGraphics.wrapped(; cols = columns) and the page limit is computed as rows × columns. For plots with row/col scales, translates directly to the corresponding pagination parameter.

  • axis: A key-value object with axis options that gets passed to the underlying AlgebraOfGraphics.draw call.

  • figure: A key-value object with figure options that gets passed to the underlying AlgebraOfGraphics.draw call. (Does not apply when plotting into an existing figure.)

  • legend: A key-value object with legend options that gets passed to the underlying AlgebraOfGraphics.draw call. (Does not apply when plotting into an existing figure.) A legend will be drawn automatically unless legend = (; show = false) is set.

  • facet: A key-value object with facet options that gets passed to the underlying AlgebraOfGraphics.draw call.

  • colorbar: A key-value object with colorbar options that gets passed to the underlying AlgebraOfGraphics.draw call. (Does not apply when plotting into an existing figure.)

Supported Style Keywords

  • color
  • strokecolor
  • strokewidth
  • zeroline_color
  • zeroline_linestyle
  • zeroline_linewidth
PumasPlots.empirical_bayes_vs_covariates — Function
empirical_bayes_vs_covariates(inspect)
empirical_bayes_vs_covariates(figpos, inspect)

Plot the random effects versus covariates for the given inspect object. Axis label will be based on the metadata and descriptions provided in the model's definition, if any. Reports the Pearson correlation coefficient r.

Since the empirical bayes estimates are constant within each subject, the data is reduced to one row per subject before plotting, so subjects contribute equally regardless of their number of observations. For time-varying covariates, the baseline (first) value of each subject is used, so a covariate that is identical for all subjects at baseline is plotted without a correlation coefficient.

Keywords

  • categorical: Select which of the variables should be interpreted as categorical. Provide a vector of symbols corresponding to the names of the categorical variables. By default all variables are treated as continuous.

  • covariates: The covariates to be plotted. When not specified then all covariates for the given model will be shown. A subset of covariates can be plotted by providing a Symbol or Vector{Symbol} of covariate names.

  • ebes: Select which variable, as a Symbol, to plot. By default plots all available. Provide a Vector{Symbol} to plot a subset of all available variables.

  • loess: Add a loess fit line to the plot. Default is true.

  • zeroline: Include a zeroline in the plot. Default is false.

  • paginate: (default false) When true sets the return type of a plot to a Vector{AlgebraOfGraphics.FigureGrid} rather than a single AlgebraOfGraphics.FigureGrid, splitting the returned plot over several "pages" if there are too many to fit on a single figure comfortably. See also limit, rows, and columns for controlling page size and grid shape.

  • limit: Sets the maximum number of axes that can be plotted per page when pagination is active. Cannot be combined with rows and columns.

  • rows: Sets the number of rows per page when pagination is active. For plots with a layout scale, must be specified together with columns. The grid shape is controlled via AlgebraOfGraphics.wrapped(; cols = columns) and the page limit is computed as rows × columns. For plots with row/col scales, translates directly to the corresponding pagination parameter.

  • columns: Sets the number of columns per page when pagination is active. For plots with a layout scale, must be specified together with rows. The grid shape is controlled via AlgebraOfGraphics.wrapped(; cols = columns) and the page limit is computed as rows × columns. For plots with row/col scales, translates directly to the corresponding pagination parameter.

  • axis: A key-value object with axis options that gets passed to the underlying AlgebraOfGraphics.draw call.

  • figure: A key-value object with figure options that gets passed to the underlying AlgebraOfGraphics.draw call. (Does not apply when plotting into an existing figure.)

  • legend: A key-value object with legend options that gets passed to the underlying AlgebraOfGraphics.draw call. (Does not apply when plotting into an existing figure.) A legend will be drawn automatically unless legend = (; show = false) is set.

  • facet: A key-value object with facet options that gets passed to the underlying AlgebraOfGraphics.draw call.

  • colorbar: A key-value object with colorbar options that gets passed to the underlying AlgebraOfGraphics.draw call. (Does not apply when plotting into an existing figure.)

Supported Style Keywords

  • color
  • loess_color
  • loess_linestyle
  • loess_linewidth
  • marker
  • markersize
  • zeroline_color
  • zeroline_linestyle
  • zeroline_linewidth
PumasPlots.facet_height — Method
facet_height(n)

Default height tier for an axis given the grid extent n (max of rows, columns). Sized so that even wide (3:2) axes approximately fit on A4 with ~25mm margins. Makie CSS pixels map to PDF points at 0.75× (96 dpi → 72 dpi). Note that this can only be a heuristic because of title sizes, gaps, legends, etc.

PumasPlots.facet_size — Method
facet_size(aspect::Real)

Return an AlgebraOfGraphics.FacetSize with the given axis aspect ratio (width/height) and the default facet_height tier policy. Used as a recipe-level axis size hint.

PumasPlots.forest_plot — Function
forest_plot(results::BayesMCMCResults; kw...)

Creates a forest plot from BayesMCMCResults.

Keyword arguments

  • parameters = nothing: If set to nothing, all parameters are plotted. If set to a vector of Symbols, only this subset is plotted.
  • subject = nothing: If set to nothing, the population parameters are plotted. If set to an Int n, the individual parameters of the nth subject are plotted.
  • hpd_val = [0.05, 0.2]: A vector of α levels for which highest posterior density intervals are plotted.
  • q = [0.1, 0.9]: The quantile boundaries that are plotted.
  • ordered = false: If false, parameters are plotted in the order they have within the results struct or the by the one from parameters if that is not nothing. If true, they are plotted ordered by their median value.
PumasPlots.goodness_of_fit — Function
goodness_of_fit(inspect)

Plot a 2-by-2 grid of subplots for each observation associated with the inspect object. The plots included are:

  • observations_vs_predictions
  • observations_vs_ipredictions
  • wresiduals_vs_time (or npde_vs_time)
  • wresiduals_vs_predictions (or npde_vs_predictions)

Axis label will be based on the metadata and descriptions provided in the model's definition, if any.

Keywords

  • loess: Add a loess fit line to the plot. Default is true.

  • ols: Add an OLS fit line to the plot. Default is false.

  • observations: The observations to be plotted. When not specified then all observations for the given model will be shown. A subset of observations can be plotted by providing a Symbol or Vector{Symbol} of observation names.

  • paginate: (default false) When true sets the return type of a plot to a Vector{AlgebraOfGraphics.FigureGrid} rather than a single AlgebraOfGraphics.FigureGrid, splitting the returned plot over several "pages" if there are too many to fit on a single figure comfortably. See also limit, rows, and columns for controlling page size and grid shape.

  • limit: Sets the maximum number of axes that can be plotted per page when pagination is active. Cannot be combined with rows and columns.

  • rows: Sets the number of rows per page when pagination is active. For plots with a layout scale, must be specified together with columns. The grid shape is controlled via AlgebraOfGraphics.wrapped(; cols = columns) and the page limit is computed as rows × columns. For plots with row/col scales, translates directly to the corresponding pagination parameter.

  • columns: Sets the number of columns per page when pagination is active. For plots with a layout scale, must be specified together with rows. The grid shape is controlled via AlgebraOfGraphics.wrapped(; cols = columns) and the page limit is computed as rows × columns. For plots with row/col scales, translates directly to the corresponding pagination parameter.

  • axis: A key-value object with axis options that gets passed to the underlying AlgebraOfGraphics.draw call.

  • figure: A key-value object with figure options that gets passed to the underlying AlgebraOfGraphics.draw call. (Does not apply when plotting into an existing figure.)

  • legend: A key-value object with legend options that gets passed to the underlying AlgebraOfGraphics.draw call. (Does not apply when plotting into an existing figure.) A legend will be drawn automatically unless legend = (; show = false) is set.

  • facet: A key-value object with facet options that gets passed to the underlying AlgebraOfGraphics.draw call.

  • colorbar: A key-value object with colorbar options that gets passed to the underlying AlgebraOfGraphics.draw call. (Does not apply when plotting into an existing figure.)

Supported Style Keywords

  • loess_color
  • loess_linestyle
  • loess_linewidth
  • ols_color
  • ols_linestyle
  • ols_linewidth
  • marker
  • markercolor
  • markersize
PumasPlots.iwresiduals_vs_ipredictions — Function
iwresiduals_vs_ipredictions(inspect | [model], wresiduals, predict)
iwresiduals_vs_ipredictions(figpos, inspect | [model], wresiduals, predict)

Plot the weighted individual residuals versus individual predictions for the given inspect object, or the combination of an optional model and the results of wresiduals and predict.

Axis label will be based on the metadata and descriptions provided in the model's definition, if any.

Keywords

  • loess: Add a loess fit line to the plot. Default is true.

  • ols: Add an OLS fit line to the plot. Default is false.

  • observations: The observations to be plotted. When not specified then all observations for the given model will be shown. A subset of observations can be plotted by providing a Symbol or Vector{Symbol} of observation names.

  • zeroline: Include a zeroline in the plot. Default is false.

  • labels: The custom name to use for each individual series within in the plot such as a scatter or line. Provide a NamedTuple with any of the following keys and your custom label string: loess, ols, and observed.

  • paginate: (default false) When true sets the return type of a plot to a Vector{AlgebraOfGraphics.FigureGrid} rather than a single AlgebraOfGraphics.FigureGrid, splitting the returned plot over several "pages" if there are too many to fit on a single figure comfortably. See also limit, rows, and columns for controlling page size and grid shape.

  • limit: Sets the maximum number of axes that can be plotted per page when pagination is active. Cannot be combined with rows and columns.

  • rows: Sets the number of rows per page when pagination is active. For plots with a layout scale, must be specified together with columns. The grid shape is controlled via AlgebraOfGraphics.wrapped(; cols = columns) and the page limit is computed as rows × columns. For plots with row/col scales, translates directly to the corresponding pagination parameter.

  • columns: Sets the number of columns per page when pagination is active. For plots with a layout scale, must be specified together with rows. The grid shape is controlled via AlgebraOfGraphics.wrapped(; cols = columns) and the page limit is computed as rows × columns. For plots with row/col scales, translates directly to the corresponding pagination parameter.

  • axis: A key-value object with axis options that gets passed to the underlying AlgebraOfGraphics.draw call.

  • figure: A key-value object with figure options that gets passed to the underlying AlgebraOfGraphics.draw call. (Does not apply when plotting into an existing figure.)

  • legend: A key-value object with legend options that gets passed to the underlying AlgebraOfGraphics.draw call. (Does not apply when plotting into an existing figure.) A legend will be drawn automatically unless legend = (; show = false) is set.

  • facet: A key-value object with facet options that gets passed to the underlying AlgebraOfGraphics.draw call.

  • colorbar: A key-value object with colorbar options that gets passed to the underlying AlgebraOfGraphics.draw call. (Does not apply when plotting into an existing figure.)

Supported Style Keywords

  • loess_color
  • loess_linestyle
  • loess_linewidth
  • ols_color
  • ols_linestyle
  • ols_linewidth
  • zeroline_color
  • zeroline_linestyle
  • zeroline_linewidth
  • marker
  • markercolor
  • markersize
PumasPlots.iwresiduals_vs_time — Function
iwresiduals_vs_time(inspect | [model], wresiduals)
iwresiduals_vs_time(figpos, inspect | [model], wresiduals)

Plot the weighted individual residuals versus time for the given inspect object, or the combination of an optional model and the result of wresiduals.

Axis label will be based on the metadata and descriptions provided in the model's definition, if any.

Keywords

  • loess: Add a loess fit line to the plot. Default is true.

  • ols: Add an OLS fit line to the plot. Default is false.

  • observations: The observations to be plotted. When not specified then all observations for the given model will be shown. A subset of observations can be plotted by providing a Symbol or Vector{Symbol} of observation names.

  • zeroline: Include a zeroline in the plot. Default is false.

  • labels: The custom name to use for each individual series within in the plot such as a scatter or line. Provide a NamedTuple with any of the following keys and your custom label string: loess, ols, and observed.

  • paginate: (default false) When true sets the return type of a plot to a Vector{AlgebraOfGraphics.FigureGrid} rather than a single AlgebraOfGraphics.FigureGrid, splitting the returned plot over several "pages" if there are too many to fit on a single figure comfortably. See also limit, rows, and columns for controlling page size and grid shape.

  • limit: Sets the maximum number of axes that can be plotted per page when pagination is active. Cannot be combined with rows and columns.

  • rows: Sets the number of rows per page when pagination is active. For plots with a layout scale, must be specified together with columns. The grid shape is controlled via AlgebraOfGraphics.wrapped(; cols = columns) and the page limit is computed as rows × columns. For plots with row/col scales, translates directly to the corresponding pagination parameter.

  • columns: Sets the number of columns per page when pagination is active. For plots with a layout scale, must be specified together with rows. The grid shape is controlled via AlgebraOfGraphics.wrapped(; cols = columns) and the page limit is computed as rows × columns. For plots with row/col scales, translates directly to the corresponding pagination parameter.

  • axis: A key-value object with axis options that gets passed to the underlying AlgebraOfGraphics.draw call.

  • figure: A key-value object with figure options that gets passed to the underlying AlgebraOfGraphics.draw call. (Does not apply when plotting into an existing figure.)

  • legend: A key-value object with legend options that gets passed to the underlying AlgebraOfGraphics.draw call. (Does not apply when plotting into an existing figure.) A legend will be drawn automatically unless legend = (; show = false) is set.

  • facet: A key-value object with facet options that gets passed to the underlying AlgebraOfGraphics.draw call.

  • colorbar: A key-value object with colorbar options that gets passed to the underlying AlgebraOfGraphics.draw call. (Does not apply when plotting into an existing figure.)

Supported Style Keywords

  • loess_color
  • loess_linestyle
  • loess_linewidth
  • ols_color
  • ols_linestyle
  • ols_linewidth
  • zeroline_color
  • zeroline_linestyle
  • zeroline_linewidth
  • marker
  • markercolor
  • markersize
PumasPlots.likelihood_ratio_ppplot — Method
likelihood_ratio_ppplot(infer_bootstrap)
likelihood_ratio_ppplot(figpos, infer_bootstrap)

Plot a P-P plot (probability-probability plot) of the likelihood-ratio statistics of the bootstrap estimates.

Details

Let $\hat{\theta}$ be the maximum-likelihood estimate of dataset $y$. Then the likelihood-ratio statistic of the maximum-likelihood estimate $\hat{\theta}_B$ of bootstrap population $B$ resampled from $y$ is defined as

\[2 (\mathcal{L}(\hat{\theta} | y) - \mathcal{L}(\hat{\theta}_B | y))\]

where $\mathcal{L}(\cdot | y)$ denotes the likelihood function on $y$. In the referenced paper and in PsN, this statistic is called the delta objective function value (dOFV).

If the bootstrap estimates were representative of the true parameter uncertainty, then asymptotically these statistics should follow a Chi-squared distribution. For unconstrained fixed effects models, the degrees of freedom of the asymptotic distribution should be equal to the number of estimated parameters; for general fixed effect models, the degrees of freedom should be equal to or smaller than the number of estimated parameters.

Notes

This P-P plot compares the empirical CDF of the likelihood-ratio statistics against the CDF of the reference Chi-squared distribution. This differs from the visualization in the referenced paper (and PsN's dOFV R plot), which plots the quantile function of the empirical dOFV values against the quantile function of the reference Chi-squared distribution (a Q-Q-style plot).

The annotated degrees of freedom are the maximum-likelihood estimate of a Chi-squared distribution fitted to the likelihood-ratio statistics. It only exists if all statistics are strictly positive, and is reported as NaN otherwise. A non-positive statistic means that the corresponding bootstrap estimate attains at least the same likelihood on the original dataset as $\hat{\theta}$, which indicates that the fit did not converge to the maximum-likelihood estimate.

Keywords

  • identity: Add an identity line to the plot. Default is true.

Supported Style Keywords

  • identity_color
  • identity_linewidth
  • identity_linestyle
  • marker
  • markercolor
  • markersize

References

Dosne, A.-G., Niebecker, R., & Karlsson, M. O. (2016). dOFV distributions: a new diagnostic for the adequacy of parameter uncertainty in nonlinear mixed-effects models applied to the bootstrap. Journal of Pharmacokinetics and Pharmacodynamics, 43(6), 597–608. https://doi.org/10.1007/s10928-016-9496-7

PumasPlots.likelihood_ratio_ppplot — Method
likelihood_ratio_ppplot(infer_sir)
likelihood_ratio_ppplot(figpos, infer_sir)

Plot a P-P plot (probability-probability plot) of the likelihood-ratio statistics of the parameter samples in the SIR (sampling importance resampling) inference procedure.

Details

Let $\hat{\theta}$ be the maximum-likelihood estimate of dataset $y$. Then the likelihood-ratio statistic of the parameter sample $\theta'$ is defined as

\[2 (\mathcal{L}(\hat{\theta} | y) - \mathcal{L}(\theta' | y))\]

where $\mathcal{L}(\cdot | y)$ denotes the likelihood function on $y$. In the referenced papers and in PsN, this statistic is called the delta objective function value (dOFV).

If the parameter samples were representative of the true parameter uncertainty, then asymptotically these statistics should follow a Chi-squared distribution. For unconstrained fixed effects models, the degrees of freedom of the asymptotic distribution should be equal to the number of estimated parameters; for general fixed effect models, the degrees of freedom should be equal to or smaller than the number of estimated parameters.

Notes

This P-P plot compares the empirical CDF of the likelihood-ratio statistics against the CDF of the reference Chi-squared distribution. This differs from the visualization in the referenced papers (and PsN's dOFV R plot), which plots the quantile function of the empirical dOFV values against the quantile function of the reference Chi-squared distribution (a Q-Q-style plot).

The annotated degrees of freedom are the maximum-likelihood estimates of Chi-squared distributions fitted to the likelihood-ratio statistics of each iteration and step. Such an estimate only exists if all statistics of the corresponding iteration and step are strictly positive, and is reported as NaN otherwise. A non-positive statistic means that the corresponding parameter sample attains at least the same likelihood on the original dataset as $\hat{\theta}$, which indicates that the fit did not converge to the maximum-likelihood estimate.

Keywords

  • identity: Add an identity line to the plot. Default is true.

Supported Style Keywords

  • identity_color
  • identity_linewidth
  • identity_linestyle
  • marker_palette
  • markercolor_palette
  • markersize

References

Dosne, A.-G., Bergstrand, M., Harling, K., & Karlsson, M. O. (2016). Improving the estimation of parameter uncertainty distributions in nonlinear mixed effects models using sampling importance resampling. Journal of Pharmacokinetics and Pharmacodynamics, 43(6), 583–596. https://doi.org/10.1007/s10928-016-9487-8

Dosne, A.-G., Bergstrand, M., & Karlsson, M. O. (2017). An automated sampling importance resampling procedure for estimating parameter uncertainty. Journal of Pharmacokinetics and Pharmacodynamics, 44(6), 509–520. https://doi.org/10.1007/s10928-017-9542-0

PumasPlots.npde_dist — Function
npde_dist(inspect)
npde_dist(figpos, inspect)

Keywords

  • observations: The observations to be plotted. When not specified then all observations for the given model will be shown. A subset of observations can be plotted by providing a Symbol or Vector{Symbol} of observation names.

  • zeroline: Include a zeroline in the plot. Default is false.

  • paginate: (default false) When true sets the return type of a plot to a Vector{AlgebraOfGraphics.FigureGrid} rather than a single AlgebraOfGraphics.FigureGrid, splitting the returned plot over several "pages" if there are too many to fit on a single figure comfortably. See also limit, rows, and columns for controlling page size and grid shape.

  • limit: Sets the maximum number of axes that can be plotted per page when pagination is active. Cannot be combined with rows and columns.

  • rows: Sets the number of rows per page when pagination is active. For plots with a layout scale, must be specified together with columns. The grid shape is controlled via AlgebraOfGraphics.wrapped(; cols = columns) and the page limit is computed as rows × columns. For plots with row/col scales, translates directly to the corresponding pagination parameter.

  • columns: Sets the number of columns per page when pagination is active. For plots with a layout scale, must be specified together with rows. The grid shape is controlled via AlgebraOfGraphics.wrapped(; cols = columns) and the page limit is computed as rows × columns. For plots with row/col scales, translates directly to the corresponding pagination parameter.

  • axis: A key-value object with axis options that gets passed to the underlying AlgebraOfGraphics.draw call.

  • figure: A key-value object with figure options that gets passed to the underlying AlgebraOfGraphics.draw call. (Does not apply when plotting into an existing figure.)

  • legend: A key-value object with legend options that gets passed to the underlying AlgebraOfGraphics.draw call. (Does not apply when plotting into an existing figure.) A legend will be drawn automatically unless legend = (; show = false) is set.

  • facet: A key-value object with facet options that gets passed to the underlying AlgebraOfGraphics.draw call.

  • colorbar: A key-value object with colorbar options that gets passed to the underlying AlgebraOfGraphics.draw call. (Does not apply when plotting into an existing figure.)

Supported Style Keywords

  • color
  • strokecolor
  • strokewidth
  • zeroline_color
  • zeroline_linestyle
  • zeroline_linewidth
PumasPlots.npde_vs_covariates — Function
npde_vs_covariates(inspect)
npde_vs_covariates(figpos, inspect)

Keywords

  • categorical: Select which of the variables should be interpreted as categorical. Provide a vector of symbols corresponding to the names of the categorical variables. By default all variables are treated as continuous.

  • covariates: The covariates to be plotted. When not specified then all covariates for the given model will be shown. A subset of covariates can be plotted by providing a Symbol or Vector{Symbol} of covariate names.

  • observations: The observations to be plotted. When not specified then all observations for the given model will be shown. A subset of observations can be plotted by providing a Symbol or Vector{Symbol} of observation names.

  • zeroline: Include a zeroline in the plot. Default is false.

  • paginate: (default false) When true sets the return type of a plot to a Vector{AlgebraOfGraphics.FigureGrid} rather than a single AlgebraOfGraphics.FigureGrid, splitting the returned plot over several "pages" if there are too many to fit on a single figure comfortably. See also limit, rows, and columns for controlling page size and grid shape.

  • limit: Sets the maximum number of axes that can be plotted per page when pagination is active. Cannot be combined with rows and columns.

  • rows: Sets the number of rows per page when pagination is active. For plots with a layout scale, must be specified together with columns. The grid shape is controlled via AlgebraOfGraphics.wrapped(; cols = columns) and the page limit is computed as rows × columns. For plots with row/col scales, translates directly to the corresponding pagination parameter.

  • columns: Sets the number of columns per page when pagination is active. For plots with a layout scale, must be specified together with rows. The grid shape is controlled via AlgebraOfGraphics.wrapped(; cols = columns) and the page limit is computed as rows × columns. For plots with row/col scales, translates directly to the corresponding pagination parameter.

  • axis: A key-value object with axis options that gets passed to the underlying AlgebraOfGraphics.draw call.

  • figure: A key-value object with figure options that gets passed to the underlying AlgebraOfGraphics.draw call. (Does not apply when plotting into an existing figure.)

  • legend: A key-value object with legend options that gets passed to the underlying AlgebraOfGraphics.draw call. (Does not apply when plotting into an existing figure.) A legend will be drawn automatically unless legend = (; show = false) is set.

  • facet: A key-value object with facet options that gets passed to the underlying AlgebraOfGraphics.draw call.

  • colorbar: A key-value object with colorbar options that gets passed to the underlying AlgebraOfGraphics.draw call. (Does not apply when plotting into an existing figure.)

Supported Style Keywords

  • color
  • marker
  • markersize
  • zeroline_color
  • zeroline_linestyle
  • zeroline_linewidth
PumasPlots.npde_vs_predictions — Function
npde_vs_predictions(inspect)
npde_vs_predictions(figpos, inspect)

Keywords

  • loess: Add a loess fit line to the plot. Default is true.

  • ols: Add an OLS fit line to the plot. Default is false.

  • observations: The observations to be plotted. When not specified then all observations for the given model will be shown. A subset of observations can be plotted by providing a Symbol or Vector{Symbol} of observation names.

  • zeroline: Include a zeroline in the plot. Default is false.

  • labels: The custom name to use for each individual series within in the plot such as a scatter or line. Provide a NamedTuple with any of the following keys and your custom label string: loess, ols, and observed.

  • paginate: (default false) When true sets the return type of a plot to a Vector{AlgebraOfGraphics.FigureGrid} rather than a single AlgebraOfGraphics.FigureGrid, splitting the returned plot over several "pages" if there are too many to fit on a single figure comfortably. See also limit, rows, and columns for controlling page size and grid shape.

  • limit: Sets the maximum number of axes that can be plotted per page when pagination is active. Cannot be combined with rows and columns.

  • rows: Sets the number of rows per page when pagination is active. For plots with a layout scale, must be specified together with columns. The grid shape is controlled via AlgebraOfGraphics.wrapped(; cols = columns) and the page limit is computed as rows × columns. For plots with row/col scales, translates directly to the corresponding pagination parameter.

  • columns: Sets the number of columns per page when pagination is active. For plots with a layout scale, must be specified together with rows. The grid shape is controlled via AlgebraOfGraphics.wrapped(; cols = columns) and the page limit is computed as rows × columns. For plots with row/col scales, translates directly to the corresponding pagination parameter.

  • axis: A key-value object with axis options that gets passed to the underlying AlgebraOfGraphics.draw call.

  • figure: A key-value object with figure options that gets passed to the underlying AlgebraOfGraphics.draw call. (Does not apply when plotting into an existing figure.)

  • legend: A key-value object with legend options that gets passed to the underlying AlgebraOfGraphics.draw call. (Does not apply when plotting into an existing figure.) A legend will be drawn automatically unless legend = (; show = false) is set.

  • facet: A key-value object with facet options that gets passed to the underlying AlgebraOfGraphics.draw call.

  • colorbar: A key-value object with colorbar options that gets passed to the underlying AlgebraOfGraphics.draw call. (Does not apply when plotting into an existing figure.)

Supported Style Keywords

  • loess_color
  • loess_linestyle
  • loess_linewidth
  • ols_color
  • ols_linestyle
  • ols_linewidth
  • zeroline_color
  • zeroline_linestyle
  • zeroline_linewidth
  • marker
  • markercolor
  • markersize
PumasPlots.npde_vs_time — Function
npde_vs_time(inspect)
npde_vs_time(figpos, inspect)

Keywords

  • loess: Add a loess fit line to the plot. Default is true.

  • ols: Add an OLS fit line to the plot. Default is false.

  • observations: The observations to be plotted. When not specified then all observations for the given model will be shown. A subset of observations can be plotted by providing a Symbol or Vector{Symbol} of observation names.

  • zeroline: Include a zeroline in the plot. Default is false.

  • labels: The custom name to use for each individual series within in the plot such as a scatter or line. Provide a NamedTuple with any of the following keys and your custom label string: loess, ols, and observed.

  • paginate: (default false) When true sets the return type of a plot to a Vector{AlgebraOfGraphics.FigureGrid} rather than a single AlgebraOfGraphics.FigureGrid, splitting the returned plot over several "pages" if there are too many to fit on a single figure comfortably. See also limit, rows, and columns for controlling page size and grid shape.

  • limit: Sets the maximum number of axes that can be plotted per page when pagination is active. Cannot be combined with rows and columns.

  • rows: Sets the number of rows per page when pagination is active. For plots with a layout scale, must be specified together with columns. The grid shape is controlled via AlgebraOfGraphics.wrapped(; cols = columns) and the page limit is computed as rows × columns. For plots with row/col scales, translates directly to the corresponding pagination parameter.

  • columns: Sets the number of columns per page when pagination is active. For plots with a layout scale, must be specified together with rows. The grid shape is controlled via AlgebraOfGraphics.wrapped(; cols = columns) and the page limit is computed as rows × columns. For plots with row/col scales, translates directly to the corresponding pagination parameter.

  • axis: A key-value object with axis options that gets passed to the underlying AlgebraOfGraphics.draw call.

  • figure: A key-value object with figure options that gets passed to the underlying AlgebraOfGraphics.draw call. (Does not apply when plotting into an existing figure.)

  • legend: A key-value object with legend options that gets passed to the underlying AlgebraOfGraphics.draw call. (Does not apply when plotting into an existing figure.) A legend will be drawn automatically unless legend = (; show = false) is set.

  • facet: A key-value object with facet options that gets passed to the underlying AlgebraOfGraphics.draw call.

  • colorbar: A key-value object with colorbar options that gets passed to the underlying AlgebraOfGraphics.draw call. (Does not apply when plotting into an existing figure.)

Supported Style Keywords

  • loess_color
  • loess_linestyle
  • loess_linewidth
  • ols_color
  • ols_linestyle
  • ols_linewidth
  • zeroline_color
  • zeroline_linestyle
  • zeroline_linewidth
  • marker
  • markercolor
  • markersize
PumasPlots.observations_vs_ipredictions — Function
observations_vs_ipredictions(inspect | [model], predict)
observations_vs_ipredictions(figpos, inspect | [model], predict)

Plot observations versus individual predictions for the given inspect object, or the combination of an optional model and the results of predict.

Axis label will be based on the metadata and descriptions provided in the model's definition, if any.

Keywords

  • identity: Add an identity line to the plot. Default is false.

  • loess: Add a loess fit line to the plot. Default is true.

  • ols: Add an OLS fit line to the plot. Default is false.

  • observations: The observations to be plotted. When not specified then all observations for the given model will be shown. A subset of observations can be plotted by providing a Symbol or Vector{Symbol} of observation names.

  • scale: The scale used for both the x and the y axis. Options are :linear (default) and :log. With :log, trend lines are fit on log10-transformed data (an OLS fit then corresponds to a power model) and the axes are log-scaled. Requires strictly positive data. Use this instead of axis = (; xscale, yscale), which transforms only the display and leaves the trend lines fit in linear space.

  • stratify_by: name of a DataFrame column to colour the points by and to fit the OLS and loess trend lines within (e.g. :subpopulation from a mixture-model inspection). Defaults to nothing (no stratification).

  • labels: The custom name to use for each individual series within in the plot such as a scatter or line. Provide a NamedTuple with any of the following keys and your custom label string: identity, loess, ols, and observed.

  • paginate: (default false) When true sets the return type of a plot to a Vector{AlgebraOfGraphics.FigureGrid} rather than a single AlgebraOfGraphics.FigureGrid, splitting the returned plot over several "pages" if there are too many to fit on a single figure comfortably. See also limit, rows, and columns for controlling page size and grid shape.

  • limit: Sets the maximum number of axes that can be plotted per page when pagination is active. Cannot be combined with rows and columns.

  • rows: Sets the number of rows per page when pagination is active. For plots with a layout scale, must be specified together with columns. The grid shape is controlled via AlgebraOfGraphics.wrapped(; cols = columns) and the page limit is computed as rows × columns. For plots with row/col scales, translates directly to the corresponding pagination parameter.

  • columns: Sets the number of columns per page when pagination is active. For plots with a layout scale, must be specified together with rows. The grid shape is controlled via AlgebraOfGraphics.wrapped(; cols = columns) and the page limit is computed as rows × columns. For plots with row/col scales, translates directly to the corresponding pagination parameter.

  • axis: A key-value object with axis options that gets passed to the underlying AlgebraOfGraphics.draw call.

  • figure: A key-value object with figure options that gets passed to the underlying AlgebraOfGraphics.draw call. (Does not apply when plotting into an existing figure.)

  • legend: A key-value object with legend options that gets passed to the underlying AlgebraOfGraphics.draw call. (Does not apply when plotting into an existing figure.) A legend will be drawn automatically unless legend = (; show = false) is set.

  • facet: A key-value object with facet options that gets passed to the underlying AlgebraOfGraphics.draw call.

  • colorbar: A key-value object with colorbar options that gets passed to the underlying AlgebraOfGraphics.draw call. (Does not apply when plotting into an existing figure.)

Supported Style Keywords

  • identity_color
  • identity_linewidth
  • identity_linestyle
  • loess_color
  • loess_linestyle
  • loess_linewidth
  • ols_color
  • ols_linestyle
  • ols_linewidth
  • marker
  • markercolor
  • markersize
PumasPlots.observations_vs_predictions — Function
observations_vs_predictions(inspect | [model], predict)
observations_vs_predictions(figpos, inspect | [model], predict)

Plot observations versus population predictions for the given inspect object, or the combination of an optional model and the results of predict.

Axis label will be based on the metadata and descriptions provided in the model's definition, if any.

Keywords

  • identity: Add an identity line to the plot. Default is false.

  • loess: Add a loess fit line to the plot. Default is true.

  • ols: Add an OLS fit line to the plot. Default is false.

  • observations: The observations to be plotted. When not specified then all observations for the given model will be shown. A subset of observations can be plotted by providing a Symbol or Vector{Symbol} of observation names.

  • scale: The scale used for both the x and the y axis. Options are :linear (default) and :log. With :log, trend lines are fit on log10-transformed data (an OLS fit then corresponds to a power model) and the axes are log-scaled. Requires strictly positive data. Use this instead of axis = (; xscale, yscale), which transforms only the display and leaves the trend lines fit in linear space.

  • labels: The custom name to use for each individual series within in the plot such as a scatter or line. Provide a NamedTuple with any of the following keys and your custom label string: identity, loess, ols, and observed.

  • paginate: (default false) When true sets the return type of a plot to a Vector{AlgebraOfGraphics.FigureGrid} rather than a single AlgebraOfGraphics.FigureGrid, splitting the returned plot over several "pages" if there are too many to fit on a single figure comfortably. See also limit, rows, and columns for controlling page size and grid shape.

  • limit: Sets the maximum number of axes that can be plotted per page when pagination is active. Cannot be combined with rows and columns.

  • rows: Sets the number of rows per page when pagination is active. For plots with a layout scale, must be specified together with columns. The grid shape is controlled via AlgebraOfGraphics.wrapped(; cols = columns) and the page limit is computed as rows × columns. For plots with row/col scales, translates directly to the corresponding pagination parameter.

  • columns: Sets the number of columns per page when pagination is active. For plots with a layout scale, must be specified together with rows. The grid shape is controlled via AlgebraOfGraphics.wrapped(; cols = columns) and the page limit is computed as rows × columns. For plots with row/col scales, translates directly to the corresponding pagination parameter.

  • axis: A key-value object with axis options that gets passed to the underlying AlgebraOfGraphics.draw call.

  • figure: A key-value object with figure options that gets passed to the underlying AlgebraOfGraphics.draw call. (Does not apply when plotting into an existing figure.)

  • legend: A key-value object with legend options that gets passed to the underlying AlgebraOfGraphics.draw call. (Does not apply when plotting into an existing figure.) A legend will be drawn automatically unless legend = (; show = false) is set.

  • facet: A key-value object with facet options that gets passed to the underlying AlgebraOfGraphics.draw call.

  • colorbar: A key-value object with colorbar options that gets passed to the underlying AlgebraOfGraphics.draw call. (Does not apply when plotting into an existing figure.)

Supported Style Keywords

  • identity_color
  • identity_linewidth
  • identity_linestyle
  • loess_color
  • loess_linestyle
  • loess_linewidth
  • ols_color
  • ols_linestyle
  • ols_linewidth
  • marker
  • markercolor
  • markersize
PumasPlots.ridgeline_plot — Function
ridgeline_plot(results::BayesMCMCResults; kw...)

Creates a ridgeline plot from BayesMCMCResults.

Keyword arguments

  • parameters = nothing: If set to nothing, all parameters for the chosen subject are plotted. If set to a vector of Symbols, only this subset is plotted.
  • subject = nothing: If set to nothing, the population parameters are plotted. If set to an Int n, the individual parameters of the nth subject are plotted.
  • hpd_val = [0.05, 0.2]: A vector of α levels for which highest posterior density intervals are plotted.
  • q = [0.1, 0.9]: The quantile boundaries that are plotted.
  • spacer = nothing: If set to nothing, the distance between the ridgelines is chosen using the maximum density value. You can also set this manually to a Real number.
  • fill_q = true: If true, only the part of the density ride between the quantiles from q is filled. If false, the whole density ridge is filled.
  • fill_hpd = false: If true, only the part of the density corresponding to the tightest hpd interval is filled.
  • ordered = false: If false, parameters are plotted in the order they have within the results struct or the by the one from parameters if that is not nothing. If true, they are plotted ordered by their median value.
PumasPlots.sim_plot — Function
sim_plot([model,] simobs)
sim_plot(figpos, [model,] simobs)

Plot simulated model predictions from the result of a simobs call. The model used to simulate may optionally be passed to sim_plot, which is used to provide improved axis labels.

Keywords

  • ids: Select which subject IDs to display. Can be either a single ID or a Vector of IDs. Note that the type of the ID must match those in the population, i.e. a value 1 is not the same as a "1".

  • separate: Choose whether to overlay all plots or place each in a separate subplot.

  • observations: The observations to be plotted. When not specified then all observations for the given model will be shown. A subset of observations can be plotted by providing a Symbol or Vector{Symbol} of observation names.

  • labels: The custom name to use for each individual series within in the plot such as a scatter or line. Provide a NamedTuple with any of the following keys and your custom label string: simulated, and data.

  • paginate: (default false) When true sets the return type of a plot to a Vector{AlgebraOfGraphics.FigureGrid} rather than a single AlgebraOfGraphics.FigureGrid, splitting the returned plot over several "pages" if there are too many to fit on a single figure comfortably. See also limit, rows, and columns for controlling page size and grid shape.

  • limit: Sets the maximum number of axes that can be plotted per page when pagination is active. Cannot be combined with rows and columns.

  • rows: Sets the number of rows per page when pagination is active. For plots with a layout scale, must be specified together with columns. The grid shape is controlled via AlgebraOfGraphics.wrapped(; cols = columns) and the page limit is computed as rows × columns. For plots with row/col scales, translates directly to the corresponding pagination parameter.

  • columns: Sets the number of columns per page when pagination is active. For plots with a layout scale, must be specified together with rows. The grid shape is controlled via AlgebraOfGraphics.wrapped(; cols = columns) and the page limit is computed as rows × columns. For plots with row/col scales, translates directly to the corresponding pagination parameter.

  • axis: A key-value object with axis options that gets passed to the underlying AlgebraOfGraphics.draw call.

  • figure: A key-value object with figure options that gets passed to the underlying AlgebraOfGraphics.draw call. (Does not apply when plotting into an existing figure.)

  • legend: A key-value object with legend options that gets passed to the underlying AlgebraOfGraphics.draw call. (Does not apply when plotting into an existing figure.) A legend will be drawn automatically unless legend = (; show = false) is set.

  • facet: A key-value object with facet options that gets passed to the underlying AlgebraOfGraphics.draw call.

  • colorbar: A key-value object with colorbar options that gets passed to the underlying AlgebraOfGraphics.draw call. (Does not apply when plotting into an existing figure.)

Supported Style Keywords

  • color
  • linestyle
  • linewidth
  • marker
  • markercolor
  • markersize

color and markercolor can both be set to the name of a gradient in which case each subject will use a different color based on partitioning the gradient into discrete colors. See Makie.available_gradients() for the full list of supported colors.

PumasPlots.trace_plot — Function
trace_plot(results::BayesMCMCResults; kw...))

Plot chain traces for chains from BayesMCMCResults.

Keyword arguments

  • subjects = nothing: If set to nothing, the population parameters are plotted. If set to an Int n, the individual parameters of the nth subject are plotted. If set to an AbstractVector{<:Int}, the parameters for all chosen subjects are plotted.
  • parameters = nothing: If set to nothing, all parameters for the chosen subjects are plotted. If set to a vector of Symbols, only this subset is plotted.
  • collapse = false: If set to true, all chains are collapsed or concatenated into one chain and plotted as such.
  • colordim = :chain: If set to :chain, each chain is plotted in a different color. If set to :parameter, each parameter is plotted in a different color. If :chain is chosen, the different parameter values create facets, and vice versa.

Deprecated keyword arguments

  • linkxaxes: Can be set to :all to link all x axes, to :minimal to link only within columns, and to :none to unlink all x axes. Pass this via AlgebraOfGraphics's generic facet option instead.
  • linkyaxes: Can be set to :all to link all y axes, to :minimal to link only within rows, and to :none to unlink all y axes. Pass this via AlgebraOfGraphics's generic facet option instead.
PumasPlots.vpc_plot — Function
vpc_plot!(axis, [model,] vpc)
vpc_plot(figpos, [model,] vpc)
vpc_plot([model,] vpc)

Keywords

  • ci_bands::Bool show confidence interval band.

  • group select which strata to display, as a tuple of Pair{Symbol,Any} entries or a NamedTuple, such as (:DOSE => 75.0,) or (DOSE = 75.0,). Each key must be a stratification variable and each value must equal one of its values. Strata match when they agree on every given key, so naming a subset of the variables selects several.

  • levels::Union{String,Symbol,Vector} select which levels to display in discrete VPCs.

  • observations::Bool display a scatter plot of the observations data.

  • observed_ci::Bool show the observed confidence interval band.

  • observed_quantiles::Bool show the observed quantiles band.

  • simquantile_medians::Bool show the simulated quantile median line.

  • unit_yaxis::Bool set the limits of the y-axis to the unit range, [0, 1].

  • censored::Symbol either :all (default), :continuous, or :discrete. Controls display of censored VPC pairs: :all shows both stacked, others show only that component.

  • paginate: (default false) When true sets the return type of a plot to a Vector{Makie.Figure} rather than Makie.Figure which splits the returned plot over several "pages" if there are too many to fit on a single figure comfortably. See also limit, rows, and columns for controlling page size and grid shape.

  • limit: Sets the maximum number of axes that can be plotted per page when pagination is active. Cannot be combined with rows and columns.

  • rows: Sets the number of rows per page when pagination is active. For plots with a layout scale, must be specified together with columns. The grid shape is controlled via AlgebraOfGraphics.wrapped(; cols = columns) and the page limit is computed as rows × columns. For plots with row/col scales, translates directly to the corresponding pagination parameter.

  • columns: Sets the number of columns per page when pagination is active. For plots with a layout scale, must be specified together with rows. The grid shape is controlled via AlgebraOfGraphics.wrapped(; cols = columns) and the page limit is computed as rows × columns. For plots with row/col scales, translates directly to the corresponding pagination parameter.

  • legend: Either true or a NamedTuple of keyword arguments to pass to the axislegend function for each created Makie.Axis for the plot.

  • facet: Control the appearance of faceted plots. Off by default. Either true to use default facet settings which hide decorations, ticks, and labels for subplots aside from the left column and bottom row, or a NamedTuple with the following Bool keys:

    • hidexlabels, hideylabels, and hidelabels. Default true. Hides labels that are not on the left or bottom edges.
    • hidexticks, hideyticks, and hideticks. Default true. Hides ticks and tick labels that are not on the left or bottom edges.
    • linkxaxes, linkyaxes, and linkaxes. Default true. Links the limits of the axes along columns/rows.
    • combinexlabels, combineylabels, and combinelabels. Default false. Merges unique labels along the left and bottom edges.
  • labels: The custom name to use for each individual series within in the plot such as a scatter or line. Provide a NamedTuple with any of the following keys and your custom label string: observed, simulated, observed_ci, simulated_ci, and outliers.

Supported Style Keywords

  • outlier_color
  • marker
  • markercolor
  • markersize
  • band_color
  • observed_color
  • observed_linewidth
  • observed_linestyle
  • simulated_color
  • simulated_linewidth
  • simulated_linestyle
PumasPlots.wresiduals_dist — Function
wresiduals_dist(inspect | [model], wresiduals)
wresiduals_dist(figpos, inspect | [model], wresiduals)

Plot the distribution of weighted residuals for the given inspect, or the combination of an optional model and the results of wresiduals.

Axis label will be based on the metadata and descriptions provided in the model's definition, if any.

keywords

  • observations: The observations to be plotted. When not specified then all observations for the given model will be shown. A subset of observations can be plotted by providing a Symbol or Vector{Symbol} of observation names.

  • type: Select which residuals to plot. Options are :wres and :iwres for weighted population or individual residuals respectively. Default is to plot both.

  • zeroline: Include a zeroline in the plot. Default is false.

  • paginate: (default false) When true sets the return type of a plot to a Vector{AlgebraOfGraphics.FigureGrid} rather than a single AlgebraOfGraphics.FigureGrid, splitting the returned plot over several "pages" if there are too many to fit on a single figure comfortably. See also limit, rows, and columns for controlling page size and grid shape.

  • limit: Sets the maximum number of axes that can be plotted per page when pagination is active. Cannot be combined with rows and columns.

  • rows: Sets the number of rows per page when pagination is active. For plots with a layout scale, must be specified together with columns. The grid shape is controlled via AlgebraOfGraphics.wrapped(; cols = columns) and the page limit is computed as rows × columns. For plots with row/col scales, translates directly to the corresponding pagination parameter.

  • columns: Sets the number of columns per page when pagination is active. For plots with a layout scale, must be specified together with rows. The grid shape is controlled via AlgebraOfGraphics.wrapped(; cols = columns) and the page limit is computed as rows × columns. For plots with row/col scales, translates directly to the corresponding pagination parameter.

  • axis: A key-value object with axis options that gets passed to the underlying AlgebraOfGraphics.draw call.

  • figure: A key-value object with figure options that gets passed to the underlying AlgebraOfGraphics.draw call. (Does not apply when plotting into an existing figure.)

  • legend: A key-value object with legend options that gets passed to the underlying AlgebraOfGraphics.draw call. (Does not apply when plotting into an existing figure.) A legend will be drawn automatically unless legend = (; show = false) is set.

  • facet: A key-value object with facet options that gets passed to the underlying AlgebraOfGraphics.draw call.

  • colorbar: A key-value object with colorbar options that gets passed to the underlying AlgebraOfGraphics.draw call. (Does not apply when plotting into an existing figure.)

Supported Style Keywords

  • color
  • strokecolor
  • strokewidth
  • zeroline_color
  • zeroline_linestyle
  • zeroline_linewidth
PumasPlots.wresiduals_vs_covariates — Function
wresiduals_vs_covariates(inspect | [model], wresiduals)
wresiduals_vs_covariates(figpos, inspect | [model], wresiduals)

Plot the weighted population residuals versus covariates for the given inspect object, or the combination of an optional model and the results of wresiduals.

Axis label will be based on the metadata and descriptions provided in the model's definition, if any.

Keywords

  • observations: The observations to be plotted. When not specified then all observations for the given model will be shown. A subset of observations can be plotted by providing a Symbol or Vector{Symbol} of observation names.

  • categorical: Select which of the variables should be interpreted as categorical. Provide a vector of symbols corresponding to the names of the categorical variables. By default all variables are treated as continuous.

  • type: Select which residuals to plot. Options are :wres and :iwres for weighted population or individual residuals respectively. Default is to plot both.

  • covariates: The covariates to be plotted. When not specified then all covariates for the given model will be shown. A subset of covariates can be plotted by providing a Symbol or Vector{Symbol} of covariate names.

  • zeroline: Include a zeroline in the plot. Default is false.

  • paginate: (default false) When true sets the return type of a plot to a Vector{AlgebraOfGraphics.FigureGrid} rather than a single AlgebraOfGraphics.FigureGrid, splitting the returned plot over several "pages" if there are too many to fit on a single figure comfortably. See also limit, rows, and columns for controlling page size and grid shape.

  • limit: Sets the maximum number of axes that can be plotted per page when pagination is active. Cannot be combined with rows and columns.

  • rows: Sets the number of rows per page when pagination is active. For plots with a layout scale, must be specified together with columns. The grid shape is controlled via AlgebraOfGraphics.wrapped(; cols = columns) and the page limit is computed as rows × columns. For plots with row/col scales, translates directly to the corresponding pagination parameter.

  • columns: Sets the number of columns per page when pagination is active. For plots with a layout scale, must be specified together with rows. The grid shape is controlled via AlgebraOfGraphics.wrapped(; cols = columns) and the page limit is computed as rows × columns. For plots with row/col scales, translates directly to the corresponding pagination parameter.

  • axis: A key-value object with axis options that gets passed to the underlying AlgebraOfGraphics.draw call.

  • figure: A key-value object with figure options that gets passed to the underlying AlgebraOfGraphics.draw call. (Does not apply when plotting into an existing figure.)

  • legend: A key-value object with legend options that gets passed to the underlying AlgebraOfGraphics.draw call. (Does not apply when plotting into an existing figure.) A legend will be drawn automatically unless legend = (; show = false) is set.

  • facet: A key-value object with facet options that gets passed to the underlying AlgebraOfGraphics.draw call.

  • colorbar: A key-value object with colorbar options that gets passed to the underlying AlgebraOfGraphics.draw call. (Does not apply when plotting into an existing figure.)

Supported Style Keywords

  • color
  • marker
  • markersize
  • zeroline_color
  • zeroline_linestyle
  • zeroline_linewidth
PumasPlots.wresiduals_vs_predictions — Function
wresiduals_vs_predictions(inspect)
wresiduals_vs_predictions(figpos, inspect)

Plot the weighted residuals versus population predictions for the given inspect object.

Axis label will be based on the metadata and descriptions provided in the model's definition, if any.

Keywords

  • loess: Add a loess fit line to the plot. Default is true.

  • ols: Add an OLS fit line to the plot. Default is false.

  • observations: The observations to be plotted. When not specified then all observations for the given model will be shown. A subset of observations can be plotted by providing a Symbol or Vector{Symbol} of observation names.

  • zeroline: Include a zeroline in the plot. Default is false.

  • labels: The custom name to use for each individual series within in the plot such as a scatter or line. Provide a NamedTuple with any of the following keys and your custom label string: loess, ols, and observed.

  • paginate: (default false) When true sets the return type of a plot to a Vector{AlgebraOfGraphics.FigureGrid} rather than a single AlgebraOfGraphics.FigureGrid, splitting the returned plot over several "pages" if there are too many to fit on a single figure comfortably. See also limit, rows, and columns for controlling page size and grid shape.

  • limit: Sets the maximum number of axes that can be plotted per page when pagination is active. Cannot be combined with rows and columns.

  • rows: Sets the number of rows per page when pagination is active. For plots with a layout scale, must be specified together with columns. The grid shape is controlled via AlgebraOfGraphics.wrapped(; cols = columns) and the page limit is computed as rows × columns. For plots with row/col scales, translates directly to the corresponding pagination parameter.

  • columns: Sets the number of columns per page when pagination is active. For plots with a layout scale, must be specified together with rows. The grid shape is controlled via AlgebraOfGraphics.wrapped(; cols = columns) and the page limit is computed as rows × columns. For plots with row/col scales, translates directly to the corresponding pagination parameter.

  • axis: A key-value object with axis options that gets passed to the underlying AlgebraOfGraphics.draw call.

  • figure: A key-value object with figure options that gets passed to the underlying AlgebraOfGraphics.draw call. (Does not apply when plotting into an existing figure.)

  • legend: A key-value object with legend options that gets passed to the underlying AlgebraOfGraphics.draw call. (Does not apply when plotting into an existing figure.) A legend will be drawn automatically unless legend = (; show = false) is set.

  • facet: A key-value object with facet options that gets passed to the underlying AlgebraOfGraphics.draw call.

  • colorbar: A key-value object with colorbar options that gets passed to the underlying AlgebraOfGraphics.draw call. (Does not apply when plotting into an existing figure.)

Supported Style Keywords

  • loess_color
  • loess_linestyle
  • loess_linewidth
  • ols_color
  • ols_linestyle
  • ols_linewidth
  • zeroline_color
  • zeroline_linestyle
  • zeroline_linewidth
  • marker
  • markercolor
  • markersize
PumasPlots.wresiduals_vs_time — Function
wresiduals_vs_time(inspect | [model], wresiduals)
wresiduals_vs_time(figpos, inspect | [model], wresiduals)

Plot the weighted residuals versus time for the given inspect object, or the combination of an optional model and the results of wresiduals.

Axis label will be based on the metadata and descriptions provided in the model's definition, if any.

Keywords

  • loess: Add a loess fit line to the plot. Default is true.

  • ols: Add an OLS fit line to the plot. Default is false.

  • observations: The observations to be plotted. When not specified then all observations for the given model will be shown. A subset of observations can be plotted by providing a Symbol or Vector{Symbol} of observation names.

  • zeroline: Include a zeroline in the plot. Default is false.

  • labels: The custom name to use for each individual series within in the plot such as a scatter or line. Provide a NamedTuple with any of the following keys and your custom label string: loess, ols, and observed.

  • paginate: (default false) When true sets the return type of a plot to a Vector{AlgebraOfGraphics.FigureGrid} rather than a single AlgebraOfGraphics.FigureGrid, splitting the returned plot over several "pages" if there are too many to fit on a single figure comfortably. See also limit, rows, and columns for controlling page size and grid shape.

  • limit: Sets the maximum number of axes that can be plotted per page when pagination is active. Cannot be combined with rows and columns.

  • rows: Sets the number of rows per page when pagination is active. For plots with a layout scale, must be specified together with columns. The grid shape is controlled via AlgebraOfGraphics.wrapped(; cols = columns) and the page limit is computed as rows × columns. For plots with row/col scales, translates directly to the corresponding pagination parameter.

  • columns: Sets the number of columns per page when pagination is active. For plots with a layout scale, must be specified together with rows. The grid shape is controlled via AlgebraOfGraphics.wrapped(; cols = columns) and the page limit is computed as rows × columns. For plots with row/col scales, translates directly to the corresponding pagination parameter.

  • axis: A key-value object with axis options that gets passed to the underlying AlgebraOfGraphics.draw call.

  • figure: A key-value object with figure options that gets passed to the underlying AlgebraOfGraphics.draw call. (Does not apply when plotting into an existing figure.)

  • legend: A key-value object with legend options that gets passed to the underlying AlgebraOfGraphics.draw call. (Does not apply when plotting into an existing figure.) A legend will be drawn automatically unless legend = (; show = false) is set.

  • facet: A key-value object with facet options that gets passed to the underlying AlgebraOfGraphics.draw call.

  • colorbar: A key-value object with colorbar options that gets passed to the underlying AlgebraOfGraphics.draw call. (Does not apply when plotting into an existing figure.)

Supported Style Keywords

  • loess_color
  • loess_linestyle
  • loess_linewidth
  • ols_color
  • ols_linestyle
  • ols_linewidth
  • zeroline_color
  • zeroline_linestyle
  • zeroline_linewidth
  • marker
  • markercolor
  • markersize

Experimental Features

PumasPlots.Experimental — Module
PumasPlots.Experimental
Warning

Types, methods, or macros defined in this module are experimental and subject to change and will not have deprecations. Caveat emptor.

Plots for the predictive checks in Pumas.Experimental: plot_vpc for the VPC result types and plot_npde for NPDEResult. The module is experimental because the API it renders is: it reads Pumas.Experimental result structs field by field, so it tracks that module's layout rather than a supported interface.

Access it as PumasPlots.Experimental.plot_vpc; nothing here is exported.

PumasPlots.Experimental.plot_vpc — Function
plot_vpc(vpc; kwargs...)

Plot a visual predictive check computed by Pumas.Experimental. Takes an ObservedVPC, SimulatedVPC, ObservedCensoredVPC or SimulatedCensoredVPC.

Returns one figure, with two exceptions: paginate = true returns one figure per page, and a censored VPC returns (; continuous, blq, alq), one figure per panel and nothing where no corresponding limit was set.

Keywords

  • include_observations::Bool scatter the observations behind the curves. Defaults to true for an observed VPC and false for a simulated one.

  • band_alpha::Real = 0.5 opacity of the simulation band. Simulated only.

  • color_outliers::Bool = false mark in red where the observed curve leaves the simulated interval. Simulated only.

  • rect::Bool = false draw each binned summary as a flat step spanning its bin rather than as a line through the bin midpoints. Binned and DirectBins only.

  • midpoint::Symbol = :center plot each bin at its centre, or at :median, the median observed x within the bin. Ignored when rect is set, and for Binless.

  • show_boundaries::Bool = true draw the bin boundaries. Binned and DirectBins only.

  • show_nodes::Bool = true draw the smoothing nodes. Binless only.

  • facet_by_category::Bool = true give each category its own panel instead of overlaying them by colour. Categorical only.

  • simulated_quantile_medians::Bool = false add the median simulated quantile curves. Continuous only.

  • paginate: (default false) When true sets the return type of a plot to a Vector{AlgebraOfGraphics.FigureGrid} rather than a single AlgebraOfGraphics.FigureGrid, splitting the returned plot over several "pages" if there are too many to fit on a single figure comfortably. See also limit, rows, and columns for controlling page size and grid shape.

  • limit: Sets the maximum number of axes that can be plotted per page when pagination is active. Cannot be combined with rows and columns.

  • rows: Sets the number of rows per page when pagination is active. For plots with a layout scale, must be specified together with columns. The grid shape is controlled via AlgebraOfGraphics.wrapped(; cols = columns) and the page limit is computed as rows × columns. For plots with row/col scales, translates directly to the corresponding pagination parameter.

  • columns: Sets the number of columns per page when pagination is active. For plots with a layout scale, must be specified together with rows. The grid shape is controlled via AlgebraOfGraphics.wrapped(; cols = columns) and the page limit is computed as rows × columns. For plots with row/col scales, translates directly to the corresponding pagination parameter.

  • axis: A key-value object with axis options that gets passed to the underlying AlgebraOfGraphics.draw call.

  • figure: A key-value object with figure options that gets passed to the underlying AlgebraOfGraphics.draw call. (Does not apply when plotting into an existing figure.)

  • legend: A key-value object with legend options that gets passed to the underlying AlgebraOfGraphics.draw call. (Does not apply when plotting into an existing figure.) A legend will be drawn automatically unless legend = (; show = false) is set.

  • facet: A key-value object with facet options that gets passed to the underlying AlgebraOfGraphics.draw call.

  • colorbar: A key-value object with colorbar options that gets passed to the underlying AlgebraOfGraphics.draw call. (Does not apply when plotting into an existing figure.)

A censored VPC is a container of three ordinary VPC results, and each panel is drawn through this same path, so every keyword applies to each panel it means something on. With paginate = true each field holds that panel's pages.

A gap in a Binless discrete curve is a node where the local logistic fit failed and no proportion was recorded. Pumas.Experimental warns with a count when that happens, and a different bandwidth usually fixes it.

show_boundaries and show_nodes draw the grid that observed_vpc resolved and stored, which is the grid the observed curve and the simulated band were both computed on. They default to true because a VPC is only interpretable next to its binning, and a re-derived grid would be worse than none: it would look authoritative while being free to disagree with the computation.

PumasPlots.Experimental.plot_npde — Function
plot_npde(result::NPDEResult; type = :all)

Plot NPDE diagnostics computed by Pumas.Experimental.npde. Available types:

  • :qq — NPDE QQ plot against N(0,1)
  • :histogram — NPDE histogram with the N(0,1) density overlaid
  • :scatter — NPDE vs x
  • :ewres_qq — EWRES QQ plot against N(0,1)
  • :all — 2×2 grid of all four

Keywords

  • paginate: (default false) When true sets the return type of a plot to a Vector{AlgebraOfGraphics.FigureGrid} rather than a single AlgebraOfGraphics.FigureGrid, splitting the returned plot over several "pages" if there are too many to fit on a single figure comfortably. See also limit, rows, and columns for controlling page size and grid shape.
  • limit: Sets the maximum number of axes that can be plotted per page when pagination is active. Cannot be combined with rows and columns.
  • rows: Sets the number of rows per page when pagination is active. For plots with a layout scale, must be specified together with columns. The grid shape is controlled via AlgebraOfGraphics.wrapped(; cols = columns) and the page limit is computed as rows × columns. For plots with row/col scales, translates directly to the corresponding pagination parameter.
  • columns: Sets the number of columns per page when pagination is active. For plots with a layout scale, must be specified together with rows. The grid shape is controlled via AlgebraOfGraphics.wrapped(; cols = columns) and the page limit is computed as rows × columns. For plots with row/col scales, translates directly to the corresponding pagination parameter.
  • axis: A key-value object with axis options that gets passed to the underlying AlgebraOfGraphics.draw call.
  • figure: A key-value object with figure options that gets passed to the underlying AlgebraOfGraphics.draw call. (Does not apply when plotting into an existing figure.)
  • legend: A key-value object with legend options that gets passed to the underlying AlgebraOfGraphics.draw call. (Does not apply when plotting into an existing figure.) A legend will be drawn automatically unless legend = (; show = false) is set.
  • facet: A key-value object with facet options that gets passed to the underlying AlgebraOfGraphics.draw call.
  • colorbar: A key-value object with colorbar options that gets passed to the underlying AlgebraOfGraphics.draw call. (Does not apply when plotting into an existing figure.)