# Uniform Distribution with support?

**URL:** <https://community.wolfram.com/t/uniform-distribution-with-support/5980>\
**Category:** Questions\
**Tags:** economics, mathematica, calculus, statistics-and-probability\
**Created:** [June 18, 2015, 10:36am UTC](https://community.wolfram.com/t/uniform-distribution-with-support/5980 "2015-06-18T10:36:03Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![claudedax](https://avatars.discourse-cdn.com/v4/letter/c/a87d85/32.png) [@claudedax](https://community.wolfram.com/u/claudedax)\
**Post date:** [June 18, 2015, 10:36am UTC](https://community.wolfram.com/t/uniform-distribution-with-support/5980/1 "2015-06-18T10:36:03Z")

</div>

Hey, i got a small issue and im pretty sure that the community will easely solve this.  
The Problem:

1. we have Epsilon which is uniformely distributed with support {epsilon\_L , epsilon\_H} and epsilon\_L = - epsilon\_H and mean(epsilon) = 0 with g(epsilon) the density function.

2 My Code:

```
\[Epsilon] = 
 UniformDistribution[{Subscript[\[Epsilon], L], Subscript[\[Epsilon], 
   H]}]
g[\[Epsilon]] = PDF[\[Epsilon], x]

```

The Problem is that Mathematica has an issue to execute this and i think its the subscripts that create this issue. I am new to Mathematica and i would be happy if someone can help me.  
What are my mistakes and could somebody explain me in other words what the message Hold{} means? i read the documentation about that but i am not sure if i got it completely.  
Thx in advance

---

<div class="post-metadata">

**Author:** ![jbaldwin](https://avatars.discourse-cdn.com/v4/letter/j/91b2a8/32.png) [@jbaldwin](https://community.wolfram.com/u/jbaldwin)\
**Post date:** [June 19, 2015, 3:30am UTC](https://community.wolfram.com/t/uniform-distribution-with-support/5980/2 "2015-06-19T03:30:45Z")

</div>

My recommendation is to avoid subscripts (now and maybe forever). If I understand what you want, the code can be written as:

```
\[Epsilon]L = -5;
\[Epsilon]H = -\[Epsilon]L;
\[Epsilon] = UniformDistribution[{\[Epsilon]L, \[Epsilon]H}]
g[x_] := PDF[\[Epsilon], x]

```

and

```
 g[z]
 g[3.5]
 g[50]

```

results in

 ![uniformdistribution.png](https://global.discourse-cdn.com/wolfram/original/3X/5/0/5005becb457198d4f2d5e3c1db24499bc4b6101c.png)

---

<div class="post-metadata">

**Author:** ![claudedax](https://avatars.discourse-cdn.com/v4/letter/c/a87d85/32.png) [@claudedax](https://community.wolfram.com/u/claudedax)\
**Post date:** [June 19, 2015, 8:23am UTC](https://community.wolfram.com/t/uniform-distribution-with-support/5980/3 "2015-06-19T08:23:36Z")

</div>

hey Jim Baldwin,

ok ty for your reply. I got some further questions to your answer.

Considering the subscript, what about time indices. Lets say we have x\_t and x\_t+1 . Are subscripts not fine for time indices?  
How would you handle a model with more periods when you cant use subscripts?

The other question is related to the “:=” (delayed) . How can i use this kind of a function in SOLVE ? Because to do Solve for equations and/or in-equations you need to have equations of the form of “==” “\>”“\<” etc but not “:=” .  
How can i Use this density function g[epsilon\_] with Solve?

---

<div class="post-metadata">

**Author:** ![jbaldwin](https://avatars.discourse-cdn.com/v4/letter/j/91b2a8/32.png) [@jbaldwin](https://community.wolfram.com/u/jbaldwin)\
**Post date:** [June 19, 2015, 1:22pm UTC](https://community.wolfram.com/t/uniform-distribution-with-support/5980/4 "2015-06-19T13:22:29Z")

</div>

Using lists handles multiple observations. Look in the online documentation about lists, set (“=”), set delayed (“:=”), and Solve. If you have a specific example about the use of Solve (including in code you’ve attempted), then I think the Community could give you a lot of assistance. Looking at “Core Language & Structure” in the Documentation Center is also highly recommended.
