Skip to main content
deleted 35 characters in body
Source Link
chl
  • 54.4k
  • 23
  • 227
  • 388

Here is my experiment:

I am using the "findPeaks"findPeaks function in the "Quantmod"quantmod package:

I want to detect "local" peaks within a tolerance 5, i.e. the first locations after the time series drops from the local peaks by 5:

aa=100:1
bb=sin(aa/3)
cc=aa*bb
plot(cc, type="l")
p=findPeaks(cc, 5)
points(p, cc[p])
p

The output is

[1] 3 22 41

It seems wrong..., as I am expecting more "local peaks" than 3...

Any thoughts?

Thanks a lot!

It only picks up 3 peaks, which is obviously wrong, am I correct?

Thanks a lot!

Here is my experiment:

I am using the "findPeaks" function in the "Quantmod" package:

I want to detect "local" peaks within a tolerance 5, i.e. the first locations after the time series drops from the local peaks by 5:

aa=100:1
bb=sin(aa/3)
cc=aa*bb
plot(cc, type="l")
p=findPeaks(cc, 5)
points(p, cc[p])
p

The output is

[1] 3 22 41

It seems wrong... as I am expecting more "local peaks" than 3...

Any thoughts?

Thanks a lot!

It only picks up 3 peaks, which is obviously wrong, am I correct?

Thanks a lot!

Here is my experiment:

I am using the findPeaks function in the quantmod package:

I want to detect "local" peaks within a tolerance 5, i.e. the first locations after the time series drops from the local peaks by 5:

aa=100:1
bb=sin(aa/3)
cc=aa*bb
plot(cc, type="l")
p=findPeaks(cc, 5)
points(p, cc[p])
p

The output is

[1] 3 22 41

It seems wrong, as I am expecting more "local peaks" than 3...

Any thoughts?

added 47 characters in body
Source Link
whuber
  • 333.7k
  • 63
  • 792
  • 1.3k

Here is my experiment:

I am using the "findPeaks" function in the "Quantmod" package:

I want to detect "local" peaks within a tolerance 5, i.e. the first locations after the time series drops from the local peaks by 5:

aa=100:1 bb=sin(aa/3) cc=aa*bb plot(cc, type="l") p=findPeaks(cc, 5) points(p, cc[p])

p

aa=100:1
bb=sin(aa/3)
cc=aa*bb
plot(cc, type="l")
p=findPeaks(cc, 5)
points(p, cc[p])
p

[1] 3 22 41The output is

[1] 3 22 41

It seems wrong... as I am expecting more "local peaks" than 3...

Any thoughts?

Thanks a lot!

It only picks up 3 peaks, which is obviously wrong, am I correct?

Thanks a lot!

Here is my experiment:

I am using the "findPeaks" function in the "Quantmod" package:

I want to detect "local" peaks within a tolerance 5, i.e. the first locations after the time series drops from the local peaks by 5:

aa=100:1 bb=sin(aa/3) cc=aa*bb plot(cc, type="l") p=findPeaks(cc, 5) points(p, cc[p])

p

[1] 3 22 41

It seems wrong... as I am expecting more "local peaks" than 3...

Any thoughts?

Thanks a lot!

It only picks up 3 peaks, which is obviously wrong, am I correct?

Thanks a lot!

Here is my experiment:

I am using the "findPeaks" function in the "Quantmod" package:

I want to detect "local" peaks within a tolerance 5, i.e. the first locations after the time series drops from the local peaks by 5:

aa=100:1
bb=sin(aa/3)
cc=aa*bb
plot(cc, type="l")
p=findPeaks(cc, 5)
points(p, cc[p])
p

The output is

[1] 3 22 41

It seems wrong... as I am expecting more "local peaks" than 3...

Any thoughts?

Thanks a lot!

It only picks up 3 peaks, which is obviously wrong, am I correct?

Thanks a lot!

edited tags
Link
whuber
  • 333.7k
  • 63
  • 792
  • 1.3k
Source Link
Luna
  • 2.4k
  • 5
  • 29
  • 40
Loading