Log sum of exponential

Source: Internet
Author: User

The so-called "log sum of exponentials" is a functional form commonly encountered in dynamic discrete choice models in Eco Nomics. It arises when the choice-specific error terms has a Type 1 extreme value distribution–a very common assumption. In these problems there are typically a vector v of length J which represents the non-stochastic payoff associated with EAC H of J choices. In addition to VJ, the payoff associated with Choice J have a random componentεj. If These components is independent and identically distributed across J and follow the type 1 extreme value distribution, Then the expected payoff from choosing optimally are?? [Max{v1+ε1,..., vj+εj}]=ln[exp (v1) +...+exp (VJ)]. We need to numerically evaluate the expression on the right hand side for many different vectors v.

Special care are required to calculate this expression in compiled languages such as Fortran or C to avoid numerical proble Ms The function needs to work for V with very large and very small components. A large VJ can cause overflow due to the exponentiation. Similarly, when the VJ is large (in absolute value) and negative, the exponential terms vanish. Taking the logarithm of a very small number can result in underflow.

A simple transformation can avoid both of these problems. Consider the case where v= (A, B). Note: We can write exp (a) +exp (b) =[exp (a−c) +exp (b−c)]exp (c) for any c. Furthermore, we have ln[(exp (a−c) +exp (B−C)) exp (c)]=ln[exp (a−c) +exp (b−c)]+c. We can choose C in a by that reduces the possibility of overflow. Underflow is also possible when taking the logarithm of a number close to zero, since ln (x) →−∞as x→0. Thus, we also need to account for large negative elements of V.

Log sum of exponential

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.