Suppose i have a random process that generates a singe number $x \in [0, 1]$ per time step $t$. Let's call the process $\pi$. At the beginning i assume that the the outcome is uniformly distributed. Now as i receive $x_t$ i update my belief over the process. As $t$ goes to $\infty$ i'll get an accurate representation.
Currently I'm keeping a set of particles $X$, which I initialize at the beginning in the range of $[0, 1]$, from which i draw uniformly. I do this because at the beginning I'm assuming that all the numbers in this range are equally likely.
Let's say i store 10.000 of them. Now that i get a new one I'll replace the oldest one with that value (sort of like a ring buffer or a FIFO queue). After some time the 10.000 particles will represent the underlaying distribution well enough. To generate samples from $\pi$ i randomly draw from $X$ which is now like drawing from $\pi$.
To make it a bit clearer: My intension is not to learn the distribution per so, but rather to be able to sample from it using values I've already seen. So my idea was that the more samples i store the better my approximation will be.
Is there a more efficient way? Is there perhaps a neural network that learns a representation? I've read about Restricted Boltzmann Machines. Would that be something appropriate?