Learn R Programming

SALTSampler (version 1.1.0)

LogPq: Computes \(log(p)\) and \(log(1-p)\)

Description

For \(x = logit(p)\), this function returns \(log(p)\) and \(log(1-p)\). Special care is taken to ensure accuracy when coordinates are numerically close to \(0\) or \(1\).

Usage

LogPq(x)

Arguments

x

\(Logit(p)\) where \(p\) is a vector of probabilites

Examples

Run this code
# NOT RUN {
#Find log(p) and log(q) for x = logit(0.2)
a <- log(0.2/(1 - 0.2))
LogPq(x = a)

#Find log(p) and log(q) for x = logit(1e-4)
b <- log(1e-4/(1 - 1e-4))
LogPq(x = b)
# }

Run the code above in your browser using DataLab