Math Is Fun Forum
  Discussion about math, puzzles, games and fun.   Useful symbols: ÷ × ½ √ ∞ ≠ ≤ ≥ ≈ ⇒ ± ∈ Δ θ ∴ ∑ ∫ • π ƒ -¹ ² ³ °

You are not logged in.

#1 2012-09-20 23:54:51

tina123
Member
Registered: 2012-04-29
Posts: 83

detect peaks and valleys

I have histogram shown in this figure :  http://i1069.photobucket.com/albums/u472/tina12354/h1_zps40094c32.png

The problem is i need to detect peaks and valleys .
i tested 1st derivative . and where if difference tend to 0. there is a valley .
but for example if upper slope have value 26 , 26 . then it will also tend to 0. which will hard to tell that its valley or peak.

Any idea to  get peak and valleys .
thanks

Offline

#2 2012-09-21 00:11:25

bobbym
Administrator
From: Bumpkinland
Registered: 2009-04-12
Posts: 90,489

Re: detect peaks and valleys

Hi tina123;

That histogram is for discrete values. Using derivatives is for continuous data. You generally can not find peaks and valleys of discrete dat using derivatives.


In mathematics, you don't understand things. You just get used to them.

I agree with you regarding the satisfaction and importance of actually computing some numbers. I can't tell you how often I see time and money wasted because someone didn't bother to run the numbers.

Offline

#3 2012-09-21 00:14:37

tina123
Member
Registered: 2012-04-29
Posts: 83

Re: detect peaks and valleys

Then Is there any way to find peaks and valley s?
Please guide me in this regard .

Offline

#4 2012-09-21 00:18:44

bobbym
Administrator
From: Bumpkinland
Registered: 2009-04-12
Posts: 90,489

Re: detect peaks and valleys

You could search through the discrete data for maximum values and minimum values.

Below is a histogram for this data

You can get the peak by just counting how many of each type of numbers there are. There are 4 ones, this is the most.

View Image: 2012-09-21_025657.gif

In mathematics, you don't understand things. You just get used to them.

I agree with you regarding the satisfaction and importance of actually computing some numbers. I can't tell you how often I see time and money wasted because someone didn't bother to run the numbers.

Offline

#5 2012-09-22 01:06:59

tina123
Member
Registered: 2012-04-29
Posts: 83

Re: detect peaks and valleys

so you meant the minimum value would be our valley . is it ?
In your data set ..  1 is the most minimum value .
so it  would be a valley .  Is it ?

Offline

#6 2012-09-22 01:08:19

bobbym
Administrator
From: Bumpkinland
Registered: 2009-04-12
Posts: 90,489

Re: detect peaks and valleys

A histogram charts occurences. One has 4 occurences as you see in the histogram. It is a peak not a valley.


In mathematics, you don't understand things. You just get used to them.

I agree with you regarding the satisfaction and importance of actually computing some numbers. I can't tell you how often I see time and money wasted because someone didn't bother to run the numbers.

Offline

#7 2012-09-22 01:09:46

tina123
Member
Registered: 2012-04-29
Posts: 83

Re: detect peaks and valleys

bobbym wrote:

A histogram charts occurences. One has 4 occurences as you see in the histogram. It is a peak not a valley.

ok and now about the valley ?

Offline

#8 2012-09-22 01:13:50

bobbym
Administrator
From: Bumpkinland
Registered: 2009-04-12
Posts: 90,489

Re: detect peaks and valleys

Hi;

Look at the histogram. 2 is a valley because there is only one of them. 3 is a valley because there is only one of them. 7 i s a valley. Can you find more.

This is only way one of looking at this data if I understand you correctly.


In mathematics, you don't understand things. You just get used to them.

I agree with you regarding the satisfaction and importance of actually computing some numbers. I can't tell you how often I see time and money wasted because someone didn't bother to run the numbers.

Offline

#9 2012-09-22 01:14:15

tina123
Member
Registered: 2012-04-29
Posts: 83

Re: detect peaks and valleys

So i think  check occurrence  of each data ..  valley will be there where occurrence would be minimum,
and maximum occurrence would be peak .
but for  example if 1 is repeated 4 time 10 is repeated 3  . then we would have two  peaks at 1 having 4 occurence and 10 having 3 occurrence . and say 5 have occurrence 2 .. so minimum occurence would be our valley .
right  ?

Offline

#10 2012-09-22 01:18:04

anonimnystefy
Real Member
From: The Foundation
Registered: 2011-05-23
Posts: 15,657

Re: detect peaks and valleys

Hi tina123

What exactly would you consider peaks and valleys in the picture in your first post?


“Here lies the reader who will never open this book. He is forever dead.

“Taking a new step, uttering a new word, is what people fear most.” ― Fyodor Dostoyevsky, Crime and Punishment

Offline

#11 2012-09-22 01:21:36

bobbym
Administrator
From: Bumpkinland
Registered: 2009-04-12
Posts: 90,489

Re: detect peaks and valleys

Hi tina123;

Yes, minimum occurence would be a valley. There could be more than one.


In mathematics, you don't understand things. You just get used to them.

I agree with you regarding the satisfaction and importance of actually computing some numbers. I can't tell you how often I see time and money wasted because someone didn't bother to run the numbers.

Offline

#12 2012-09-22 01:30:22

tina123
Member
Registered: 2012-04-29
Posts: 83

Re: detect peaks and valleys

anonimnystefy wrote:

Hi tina123

What exactly would you consider peaks and valleys in the picture in your first post?

