LW: Lambert's W

Description Usage Arguments Details Value Author(s) References Examples

View source: R/ultimatum.r

Description

Solves for W in the equation W * exp(W) = x.

Usage

1
LW(x)

Arguments

x

vector of values to solve for.

Details

The function is based on the code given in Barry et al. (1995). It is used to calculate fitted values for the ultimatum model.

If negative values of x are supplied, NaNs will likely be returned.

Value

Solutions to Lambert's W for each value in x.

Author(s)

Curt Signorino (curt.signorino@rochester.edu)

References

D.A. Barry, P.J. Culligan-Hensley, and S.J. Barry. 1995. "Real Values of the W-Function." ACM Transactions on Mathematical Software 21(2):161–171.

Examples

1
2
3
x <- rexp(10)
w <- LW(x)
all.equal(x, w * exp(w))

games documentation built on May 2, 2019, 3:26 p.m.