Title: | Mapping First Moment and C-Statistic to the Parameters of Distributions for Risk |
---|---|
Description: | Provides a series of numerical methods for extracting parameters of distributions for risks based on knowing the expected value and c-statistics (e.g., from a published report on the performance of a risk prediction model). This package implements the methodology described in Sadatsafavi et al (2024) <doi:10.48550/arXiv.2409.09178>. The core of the package is mcmap(), which takes a pair of (mean, c-statistic) and the distribution type requested. This function provides a generic interface to more customized functions (mcmap_beta(), mcmap_logitnorm(), mcmap_probitnorm()) for specific distributions. |
Authors: | Mohsen Sadatsafavi [aut, cre] |
Maintainer: | Mohsen Sadatsafavi <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.0.11 |
Built: | 2024-11-05 06:50:55 UTC |
Source: | CRAN |
Functions related to logit-normal distribution.
rlogitnorm(n, mu, sigma) dlogitnorm(x, mu, sigma) plogitnorm(x, mu, sigma) qlogitnorm(x, mu, sigma)
rlogitnorm(n, mu, sigma) dlogitnorm(x, mu, sigma) plogitnorm(x, mu, sigma) qlogitnorm(x, mu, sigma)
n |
Number of draws requested (for rlogitnorm) |
mu |
Mean of the logit-transformed variable |
sigma |
SD of the logit-transformed variable |
x |
For density, CDF, and quantile functions |
Depends on the function
Maps a pair of mean and c-statistic value to the parameters of a specified distribution for risk
mcmap(target, type = c("beta", "logitnorm", "probitnorm"))
mcmap(target, type = c("beta", "logitnorm", "probitnorm"))
target |
A vector of size 2. The first element is mean and the second element is c-statistic. |
type |
One of "beta", "logitnorm", "probitnorm". Loosy matching is enabled (so "b" will be mapped to "beta"). |
An object of class mcmapper. The "value" component returns the parameter. Any warning or error from the integration or gradient ascent will also be returned in the "info" component.
mcmap(c(0.1, 0.75), "beta")
mcmap(c(0.1, 0.75), "beta")
Maps a pair of mean and c-statistic value to the parameters of a beta distribution
mcmap_beta( target, method = "", integrate_controls = list(), optim_controls = list() )
mcmap_beta( target, method = "", integrate_controls = list(), optim_controls = list() )
target |
A vector of size 2. The first element is mean and the second element is c-statistic. |
method |
Not implemented for this funciton yet; leave as empty string. |
integrate_controls |
(optional): parameters to be passed to integrate() |
optim_controls |
(optional): parameters to be passed to optim() |
A vector of size two that contains the distribution parameters
mcmap_beta(c(0.1, 0.75))
mcmap_beta(c(0.1, 0.75))
Maps a pair of mean and c-statistic value to the parameters of an unspecified distribution that is indexed by two parameters
mcmap_generic( target, CDF, integrate_controls = list(), optim_controls = list() )
mcmap_generic( target, CDF, integrate_controls = list(), optim_controls = list() )
target |
A vector of size 2. The first element is mean and the second element is c-statistic. |
CDF |
Cumulative distribution function of an unnspecified distribution. The CDF must be indexed by two parameters. |
integrate_controls |
(optional): parameters to be passed to integrate() |
optim_controls |
(optional): parameters to be passed to optim() |
A vector of size two that contains the distribution parameters
mcmap_generic(c(0.1, 0.75), pbeta)
mcmap_generic(c(0.1, 0.75), pbeta)
Maps a pair of mean and c-statistic value to the parameters of a logit-normal distribution
mcmap_logitnorm( target = c(m = 0.25, c = 0.75), method = "", integrate_controls = list(), optim_controls = list() )
mcmap_logitnorm( target = c(m = 0.25, c = 0.75), method = "", integrate_controls = list(), optim_controls = list() )
target |
A vector of size 2. The first element is mean and the second element is c-statistic. |
method |
Either empty string, which invoked the default method; or "meansolve" which uses two 1-dimensional optimization approach. |
integrate_controls |
(optional): parameters to be passed to integrate() |
optim_controls |
(optional): parameters to be passed to optim() |
A vector of size two that contains the distribution parameters
mcmap_logitnorm(c(0.1, 0.75))
mcmap_logitnorm(c(0.1, 0.75))
Maps a pair of mean and c-statistic value to the parameters of a pobit-normal distribution
mcmap_probitnorm( target = c(m = 0.25, c = 0.75), method = "", integrate_controls = list(), optim_controls = list() )
mcmap_probitnorm( target = c(m = 0.25, c = 0.75), method = "", integrate_controls = list(), optim_controls = list() )
target |
A vector of size 2. The first element is mean and the second element is c-statistic. |
method |
Fir compatibilty with other functions. Use "" for now (alternative optimization methods might be implemented in the future) |
integrate_controls |
(optional): parameters to be passed to integrate() |
optim_controls |
(optional): parameters to be passed to optim() |
A vector of size two that contains the distribution parameters
mcmap_probitnorm(c(0.1, 0.75))
mcmap_probitnorm(c(0.1, 0.75))
Functions related to probit-normal distribution.
dprobitnorm(x, mu, sigma) pprobitnorm(x, mu, sigma) rprobitnorm(n, mu, sigma) qprobitnorm(x, mu, sigma)
dprobitnorm(x, mu, sigma) pprobitnorm(x, mu, sigma) rprobitnorm(n, mu, sigma) qprobitnorm(x, mu, sigma)
x |
For density, CDF, and quantile functions |
mu |
Mean of the probit-transformed variable |
sigma |
SD of the probit-transformed variable |
n |
Number of draws requested (for rprobitnorm) |
Depends on the function