knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)

uncrtnty

Lifecycle: experimental

{uncrtnty} provides functions and an "uncrtnty"-list class in order to work with uncertainty in NONMEM analyses.

Installation

You can install the development version of uncrtnty from github with:

install.packages("remotes")
remotes::install_github("FelicienLL/uncrtnty")

The big idea

In NONMEM analyses, the uncertainty about parameter estimation can be described as followed. The estimation of THETA follows a multivariate normal distribution, with a mean vector (th_est) and a covariance matrix (th_unc) that carries the information about uncertainty. The estimates of OMEGA/SIGMA are matrices (om_est/si_est), and the uncertainty is informed by degrees of freedom (om_unc/si_unc). In {uncrtnty}, these information are storred into a single "uncrtnty"-list object.

library(uncrtnty)
u_example

This "uncrtnty"-list object can be created:

This "uncrtnty"-list object can be used to generate:

Applications

Create the code for the $PRIOR routine in NONMEM

u_to_nwpri(u_example)

Create the arguments to simulate with uncrtnty in simpar

u_to_simpar(u_example, nsim = 100)

Other useful features

lstfile <- readLines(system.file("nm", "run003a.lst", package = "uncrtnty"))
m <- matrix(c(1, 0.12, 0.13, 0, 0, 0.12, 2, 0.23, 0, 0, 0.13, 0.23, 3, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0 ,0 ,5), nrow = 5)
cat(lstfile[84:110], sep = "\n") # zoom inside a NONMEM .lst file
parse_lst(lst = lstfile)$om_blockform
parse_lst(lst = lstfile)$si_blockform
m
infer_blockform(m)
matrix_to_list(m)
est_om <- matrix(c(0.2, 0.01, 0.01, 0.1), ncol = 2)
se_om <- matrix(c(0.02, 0.005, 0.005, 0.03), ncol = 2)
compute_df(est = est_om, se = se_om)


FelicienLL/uncrtnty documentation built on Oct. 26, 2023, 12:50 p.m.