Python Forum
need help coming up with a code
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
need help coming up with a code
#1
I am trying to reproduce this method from a paper and then use it for further investigation, however I am struggling to write the code especially from the second line, any help will be appreciable,

This is the method.


For this study, block periods of 5, 7 and 10 years with a sliding
window of 1 year were selected. For a baseline period of 1980–
2010 and given a 5-year block length, the following subseries are
considered: 1980–1984, 1985–1989, 1990–1994, .... With a sliding
window of one year, the following subseries are produced: 1981–
1985, 1986–1990, 1991–1995....

2. Sort the time series values in descending order for each block
period.

3. Calculate empirical return periods according to the ranks of the
values (n/i, where n and i are the length of block period and
rank, respectively; i = 1 for the highest value).

4. Perform steps 2 and 3 for the baseline period.
5. Calculate relative change as the ratio of the extreme value in the
block period to the extreme value in the baseline period with
the same return period.

6. Calculate perturbation factor for each block period as the aver-age of all relative changes; Then, obtain anomaly values for the
return periods above an extreme threshold (a threshold above
which the values are considered as ‘‘extreme’’).

Thanks in advance
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  How to know coming snmp trap version in python pysnmp? ilknurg 0 2,608 Jan-31-2022, 12:16 PM
Last Post: ilknurg
  const or #define coming from C jamie_01 11 3,359 Sep-16-2021, 05:39 PM
Last Post: jefsummers
  String coming up weird EddiesTech 1 1,516 Mar-15-2020, 05:02 PM
Last Post: buran
  Timer keeps coming up with a non-callable int object birdwatcher 1 3,158 Feb-16-2020, 12:40 PM
Last Post: DeaD_EyE
  Error Message Coming Up When Running Code eddywinch82 0 1,881 Feb-10-2020, 11:48 PM
Last Post: eddywinch82
  Learning python My lists are not coming out right TheMusicMan 3 2,599 Aug-17-2018, 02:45 PM
Last Post: snippsat

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020