Well if we consider only useful data . then its from i = 0 ; i < 46 ; i++ , get minimum value. it would be 2 . which will be our valley .  but for and 21 will be our maxmum peak .

that 's by considering minimum and maximum histogram value .

But i still not understand correctly

Offline

#13 2012-09-22 01:31:18

bobbym
Administrator
From: Bumpkinland
Registered: 2009-04-12
Posts: 90,489

Re: detect peaks and valleys

Hi;

Want to see another example?


In mathematics, you don't understand things. You just get used to them.

I agree with you regarding the satisfaction and importance of actually computing some numbers. I can't tell you how often I see time and money wasted because someone didn't bother to run the numbers.

Offline

#14 2012-09-22 01:34:39

tina123
Member
Registered: 2012-04-29
Posts: 83

Re: detect peaks and valleys

bobbym wrote:

Hi tina123;

Yes, minimum occurence would be a valley. There could be more than one.

Hy Bobvym , I am confused . Could u tell me peaks and valleys in the same theory that u recently explained .
thanks .

Offline

#15 2012-09-22 01:36:33

tina123
Member
Registered: 2012-04-29
Posts: 83

Re: detect peaks and valleys

bobbym wrote:

Hi;

Want to see another example?

Well  i understand with an example that recently u mentioned .
but i did not  get valley and peak in my #1 post .
Could you please make my mind clear from histogram of post #1 .
thanks

Offline

#16 2012-09-22 01:42:23

bobbym
Administrator
From: Bumpkinland
Registered: 2009-04-12
Posts: 90,489

Re: detect peaks and valleys

Here is a histogram like yours, it contains values from 0 to 46.

Can you find the valley?

Could you please make my mind clear from histogram of post #1 .
thanks

That I cannot do. That drawing is not labelled so how can tell what the peaks are? I can pick them out but I do not know what numbers they are. Also I do not have the data and I can not get from that picture.

View Image: 2012-09-22_050641.gif

In mathematics, you don't understand things. You just get used to them.

I agree with you regarding the satisfaction and importance of actually computing some numbers. I can't tell you how often I see time and money wasted because someone didn't bother to run the numbers.

Offline

#17 2012-09-22 01:58:27

tina123
Member
Registered: 2012-04-29
Posts: 83

Re: detect peaks and valleys

well in my #1 post ,
on axis .. we have index 0 to 53
and on y  axis ,. we have , 0 to 21 .

like on axis 0 will  have bar 19 length .. like that

Offline

#18 2012-09-22 02:00:37

bobbym
Administrator
From: Bumpkinland
Registered: 2009-04-12
Posts: 90,489

Re: detect peaks and valleys

You say that on the x axis we go from 0 to 53. Does that mean the whole black area or just the red?


In mathematics, you don't understand things. You just get used to them.

I agree with you regarding the satisfaction and importance of actually computing some numbers. I can't tell you how often I see time and money wasted because someone didn't bother to run the numbers.

Offline

#19 2012-09-22 02:03:11

tina123
Member
Registered: 2012-04-29
Posts: 83

Re: detect peaks and valleys

bobbym wrote:

You say that on the x axis we go from 0 to 53. Does that mean the whole black area or just the red?

Well  all bins are in red color .

Offline

#20 2012-09-22 02:12:16

bobbym
Administrator
From: Bumpkinland
Registered: 2009-04-12
Posts: 90,489

Re: detect peaks and valleys

I can not see bins it it too small.

View Image: h1_zps40094c32.png

In mathematics, you don't understand things. You just get used to them.

I agree with you regarding the satisfaction and importance of actually computing some numbers. I can't tell you how often I see time and money wasted because someone didn't bother to run the numbers.

Offline

#21 2012-09-22 02:17:47

tina123
Member
Registered: 2012-04-29
Posts: 83

Re: detect peaks and valleys

bobbym wrote:

I can not see bins it it too small.

Well actually i maked histogram in range 0 to 180 . and to make histogram i consider bins 180 . so bins size is so small .
and after removing some noise and part of histogram .
i got the histogram that i posted in #p1 ..
so now our left bins are in range 0 to 53 .

Offline

#22 2012-09-22 02:18:52

bobbym
Administrator
From: Bumpkinland
Registered: 2009-04-12
Posts: 90,489

Re: detect peaks and valleys

I have marked off two peaks, I can not see what number they are.


In mathematics, you don't understand things. You just get used to them.

I agree with you regarding the satisfaction and importance of actually computing some numbers. I can't tell you how often I see time and money wasted because someone didn't bother to run the numbers.

Offline

#23 2012-09-22 02:23:36

tina123
Member
Registered: 2012-04-29
Posts: 83

Re: detect peaks and valleys

bobbym wrote:

I have marked off two peaks, I can not see what number they are.

oh i gave histogram values too with its horizontal axis .

2nd peak value is 21 . and 1st peak value is 20 .

Offline

#24 2012-09-22 02:33:17

bobbym
Administrator
From: Bumpkinland
Registered: 2009-04-12
Posts: 90,489

Re: detect peaks and valleys

Do you see what a peak is?


In mathematics, you don't understand things. You just get used to them.

I agree with you regarding the satisfaction and importance of actually computing some numbers. I can't tell you how often I see time and money wasted because someone didn't bother to run the numbers.

Offline

#25 2012-09-22 02:37:55

tina123
Member
Registered: 2012-04-29
Posts: 83

Re: detect peaks and valleys

bobbym wrote:

Do you see what a peak is?

as i understand peak is maximum value ..  and 20 , 21 are the maximum . .

so those are peaks

Offline

Board footer

Powered by FluxBB