Defining a constant in Mathematica

  • Context: Mathematica 
  • Thread starter Thread starter ToxicBug
  • Start date Start date
  • Tags Tags
    Constant Mathematica
Click For Summary
SUMMARY

The discussion focuses on defining constants in Mathematica to compute the expected value of a Gumbel distribution. The user successfully integrates the function when specific values for parameters 'a' and 'b' are provided, such as a = 2 and b = 5. However, when using general values, the output becomes overly complex. A suggested solution involves using the Assumptions option to specify that 'a' is a real number, which simplifies the integration process.

PREREQUISITES
  • Familiarity with Mathematica syntax and functions
  • Understanding of Gumbel distribution properties
  • Knowledge of integration techniques in symbolic computation
  • Experience with using Assumptions in Mathematica
NEXT STEPS
  • Explore the use of Assumptions in Mathematica for simplifying expressions
  • Learn about the properties and applications of the Gumbel distribution
  • Investigate advanced integration techniques in Mathematica
  • Review the SetAttributes function and its impact on variable definitions
USEFUL FOR

Mathematica users, statisticians, and data scientists working with probability distributions and seeking to simplify complex integrations.

ToxicBug
Messages
84
Reaction score
0
Hello, I've been breaking my head over this for a couple hours now.

I'm trying to find the expected value of a Gumbel distribution.
Code:
Integrate[ y*E^(-((y - a)/b))*E^(-E^(-((y - a)/b)))/b, {y, -Infinity, Infinity},
  Assumptions -> b > 0]

If I set a = 2 and b = 5, it works. Otherwise it gives me a very complicated expression. I've tried SetAttributes[a, Constant], but it doesn't do the trick. Anyone know how can I solve this?
 
Physics news on Phys.org
Try giving it some information about a, like
Code:
Assumptions -> b > 0 && Element[a, Reals]
 

Similar threads

  • · Replies 12 ·
Replies
12
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 3 ·
Replies
3
Views
6K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 5 ·
Replies
5
Views
5K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K