If I have a set of values and I identify the probabiltiy density function, how do I get the smallest distance from a set of distances that correspond to those values?

the_values = [200,215,250,350,400,450,550,650,750];
dist_1 = [10,20,30,40,50,60,70,80,90,100];
M = mean(the_values);
S = std(the_values);
PDF = normpdf(the_values, M, S);
plot(the_values, PDF);
I would like to effectively find the optimal minimum distance that is at the optimal maximum likelihood of the the_values (eg most probable, smallest distance). I was looking at the solver function fminsearch but I have no idea how I would generate a function to describe this situation as required by the fminsearch function parameter. So distance should cut the distribution plot in the best area.

4 Comments

I can't quite make out what you want... In the above example, what is your desired solution? Is it just the member of the_value which is closest to the mean M? If so, you could do,
[~, ind] = min(abs(the_values - M));
opt = the_value(ind);
What is the purpose of dist_1, since it is never used?
I m looking for the smallest distance from dist_1 that corresponds to the largest density of the_values. eg largest PDF value for smallest dist_1 value. So its getting the optimal value between the two.
What trade-off are you willing to make between distance and probability? Given two candidates, if a distance is 10% larger but the probability is twice as high, should that be chosen? Given two candidates, if the distance was 5% larger and the probability was 1/2 % larger, should that be chosen?
We know that you are willing to make some trade-off because you are not just asking for the point with the largest probability density.
Or is the idea that your distribution has multiple areas of equal probability density, and that out of all of the sample points that have equally the highest probability density, you want the closest of those? If so then how much tolerance should be made for round-off error, since a minor difference in probability calculation could be caused by round-off error rather than actual difference in probability?
So say the larger the distance you have the less likely. So the smallest distance should be the most probable in an ideal situation. eg the biggest expected peak of the distribution should be closer to the smallest distance. I don't mind how much trade off is needed.

Sign in to comment.

Answers (0)

Asked:

on 4 Dec 2015

Commented:

on 6 Dec 2015

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!