Logit {SALTSampler}R Documentation

Logit of a Probability Vector

Description

Returns the logit of a vector of probabilities, p. When logp is set to TRUE, the second argument contains natural logs of probabilities.

Usage

Logit(p, logp = FALSE)

Arguments

p

Vector of probabilities or log probabilities

logp

Boolean which is FALSE when the first argument contains probabilities and TRUE when the first argument contains log probabilities

Examples

#Find logit on natural scale
a <- c(0.4, 0.4, 0.1, 0.1)
Logit(p = a)

#Find logit on log scale
b <- c(log(1e-4), log(1e-6), log(1 - 1e-6))
b <- b/sum(b)
Logit(p = b, logp = FALSE)

[Package SALTSampler version 1.1.0 Index]