| 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:
thresholdThe threshold value used for identifying peaks
thresholdErrorThe error associated with the threshold value
percentileThe percentile value used as the threshold.
peaksThe values of the identified peaks.
stpeaksThe start indices of the identified peaks.
endpeaksThe end indices of the identified peaks.
ipeaksThe indices of the identified peaks.
timeThe time values corresponding to the identified peaks.
parsThe parameters of the Generalized Pareto Distribution (GPD) fitted to the peaks.
See Also
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)