PDF Reports
Standardized PDF reports can be generated from analysis results. These combine all the plots described in the Plotting section of the manual into a single standalone PDF document along with several tables. Report generation is accessed via the report function.
Pumas
The report function discussed in this section only supports continuous data models.
For a single model report based on a fitted model called my_fitted_model we can use the following:
report(my_fitted_model)Once the above report call returns you will find in the output folder a PDF report containing the following sections:
- a cover page
- table of contents
- list of figures
- list of tables
For each fitted model the following is also included:
- listing of metadata associated
latexifyoutput for each block in the model- metric and coefficient tables
- data checkout plots for the populations
- goodness-of-fit plots
- visual predictive check plots if any VPCs are provided
- distribution plots
- convergence trace plots
- tables of individual coefficients
- complete printout of logged output from fitting
- details of the
Manifest.tomlassociated with the active Julia project
Pumas Customization
The following attributes can be customized on a per-report basis. Each one is provided as a keyword argument to report:
PlottingUtilities.report — Function
report(figures::Vector{Figure})Create a report document containing all the figures in figures provided in figures.
Keywords
outputthe directory in which the final document is saved.titlerequired, the title of the document.authorthe author of the document.headercontents of the page headers.footercontents of the page footers.captioncaption to use for each figure.forcereplace theoutputdirectory if it exists.cleanonly save the final document, not intermediate files.landscapeuse landscape orientation for the figures in the document.logopath to a png or svg file used at the bottom of the front page.logo_width_ptwidth inptof the logo on the bottom of the front page.
report(
fitted_models;
output,
title,
version,
date,
author,
categorical,
force,
inspect,
infer,
clean,
header,
footer,
plot_fontsize,
plot_resolution
)
Create a PDF report based on the provided fitted_models.
fitted_models can be provided as one of several different inputs:
A single fitted model result from fit.
fit_result = fit(...)
report(fit_result)Note that ... in these examples is not real syntax and is used in these examples to illustrate unimportant details.
A vector of fitted model results from fit.
fit_1 = fit(...)
fit_2 = fit(...)
report([fit_1, fit_2])The above two calls will result in fitted models named 1 to N. If you wish to provide named fitted models in the resulting report then pass in a NamedTuple instead of a single fit result or vector:
my_named_fit = fit(...)
report((; my_named_fit))fit_1 = fit(...)
fit_2 = fit(...)
report((; fit_1, fit_2))Note the leading ;, which is standard Julia syntax and required for naming your fitted models.
Other computed results can also be included alongside your fit results, namely inspect, infer, and vpc results. Any number of vpc results can be included, while only one of each of inspect and infer may be included. To include associated results along with the fitted model use Julia's tuple syntax, i.e. (a, b, c):
fit_1 = fit(...)
ins_1 = inspect(fit_1, ...)
inf_1 = infer(fit_1, ...)
vpc_1 = vpc(fit_1, ...)
vpc_2 = vpc(fit_1, ...)
report((; my_model = (fit_1, ins_1, inf_1, vpc_1, vpc_2)))Keywords
output: directory into which the final report files will be saved.title: a title for the final report that will appear on the title page and be used for the name of the finished PDF.version: the version of the document, given as av"..."string.date: the date of the report, given as aDatevalue.author: the name of the author of the document.categorical: a vector ofSymbols for covariates that should be treated as categorical in all plots of the report.force: (defaulttrue) remove all contents ofoutput(if it exists) before generating a new report.inspect: (defaulttrue) shouldinspectbe called automatically on fitted models if noinspectresult is already provided. The call toinspectdoes not pass any additional arguments and so if customizedinspectcalls are required, for example when using NPDE, a pre-computedinspectresult should be passed in instead of relying of the automatic behaviour.infer: (defaultfalse) shouldinferbe called automatically on fitted models if noinferresult is already provided.clean: (defaulttrue) only include the final PDF document in theoutputfolder rather than all intermediate files as well.header: custom text to be added to the header section of each page.footer: custom text to be added to the footer section of each page.plot_fontsize: set the font size for all plots in the report. Default is16.plot_resolution: set the resolution for all plots in the report. Default is(960, 540).
Examples
The following will generate a report based on objects fpm1 and fpm2, which are FittedPumasModels. It will automatically call inspect for each.
report((; fpm1, fpm2))The names of the models in the reports will be the same as the variable names. To change the names pass a different key name in the NamedTuple syntax passed to report.
Report-level metadata that should be included in the generated report can be passed in via the keyword arguments title and version, others to be added later.
The name of the resulting PDF file can be given with output = "NAME.pdf.
NCA
NCA report generation is no longer supported. The NCAPopulation and NCAReport objects that report accepted as input do not exist in NCA 3, and neither does the reporting machinery that built the standard PDF from them; run_nca now returns its results as a DataFrame.
The tables and figures a report was built from are still available separately: run_nca and summarize for the tables, and the plotting functions described in the NCA plots section for the figures.