tsEvaSampleData {RtsEva}R Documentation

tsEvaSampleData Function

Description

tsEvaSampleData is a function that calculates various statistics and data for time series evaluation.

Usage

tsEvaSampleData(
  ms,
  meanEventsPerYear,
  minEventsPerYear,
  minPeakDistanceInDays,
  tail = NA
)

Arguments

ms

A matrix containing the time series data.

meanEventsPerYear

The mean number of events per year.

minEventsPerYear

The minimum number of events per year.

minPeakDistanceInDays

The minimum peak distance in days.

tail

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

Value

A list containing the following elements:

completeSeries

The complete time series data.

POT

The data for Peaks Over Threshold (POT) analysis.

years

The years in the time series data.

Percentiles

The desired percentiles and their corresponding values.

annualMax

The annual maximum values.

annualMaxDate

The dates corresponding to the annual maximum values.

annualMaxIndx

The indices of the annual maximum values.

monthlyMax

The monthly maximum values.

monthlyMaxDate

The dates corresponding to the monthly maximum values.

monthlyMaxIndx

The indices of the monthly maximum values.

See Also

tsGetPOT()

Examples

# Generate sample data
data <- ArdecheStMartin
colnames(data) <- c("Date", "Value")
#select only the 5 latest years
yrs <- as.integer(format(data$Date, "%Y"))
tokeep <- which(yrs>=2015)
data <- data[tokeep,]
timeWindow <- 365 # 1 year
# Calculate statistics and data
result <- tsEvaSampleData(data, meanEventsPerYear=3, minEventsPerYear=0,
minPeakDistanceInDays=7, "high")
# View the result
print(result)

[Package RtsEva version 1.0.0 Index]