How to learn a continous distribution incrementally? 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?
 A: If the bounds of the distribution are known in advance, you can use binned kernel density estimator. If standard kernel density estimator is
$$
f(x) = \frac{1}{nh} \sum_{i=1}^n K \left( \frac{x-x_i}{h} \right)
$$
then you can define binned kernel density estimator as
$$
g(x) = \frac{1}{nh} \sum_{i=1}^k n_i \, K \left( \frac{x-t_i}{h} \right)
$$
for data binned into $k$ bins with sizes $n_1,\dots,n_k$ such that $\sum_i n_i = n$, with bin centers $t_1,\dots,t_k$.
You can find more details in the following papers:

Scott, D. W., & Sheather, S. J. (1985). Kernel density estimation with
  binned data. Communications in Statistics-Theory and Methods, 14(6),
  1353-1359.
Hall, P., & Wand, M. P. (1996). On the accuracy of binned kernel
  density estimators. Journal of Multivariate Analysis, 56(2),
  165-184.

This approach needs you only to decide about $k$ and then simply count the observations that fell into each bin. The advantages of this approach are that the kernel density estimator can be re-calculated at any time and that you need to store only $k$ values ($k$ does not have to be large) plus their counts. Moreover, it gives you the histogram estimator for free as you'd already have the counts.
A: The way you describe your procedure, you're actually not learning the distribution per se. You created the uniform sample $\pi'$, then gradually replace the members of the set with new observations $\pi$. 
First, if you keep doing this as you said to infinity, then at some point all original members of $\pi'$ will be replaced with observations $\pi$. In this case why bother about initializing with $\pi$? All you need is to use the new observations $\pi$.
Second, even after you replaced the "old" observations with "new" ones, you simply use the modified datase to sample from it. You're not learning the probability distribution from it in a sense of building the distribution.
Now, the only reason to replace old with new observations gradually is if you start with a very small set of observations. So that the new data does not overwhelm the prior belief from the get go. Only in this case it would make a sense to try Bayesian kernel density estimation, see Sec 27.5 here for an example.
UPDATE. In your case a very simple solution would be the ordinary kernel density estimator(KDE) with shrinking bandwidth. The bandwidth is the most important parameter of KDE. So, you start with a very wide bandwidth, so wide, that effectively it's going to produce you the uniform distribution. For instance, if you put it equal to 10, any kernel will produce nearly uniform distribution.
Next, you shrink the bandwidth as the sample grows by some principle. It could be by $\ln n$ or something along those lines. Obviously, you only use the new observations, there's no need to initialize now, because the kernel bandwidth represents your uniform prior. Once the sample grows your distribution will start acquiring a shape that is driven by your observations.
