log5: Log5

Description Usage Arguments Value Author(s) References See Also Examples

Description

Log5 is a way to estimate the probability that Team A will win a game given the true winning probabilities of Team A and Team B

Usage

1
log5(pA, pB, order = 0)

Arguments

pA

Probability that A wins

pB

Probability that B wins

order

0 = A over B and 1 = B over A

Value

Returns a value equal to (pA-pA*pB)/(pA+pB-2*pA*pB)

Author(s)

Fernando Crema, Peter Xenopoulos

References

https://en.wikipedia.org/wiki/Log5

See Also

pyth

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
## Let's assume team A has a .60 true probability of winning
## Let's assume team B has a .40 true probability of winning
## We should get an output of 0.6923
log5(.60,.40)

## The function is currently defined as
function (pA, pB, order = 0) 
{
    if (order) {
        aux = pB
        pB = pA
        pA = aux
    }
    log5 <- (pA - pA * pB)/(pA + pB - 2 * pA * pB)
    return(log5)
  }

peterxeno/sabermetrics-package documentation built on May 25, 2019, 2:10 a.m.