# ProbOnto

ProbOnto is a knowledge base and ontology of probability distributions. ProbOnto 2.5 (released on January 16, 2017) contains over 150 uni- and multivariate distributions and alternative parameterizations, more than 220 relationships and re-parameterization formulas, supporting also the encoding of empirical and univariate mixture distributions.

## Introduction

ProbOnto was initially designed to facilitate the encoding of nonlinear-mixed effect models and their annotation in Pharmacometrics Markup Language (PharmML) developed by DDMoRe, an Innovative Medicines Initiative project. However, ProbOnto, due to its generic structure can be applied in other platforms and modeling tools for encoding and annotation of diverse models applicable to discrete (e.g. count, categorical and time-to-event) and continuous data.

## Knowledge base

The knowledge base stores for each distribution:
* Probability density or mass functions and where available cumulative distribution, hazard and survival functions.
* Related quantities such as mean, median, mode and variance.
* Parameter and support/range definitions and distribution type.
* LaTeX and R code for mathematical functions.
* Model definition and references.

### Relationships

ProbOnto stores in Version 2.5 over 220 relationships between univariate distributions with re-parameterizations as a special case, see figure. While this form of relationships is often neglected in literature, and the authors concentrate one a particular form for each distribution, they are crucial from the interoperability point of view. ProbOnto focuses on this aspect and features more than 15 distributions with alternative parameterizations.

### Alternative parameterizations

Many distributions are defined with mathematically equivalent but algebraically different formulas. This leads to issues when exchanging models between software tools. The following examples illustrate that.

#### Normal distribution

Normal distribution can be defined in at least three ways
* Normal1(μ,σ) with mean, μ, and standard deviation, σ
$P(x;{\boldsymbol {\mu }},{\boldsymbol {\sigma }})={\frac {1}{\sigma {\sqrt {2\pi }}}}\exp {\Big-{\frac {(x-\mu )^{2}}{2\sigma ^{2}}}{\Big ]}$
* Normal2(μ,υ) with mean, μ, and variance, υ = σ^2 or
$P(x;{\boldsymbol {\mu }},{\boldsymbol {v}})={\frac {1}{{\sqrt {v}}{\sqrt {2\pi }}}}\exp {\Big-{\frac {(x-\mu )^{2}}{2v}}{\Big ]}$
* Normal3(μ,τ) with mean, μ, and precision, τ = 1/υ = 1/σ^2.
$P(x;{\boldsymbol {\mu }},{\boldsymbol {\tau }})={\sqrt {\frac {\tau }{2\pi }}}\exp {\Big-{\frac {\tau }{2}}(x-\mu )^{2}{\Big ]}$

##### Re-parameterization formulas

The following formulas can be used to re-calculate the three different forms of the normal distribution (we use abbreviations i.e. $N1$ instead of $Normal1$ etc.)
* $N1(\mu ,\sigma )\rightarrow N2(\mu ,v):v=\sigma ^{2}{\mbox{ and }}N2(\mu ,v)\rightarrow N1(\mu ,\sigma ):\sigma ={\sqrt {v}};$
* $N1(\mu ,\sigma )\rightarrow N3(\mu ,\tau ):\tau =1/\sigma ^{2}{\mbox{ and }}N3(\mu ,\tau )\rightarrow N1(\mu ,\sigma ):\sigma =1/{\sqrt {\tau }};$
* $N2(\mu ,v)\rightarrow N3(\mu ,\tau ):\tau =1/v{\mbox{ and }}N3(\mu ,\tau )\rightarrow N2(\mu ,v):v=1/\tau .$

#### Log-normal distribution

