losig: Compute a sigmoid function of the log-odds of a probability

Description Usage Arguments Details

View source: R/util.R

Description

This function serves as a likelihood adjustment for probabilities where we believe that the value should be greater than (or less than) some cutoff, but we don't have a preference for where within the range above (or below) the threshold the value should be.

Usage

1
losig(p, p0 = 0.5, sig = 5, log = TRUE)

Arguments

p

Vector of probabilities 0 ≤ p ≤ 1.

p0

Threshold probability value.

sig

Steepness of the cliff at the threshold. Higher values produce a steeper dropoff. Values greater than zero favor probabilities above the threshold; values less than zero favor probabilities below the threshold.

log

If TRUE, return the log penalty. Unlike probability density functions, this flag is set TRUE by default.

Details

Let l = \log(\frac{p}{1-p}), land let l_0 = \frac{p_0}{1-p_0}. Then s = \frac{\exp((l-l_0)σ)}{\exp((l-l_0)σ) + \exp(-(l-l_0)σ)}.

Note that as implemented this is not a properly normalized likelihood function. This will not pose a problem, so long as p_0 and σ are not being used as parameters in the Monte Carlo.


rplzzz/CovMitigation documentation built on June 7, 2021, 8:48 a.m.