# Example usage of TsEvaNs function
timeAndSeries <- ArdecheStMartin
#go from six-hourly values to daily max
timeAndSeries <- max_daily_value(timeAndSeries)
#keep only the 20 last years
yrs <- as.integer(format(timeAndSeries$date, "%Y"))
tokeep <- which(yrs>=2000)
timeAndSeries <- timeAndSeries[tokeep,]
timeWindow <- 5*365 # 5 years
TSEVA_data <- TsEvaNs(timeAndSeries, timeWindow,
transfType = 'trendPeaks',tail = 'high')
nonStationaryEvaParams <- TSEVA_data[[1]]
stationaryTransformData <- TSEVA_data[[2]]
amax <- nonStationaryEvaParams[[1]]$parameters$annualMax
amaxID <- nonStationaryEvaParams[[1]]$parameters$annualMaxIndx
timeStamps <- stationaryTransformData$timeStamps
trendPeaks <- stationaryTransformData$trendSeries[amaxID]
stdPeaks <- stationaryTransformData$stdDevSeries[amaxID]
amaxCor <- (amax - trendPeaks) / stdPeaks
nYears <- length(amaxCor)
rlvlmax <- empdis(amaxCor, nYears)
rlvlmax$QNS <- amax[order(amax)]
rlvlmax$Idt <- stationaryTransformData$timeStamps[amaxID][order(amax)]
timeIndex <- 2
tstamps <- "Example Timestamps"
trans <- "ori"
# Call the function with the defined arguments
result <- tsEvaPlotAllRLevelsGEV(
nonStationaryEvaParams, stationaryTransformData,
rlvlmax, timeIndex, timeStamps, tstamps,
trans)
result
Run the code above in your browser using DataLab