AnnualEventStats

This function analyzes a slot’s value over some number of years, noting the occurrence of certain "events".

Description

Collects and returns statistics on annual events occurring on a slot.

Type

LIST

Arguments

Type

Meaning

1

SLOT

a slot

2

DATETIME

analysis period start date

3

DATETIME

analysis period end date

4

DATETIME

event period start date

5

DATETIME

event period end date

6

NUMERIC

value threshold

7

BOOLEAN

value threshold is upper bound

8

NUMERIC

event threshold

9

BOOLEAN

event threshold is upper bound

Evaluation

The analysis period start and end dates define the period during which the analysis will be performed. Within the analysis period, only the timesteps which occur on or between the day and month of the event period start and end dates are considered. Each of these periods within the analysis period is called an event period. At each event period, an event can either occur or not.

An event is defined by the value threshold and comparison type and the subevent count threshold and comparison type. At each timestep within an event analysis period, the slot’s value is compared to the threshold value. If the value threshold is an upper bound and the slot’s value is greater than the value threshold, then a subevent is said to have occurred at that timestep; similarly, if the value comparison is a lower bound and the slot’s value is less than the value threshold, then a subevent is said to have occurred. After the subevents within an event analysis period have been noted, then they are counted up and compared to the subevent count threshold. If the subevent count threshold is an upper bound and the number of subevents which occurred in an event analysis period is greater than the subevent count threshold, then an event is said to have occurred, and similarly, if the subevent count comparison is a lower bound and the number of subevents which occurred in an event analysis period is less than the subevent count threshold, then an event is said to have occurred.

Evaluation cont.

The return list contains the following items (listed in order):

  • The total number of event periods.
  • The number of events which occurred.
  • The number of event periods which occurred after the last event. If no events occurred, then this is the number of event periods.
Comments

As defined above, the first and last event periods might be of shorter duration than the other event periods. For example, if the analysis period is July 1, 1980 through June 30, 1989 and the event period is May 1 through September 30, then the first event period will be July 1, 1980 through September 30, 1980; subsequent event periods will be from May 1 through September 30, until the last event period, which will be from May 1, 1989, through June 30, 1989.

If the event period contains the end of February, then event periods during leap years will also have a different duration. It is an error for the start or end date of the event period to be February 29, which does not exist in each year.

Event periods can span year boundaries. For example, if the event period begin is December and the event period end is January, then each event period will be from December of one year to January of the next.

One can leave the year field of the event period start or end date unspecified, if one is using a format which contains that component, such as the month/day/year format. E.g., one could specify the event start as @"6:00 May 1". The year component of the event period start and end date is ignored whether or not it is specified.

Any missing value in the slot’s series is treated as a non-subevent.

The comparison with the value threshold is done to within 0.01% of the threshold’s value. That is, values which are within 0.01% of the threshold’s value are considered to have exceeded the threshold.

 
AnnualEventStats($ "Lottawatta Reservoir.Outflow",
@"24:00:00 February 28, 1994",
@"24:00:00 January 31, 2005",
@"24:00:00 May 31",
@"24:00:00 August 31",
100.0,
TRUE,
2.0,
TRUE )
Note: this call will determine how often outflow from Lottawatta Reservoir exceeded 100 cfs more than 2 times between May and August in an eleven year period starting in 1994.
 
{11.00, 3.00, 2.00}

There were eleven event periods, In 3 of those, the flow exceeded 100cfs more than 2 times, and there were 4 event periods (i.e the summers of 2001, 2002, 2003, and 2004) after the last event in 2001.