An R6 base class for hyperpriors over MTDi distributions
An R6 base class for hyperpriors over MTDi distributions
With CPE liberating precautionary
from the need for nested simulations,
the opportunity arises for a more encapsulated treatment of MTDi scenario
generators ('hyperpriors') and their sampling. Specifically, individual
sampled scenarios need only yield two functions:
A CDF taking a dose vector $$X = (X_1,...,X_d)$$ to probabilities $$p = (p_1,...,p_d)$$
A function F(X,kappa) yielding a fractionation matrix $F = [0 G; H 0]$. Crucially, this class actually represents an APPROXIMATION to the hyperprior, via a finite set of samples from it. The use of reference classes enables us to improve this approximation efficiently by in-place updating.
This class implements a finite approximation to the infinite set of MTDi scenarios which it describes---an approximation which may be improved dynamically by expanding the samples.
Documentation for Cpe-class
new()
HyperMTDi_lognormal$new(CV, median_mtd, median_sdlog, units, n = 100)
extend()
apply()
f
A closure that realizes a distribution-type function (such as a quantile function or CDF) when evaluated in the environment defined by any row of the sampled parameters.
...
Arguments upon which to evaluate the enclosed function
plot()
col
Color of lines used to depict samples
xlim
May be used to override the default dose-axis limits, which span the 1% to 99% quantiles of all samples.
...
Additional arguments passed onward to plot
if (interactive()) {
mtdi_gen <- HyperMTDi_lognormal$new(CV = 1
,median_mtd = 5
,median_sdlog = 0.5
,units="mg/kg")
mtdi_gen$plot()
}
## ------------------------------------------------
## Method `HyperMTDi_lognormal$plot`
## ------------------------------------------------
if (interactive()) {
mtdi_gen <- HyperMTDi_lognormal$new(CV = 1
,median_mtd = 5
,median_sdlog = 0.5
,units="mg/kg")
mtdi_gen$plot()
}