In the case of the log-normal distribution there are more options. This is due to the fact that it can be parameterized in terms of parameters on the natural and log scale, see figure.
The available forms in ProbOnto 2.0 are
* LogNormal1(μ,σ) with mean, μ, and standard deviation, σ, both on the log-scale
$P(x;{\boldsymbol {\mu }},{\boldsymbol {\sigma }})={\frac {1}{x\sigma {\sqrt {2\pi }}}}\exp {\Big{\frac {-(\log x-\mu )^{2}}{2\sigma ^{2}}}{\Big ]}$
* LogNormal2(μ,υ) with mean, μ, and variance, υ, both on the log-scale
$P(x;{\boldsymbol {\mu }},{\boldsymbol {v}})={\frac {1}{x{\sqrt {v}}{\sqrt {2\pi }}}}\exp {\Big{\frac {-(\log x-\mu )^{2}}{2v}}{\Big ]}$
* LogNormal3(m,σ) with median, m, on the natural scale and standard deviation, σ, on the log-scale
$P(x;{\boldsymbol {m}},{\boldsymbol {\sigma }})={\frac {1}{x\sigma {\sqrt {2\pi }}}}\exp {\Big{\frac {-[\log(x/m)]^{2}}{2\sigma ^{2}}}{\Big ]}$
* LogNormal4(m,cv) with median, m, and coefficient of variation, cv, both on the natural scale
$P(x;{\boldsymbol {m}},{\boldsymbol {cv}})={\frac {1}{x{\sqrt {\log(cv^{2}+1)}}{\sqrt {2\pi }}}}\exp {\Big{\frac {-[\log(x/m)]^{2}}{2\log(cv^{2}+1)}}{\Big ]}$
* LogNormal5(μ,τ) with mean, μ, and precision, τ, both on the log-scale
$P(x;{\boldsymbol {\mu }},{\boldsymbol {\tau }})={\sqrt {\frac {\tau }{2\pi }}}{\frac {1}{x}}\exp {\Big{-{\frac {\tau }{2}}(\log x-\mu )^{2}}{\Big ]}$
* LogNormal6(m,σ$_g$) with median, m, and geometric standard deviation, σ$_g$, both on the natural scale
$P(x;{\boldsymbol {m}},{\boldsymbol {\sigma _{g}}})={\frac {1}{x\log(\sigma _{g}){\sqrt {2\pi }}}}\exp {\Big{\frac {-[\log(x/m)]^{2}}{2\log ^{2}(\sigma _{g})}}{\Big ]}$
* LogNormal7(μ$_N$,σ$_N$) with mean, μ$_N$, and standard deviation, σ$_N$, both on the natural scale
$P(x;{\boldsymbol {\mu _{N}}},{\boldsymbol {\sigma _{N}}})={\frac {1}{x{\sqrt {2\pi \log {\Big1+\sigma _{N}^{2}/\mu _{N}^{2}{\Big )}}}}}\exp {\Bigg{\frac {-{\Big\log(x)-\log {\Big{\frac {\mu _{N}}{\sqrt {1+\sigma _{N}^{2}/\mu _{N}^{2}}}}{\Big )}{\Big ]}^{2}}{2\log {\Big1+\sigma _{N}^{2}/\mu _{N}^{2}{\Big )}}}{\Bigg )}$
ProbOnto knowledge base stores such re-parameterization formulas to allow for a correct translation of models between tools.

##### Examples for re-parameterization

Consider the situation when one would like to run a model using two different optimal design tools, e.g. PFIM and PopED. The former supports the LN2, the latter LN7 parameterization, respectively. Therefore, the re-parameterization is required, otherwise the two tools would produce different results.
For the transition $LN2(\mu ,v)\rightarrow LN7(\mu _{N},\sigma _{N})$ following formulas hold $\mu _{N}=\exp(\mu +v/2){\text{ and }}\sigma _{N}=\exp(\mu +v/2){\sqrt {\exp(v)-1}}$.
For the transition $LN7(\mu _{N},\sigma _{N})\rightarrow LN2(\mu ,v)$ following formulas hold $\mu =\log {\Big\mu _{N}/{\sqrt {1+\sigma _{N}^{2}/\mu _{N}^{2}}}{\Big )}{\text{ and }}v=\log(1+\sigma _{N}^{2}/\mu _{N}^{2})$.
All remaining re-parameterisation formulas can be found in the specification document on the project website.

## Ontology

The knowledge base is built from a simple ontological model. At its core, a probability distribution is an instance of the class thereof, a specialization of the class of mathematical objects. A distribution relates to a number of other individuals, which are instances of various categories in the ontology. For example, these are parameters and related functions associated with a given probability distribution. This strategy allows for the rich representation of attributes and relationships between domain objects. The ontology can be seen as a conceptual schema in the domain of mathematics and has been implemented as a PowerLoom knowledge base. An OWL version is generated programmatically using the Jena API.
Output for ProbOnto are provided as supplementary materials and published on or linked from the probonto.org website. The OWL version of ProbOnto is available via Ontology Lookup Service (OLS) to facilitate simple searching and visualization of the content. In addition the OLS API provides methods to programmatically access ProbOnto and to integrate it into applications. ProbOnto is also registered on the BioSharing portal.

## ProbOnto in PharmML

A PharmML interface is provided in form of a generic XML schema for the definition of the distributions and their parameters. Defining functions, such as probability density function (PDF), probability mass function (PMF), hazard function (HF) and survival function (SF), can be accessed via methods provided in the PharmML schema.

### Use example

This example shows how the zero-inflated Poisson distribution is encoded by using its codename and declaring that of its parameters (‘rate’ and ‘probabilityOfZero’). Model parameters Lambda and P0 are assigned to the parameter code names.
To specify any given distribution unambiguously using ProbOnto, it is sufficient to declare its code name and the code names of its parameters. More examples and a detailed specification can be found on the project website.