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

Description Usage Arguments Examples

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

1
LogPq(x)

Arguments

x

Logit(p) where p is a vector of probabilites

Examples

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

Example output

Loading required package: lattice
$logp
[1] -1.609438

$logq
[1] -0.2231436

$logp
[1] -9.21034

$logq
[1] -0.000100005

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