Skip to contents

This function converts log-scale numbers to probabilities.

Usage

mexpit(...)

Arguments

...

numeric log-scale numbers to convert to probabilities.

Value

Probabilities that add up to a number less than 1.

Details

The probabilities are calculated using the following equation:

$$p_i = \frac{e^{x_i}}{1+\sum_{j=1}^{N-1} e^{x_j}}$$

This ensures one remaining probability will add to one, that is

$$p_N = \frac{1}{1+\sum_{j=1}^{N-1} e^{x_j}}$$

Author

Matthew L. Fidler

Examples


m <- mlogit(0.1, 0.2, 0.3)
mexpit(m)
#> [1] 0.1 0.2 0.3

p <- mexpit(-3, 0.5, 3)
mlogit(p)
#> [1] -3.0  0.5  3.0