# [✓] Find first local minima?

GROUPS:
 Dear All,I have a list as following (for example) data = {10,8,7,6,5,3,4,5,2,3,2,1,0} The first local minima is 3. How can I find this value in Mathematica ?Thank so much for your help.
3 months ago
8 Replies
 Marco Thiel 1 Vote Would this work? -FindPeaks[-data, 0, 0, -Infinity][[1, 2]] Cheers,Marco
3 months ago
 Dear Marco,That's great.How can I find the position of this value at the list?Regards,
3 months ago
 Try: Position[data, 3] (* {{6}, {10}} *) Regards, Mariusz
3 months ago
 Hi,don’t use the “2•. You will also need to multiply the x-value by -1. Cheers,Marco
3 months ago
 Dear Marco, MariuszThanks again.I used your solution for my real data. Unfortunately the result shows { }. Please see the attached file.Regards, Attachments:
 Marco Thiel 3 Votes I agree that the Position function is a viable option, but keep in mind that FindPeaks gives the x-position of the maxima by default. so something like: sol = {1, -1}*FindPeaks[-m, 0, 0, -Infinity][[1]] would give you x and y position of the first minimum. If you use sol = {1, -1}*# & /@ FindPeaks[-m, 0, 0, -Infinity] you get the same for all minima. Using Mariusz' notation: ListPlot[CorrelationFunction[data, {100}], TicksStyle -> {{FontSize -> 16, Orange}, {FontSize -> 22, Green}}, PlotRange -> All, AxesLabel -> {Style[x, Large], Style[y, Large]}, Epilog -> {PointSize[0.01], Red, Point /@ sol}] gives:Cheers,Marco
 Hans Dolhaine 1 Vote What about an "old fashioned" way without sophisticated "modern" functions? data = {10, 8, 7, 6, 5, 3, 4, 5, 2, 3, 2, 1, 0}; min = data[[1]]; Catch[ Do[ If[data[[i]] < min, min = data[[i]], Throw[{i - 1, min}]], {i, 2, Length[data]}]] {6, 3}