0
$\begingroup$

There is a random variable that can take 3 values with the following probabilities:

Pr(x=0) = 0.4
Pr(x=0.5) = 0.2
Pr(x=1)=0.4

How should i write the pmf of this random variable? I can think of writing this as: $0.4^{1(x=0))}*0.2^{1(x=0.5))}*0.4^{1(x=1))}$

But this is rather cumbersome and difficult to deal with. Is there a simpler way?

$\endgroup$
4
  • $\begingroup$ Please tell us the purpose of "writing it down." Because you have been able to communicate the entire distribution to us in a clear and simple fashion, the purpose would seem not to be for communication but rather for calculation: but what kinds of calculation? $\endgroup$
    – whuber
    Nov 28 '14 at 14:33
  • $\begingroup$ Yes.Sorry for the delayed reply. The calculation involved is that this serves as the prior distribution of x for a problem of bayesian estimation, where x is the parameter that needs to be estimated. I wanted to write it down to multiply it with f(y|x) to calculate the posterior. $\endgroup$ Nov 29 '14 at 1:44
  • $\begingroup$ When you listed the three probabilities at the outset, you had already "written it down" it quite an adequate way, so apparently the issue concerns how to express this distribution in a particular computing language. What language is it? $\endgroup$
    – whuber
    Nov 29 '14 at 14:53
  • 1
    $\begingroup$ I was trying to write it down as a function instead of three probabilities. However, i figured that writing it as 3 different probabilities work as well. $\endgroup$ Nov 29 '14 at 17:35
2
$\begingroup$

In other words, you are seeking a Functional (algebraic) Form ... rather than List Form ... for your pmf. How about:

$$f(x) \, = \, P(X = x) \,= \, \frac15 \,+ \,\frac25\, \left| \,\frac12 - x \, \right| \,; \quad \quad x \in \{0,\frac12,1\}$$

or equivalently:

$$P(X = x) \, = \, \frac{2}{5} \left(2 x^2-2 x+1\right) \,; \quad \quad \quad x \in \{0,\frac12,1\}$$

Your pmf is also a special case of a BetaBinomial distribution. In particular: your model is obtained when:

$$X = \frac{Y}{2}, \quad \text{where } Y \sim BetaBinomial(n,a,b) \quad \text{ with } n=2, a=\frac13, b=\frac13$$

which would allow you to apply known textbook results for the BetaBinomial automatically to your application.

For all cases:

f /. x -> {0, 1/2, 1} 

{$\frac25$, $\frac15$, $\frac25$}

$\endgroup$
13
  • 1
    $\begingroup$ Because your expression for $f$ is not explicitly restricted to $x\in\{0,1,2\}$, it is incorrect (and likely misleading and not very useful in any event). $\endgroup$
    – whuber
    Nov 28 '14 at 14:32
  • $\begingroup$ ?? The OP's given domain of support is $x \in$ {0,$\frac12$,1} ... not {0,1,2}. There is no reason to limit the domain of support to the set of integers. In fact, it is quite useful to define {x,0, n, $\frac12$}, denoting a step-size of $\frac12$. I do agree that there is not much advantage of using function form over list form here ... but that is what the OP appears to want. $\endgroup$
    – wolfies
    Nov 28 '14 at 14:49
  • $\begingroup$ The phrase "can take three values" and the fact that $0.4+0.2+0.4=1$ show the domain is indeed $\{0,1,2\}$ and not any larger. If it were, then your definition of $f$ manifestly is not a pmf because it would sum to a value greater than unity. When somebody asks something you think is not useful or unreasonable, a constructive way to respond is with a comment that requests clarification--there's no need to rush in with an answer when there is doubt about the question. $\endgroup$
    – whuber
    Nov 28 '14 at 14:55
  • $\begingroup$ I am not aware of any doubt about the question. The OP specifically defines the 3 points in the domain of support as $X = 0$, $X = \frac12$, and $X =1$ $\endgroup$
    – wolfies
    Nov 28 '14 at 15:03
  • 1
    $\begingroup$ @whuber asks: "what have you accomplished by providing a formula instead of explicitly giving the three probs"? ........... That's a comment that would be best to appropriately address to the OP (and you have done so, without receiving a reply yet). His/her reason for seeking a functional form is not given. You might equally ask why some authors express a Bernoulli pmf with the functional notation $$P(X=x) = p^x (1 - p)^{(1 - x)}; \quad x \in \{0,1\}$$ while others prefer the List Form version $$P(X = 0) = 1-p, \quad P(X=1) = p$$ $\endgroup$
    – wolfies
    Nov 29 '14 at 1:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.