tsGetPOT {RtsEva}R Documentation

tsGetPOT Function

Description

tsGetPOT is a function that calculates the Peaks Over Threshold (POT) for a given time series data.

Usage

tsGetPOT(
  ms,
  pcts,
  desiredEventsPerYear,
  minEventsPerYear,
  minPeakDistanceInDays,
  tail
)

Arguments

ms

A matrix containing the time series data with two columns: the first column represents the time and the second column represents the values.

pcts

A numeric vector specifying the percentiles to be used as thresholds for identifying peaks.

desiredEventsPerYear

The desired number of events per year.

minEventsPerYear

The minimum number of events per year.

minPeakDistanceInDays

The minimum distance between two peaks in days.

tail

The tail to be studied for POT selection, either 'high' or 'low'.

Value

A list containing the following fields:

threshold

The threshold value used for identifying peaks

thresholdError

The error associated with the threshold value

percentile

The percentile value used as the threshold.

peaks

The values of the identified peaks.

stpeaks

The start indices of the identified peaks.

endpeaks

The end indices of the identified peaks.

ipeaks

The indices of the identified peaks.

time

The time values corresponding to the identified peaks.

pars

The parameters of the Generalized Pareto Distribution (GPD) fitted to the peaks.

See Also

tsEvaSampleData()

Examples

# Create a sample time series data
ms <- ArdecheStMartin

# Calculate the POT using the tsGetPOT function
pcts <- c(90, 95, 99)
desiredEventsPerYear <- 5
minEventsPerYear <- 2
minPeakDistanceInDays <- 10
tail <- "high"
POTdata <- tsGetPOT(ms, pcts, desiredEventsPerYear, minEventsPerYear, minPeakDistanceInDays, tail)
# Print the results
print(POTdata)


[Package RtsEva version 1.0.0 Index]