Jamie Ledingham
2008-Mar-19 15:03 UTC
[R] Finding Maximums in a sliding window time series
Dear all, I am having some problems with the folowing task and would appreciate any thoughts on the matter. I have a sliding window time series of rainfall. This is 24 hour window created from an hourly record. Every hour, a new twenty four hour total is calculated. I would like to extract the Top 50 twenty four hour totals however I have a problem. Simply ranking the sliding window time series and pulling off the top 50 totals leaves me with many overlapping periods as seen below. The column on the right is rainfall amount, to the left of that are the indices showing the 24 hour period in the original hourly record and to the left of that, the date. 287608 24 / 10 / 1989 287608:287631 13.4 287609 24 / 10 / 1989 287609:287632 13.4 287610 24 / 10 / 1989 287610:287633 13.4 287611 24 / 10 / 1989 287611:287634 13.4 287612 24 / 10 / 1989 287612:287635 13.4 287613 24 / 10 / 1989 287613:287636 13.4 287614 24 / 10 / 1989 287614:287637 13.4 287615 24 / 10 / 1989 287615:287638 13.4 287616 24 / 10 / 1989 287616:287639 13.4 I somehow need to ensure the independence of my rainfall events, for example by making sure that there are at least 2 days (48 hours) between each of the top 50 storm events. Can anyone suggest an approach I could use, or have you done this kind of work before? Thanks Jamie Ledingham