How to define a discrete distribution with non-integer states (sample space elements)?

I know how to define a discrete distribution with integer states:

state:       1        2       3
P[X==state]   0.3      0.4     0.3

I want to define a discrete distribution with non-integer states:

state:      0.01     0.02    0.03
P[X==state]   0.3      0.4     0.3

It is possible to use Piecewise[] and ProbabilityDistribution[] to define a distribution with integer states.

pmf[x_] := Piecewise[{
{0.3, x == 1}
, {0.4, x == 2}
, {0.3, x == 3}
}];
distribution = ProbabilityDistribution[pmf[x], {x, 1, 3, 1}]; But ProbabilityDistribution[] seems unable to work with non-integer states (it even does not work with integer states with jumps of $$dx=2$$)

Is this a bug or a feature or a convention?

Question.

How do I define the non-integer state distribution (above)?

Attempt

pmf[x_] := Piecewise[{
{0.3, x == 0.01}
, {0.4, x == 0.02}
, {0.3, x == 0.03}
}];
distribution = ProbabilityDistribution[pmf[x], {x, 0.01, 0.03, 0.01}];

Probability[X > .02, X \[Distributed] distribution]

The easiest way to do this, is with WeightedData and EmpiricalDistribution:

dist = EmpiricalDistribution[WeightedData[{0.01, 0.02, 0.03}, {0.3, 0.4, 0.3}]]
PDF[dist, x]

0.3 Boole[0.01 == x] + 0.4 Boole[0.02 == x] + 0.3 Boole[0.03 == x]

edit

Actually, you can also use:

dist = EmpiricalDistribution[{0.3, 0.4, 0.3} -> {0.01, 0.02, 0.03}]

which is a bit shorter.

• dist = EmpiricalDistribution[{0.3, 0.4, 0.3} -> {0.01, 0.02, 0.03}] is very nice. I'll use this from now on. – Conor Cosnett Jul 11 at 21:37

You can use TransformedDistribution using your first distribution:

ClearAll[tr]
Table[tr[i] = .01 i, {i, 1, 3}];
td = TransformedDistribution[tr[x], Distributed[x, distribution]];

Probability[t > .02, Distributed[t, td]]

0.3

Mean[td]

0.02

PDF[td, t] // TeXForm

$$\begin{cases} 0.3 & t=0.01\lor t=0.03 \\ 0.4 & t=0.02 \end{cases}$$