As suggested by the title, I am trying to determine how to generate a discretised version of a continuous random variable, that is truncated to the right by some value, say $M$. I would like the resultant discretised random variable to have the same mean as the continuous version.
If I ignore truncation for the moment, I have found the following result that I am not able to verify:
If $Y$ is the discretised version of some continuous r.v. $X$, for bandwidth $h$, if we let
$f_{j} = P(Y = jh)$
Then:
$f_{0} = 1- \frac{E[X\hspace{0.1cm}\wedge\hspace{0.1cm}h]}{h}$
$f_{j} = \frac{2E[X\hspace{0.1cm}\wedge\hspace{0.1cm}jh] - E[X\hspace{0.1cm}\wedge\hspace{0.1cm}(j-1)h] - E[X\hspace{0.1cm}\wedge\hspace{0.1cm}(j+1)h]}{h}$
And $Y$ will have the same mean as $X$.
I am struggling to explain these formulae intuitively (although I can sort of see that we are finding the average of $X$ at increments along the doman, where the increments are determined by the value of $h$).
I am certainly struggling to derive a mathematical and rigorous proof.
Can anyone help on both parts?
Perhaps if I grasp this then I will be able to determine the formulae for the truncated version.
Thanks for any help.
I suppose you're looking for a completely general method. But many important continuous distributions are approximated by discrete distributions that are already programmed into major software packages. For example, $\mathsf{Norm}(\mu=200,\sigma=10) \approx \mathsf{Binom}(n=400,1/2).$ For other normal distributions, you could re-scale the binomial. Using R:
For most purposes, the discrepancy between the discrete and continuous distributions is smaller than the margin of simulation error.