# How to fit a distribution over an observed distribution?

I do not know what method is appropriate to fit (say, a Log-Normal distribution) over an observed distribution. I say observed to make it sound generic because I am not sure if this qualifies as an Empirical distribution.

Anyways, after my simulation the data looks as follows:

Note that the density is very choppy but the CDF is much more smoother. I would very much appreciate some advise how to approach this problem. I am looking for a method name, or some sort of sudo code. (I have to use Java to code it but that is not too important)

• The advice here briefly describes methods of parameter estimation. Most popular would generally be maximum likelihood. Sep 10, 2016 at 15:45
• @Glen_b Hi Glen, note that I do not have any random values from the simulation. All I have is the probability density as seen above. I thought one needs random variates to use the maximum likelihood method. Sep 10, 2016 at 15:59
• Sorry to have misunderstood. So how what do you actually have -- a series of $(x,f(x))$ pairs? Or something else? How was the density obtained? Sep 10, 2016 at 16:09
• @Glen_b Yes that is correct. All I have is $(t, f(t))$. This is the density of a Wiener process functional. The original paper is titled ON DISTRIBUTIONS OF CERTAIN WIENER FUNCTIONALS - by M. KAC. I am doing a numerical simulation though - therefore, I do not get a nice closed form. Sep 10, 2016 at 16:32
• The simulations themselves are giving you the $(t,f(t))$ pairs? Sep 10, 2016 at 23:57

You have $(x_i, y_i)$ pairs, and want to fit a function $y=f(x, \mu, \sigma)$, $f$ depends on some parameters (like $\mu$ and $\sigma$ for Log-normal).
The game is to find the best set of $\mu$ and $\sigma$. To do so you have to find the $\mu$ and $\sigma$ that minimize $\sum_i(y_i-f(x_i, \mu, \sigma))^2$.
The hard part is to find a algorithm that will find the best set of $\mu$ and $\sigma$. You could try Gauss–Newton algorithm. It is available in many libraries, including The Cognitive Foundry in java.