Converts given odds to probability (proportion)

Probability is converted to odds using

\[\Pr = \frac{O}{1 + O}\]
Parameters:odds (float, NumPy array) – Odds or array of odds to transform into probabilities
Returns:Float or array of probabilities
Return type:prob


Convert a single odds to a probability

>>> from zepid.calc import odds_to_probability
>>> odds_to_probability(0.45)

Convert an array of odds to probabilities

>>> import numpy as np
>>> odds = np.array([0.3, 0.5, 1, 3.1, 1.1])
>>> odds_to_probability(odds)