Logit: Logit of a Probability Vector

Description Usage Arguments Examples

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

1
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

1
2
3
4
5
6
7
8
#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)

SALTSampler documentation built on May 2, 2019, 11:27 a.m.