# What is the “right” way of approximating random variables with other random variables?

It is well-known that one can construct a Hilbert space of zero mean, finite variance random variables such that every random variable of this type $$X$$ can be represented as a linear combination of a sequence of random variables $$F_i$$ with respect to probability:

$$X = \sum_{i=1}^\infty \frac{\text{cov}(X,F_i)}{\text{var}(F_i)}F_i$$

Naively, one might expect that this allows us to approximate a random variable with some distribution $$f$$ by another random variable with distribution $$g$$ when they both occupy the same domain. In that sense, one could ask questions like what is the uniform-distributed random variable that best approximates a standard normally-distributed random variable? (and many other questions like it) by using the formula above for suitable $$X$$ and $$F_i$$.

However, the covariance of any random variable $$X$$ with another random variable $$F_i$$ that is not a function of itself ($$F_i \neq f(X))$$ will be zero, meaning the technique above can't be employed, and implying that one can only perform such approximations using functions of the random variable being approximated (which seems very limiting).

Is there any straightforward way to apply the approximation technique above to answer questions like the italicized question above, or what corrections need to be done in order to make a generalized Fourier series-type approximation as shown above work for random variables?