Performs the Transformed-Stationary Extreme Values Analysis
Overview
Adaptation of the 'Matlab' 'tsEVA' toolbox developed by Lorenzo Mentaschi available here: https://github.com/menta78/tsEva. It contains an implementation of the Transformed-Stationary (TS) methodology for non-stationary extreme value Analysis (EVA) as described in Mentaschi et al. (2016) doi:10.5194/hess-20-3527-2016. In synthesis this approach consists in: (i) transforming a non-stationary time series into a stationary one to which the stationary extreme value theory can be applied; and (ii) reverse-transforming the result into a non-stationary extreme value distribution. 'RtsEva' offers several options for trend estimation (mean, extremes, seasonal) and contains multiple plotting functions displaying different aspects of the non-stationarity of extremes.
Changed
- 'tsGetPOT' now selects the optimal POT threshold using a continuous
penalty on the deviance (based on the deficit from 'minEventsPerYear') together
with a shape-parameter boundary/normalized-distance fallback score, replacing
the previous AIC + skip/penalty scheme. It now fits the GPD with 'L-BFGS-B'
constrained by 'shape_bnd' (std.err.type = "observed") and returns the full fit
object in 'pars'.
- 'tsGetPOT' uses a finer grid of candidate percentiles above the 95th
percentile and cleans NA/Inf values before peak detection.
- 'shape_bnd' is now a user-facing argument of 'tsGetPOT', 'tsEvaSampleData'
and 'TsEvaNs'. In 'TsEvaNs' it defaults automatically to c(-0.5, 1) for the
high tail and c(-1, 0) for the low tail when left as NA.
Show all changes in 1.2.0Hide the rest of the changes in 1.2.0
- 'tsEVstatistics' now reuses the GPD fit computed during POT threshold
selection (stored in 'pointData$POT$pars') instead of re-fitting the GPD.
- 'TsEvaNs' gained additional robustness in the 'trendPeaks' case when the
automatic trend threshold cannot be estimated, and guards the low-flow
transformation against a NULL 'trans'.
- 'tsEvaFindTrendThreshold' keeps the stability, negative-flow and percentile
vectors aligned and guards the breaking-point detection against short series.
- 'tsEvaNanRunningMean' was reimplemented with cumulative sums for a large
speed-up on long time series; results are unchanged. Package byte-compilation
was enabled ('ByteCompile: true').
Fixed
- 'tsEvaNanRunningVariance' returned a slightly incorrect running variance: in
the previous incremental implementation the count of valid points could drift
out of sync with the summed squared values (the removal used index
'minindx - 1' while the addition used 'maxindx + 1'). It has been reimplemented
with cumulative sums to compute the correct centered-window mean of squares.
The correction to the variance is small: on the bundled ArdecheStMartin series,
the relative change is of the order of 1-2% (median ~1.7% at a one-year window),
so fitted GEV/GPD standard-deviation-dependent parameters shift only slightly.
- 'tsEvaNanRunningStatistics' contained more serious errors: the same
valid-point count desynchronisation and, in addition, each incoming value was
centered by the running mean at an incorrect index. This produced third and
fourth running moments that were substantially wrong (median relative errors of
several hundred percent on the bundled ArdecheStMartin series). It has been
reimplemented with cumulative sums to compute the correct centered-window
moments (validated to machine precision against a direct definition). Diagnostic
quantities derived from these moments therefore change from previously incorrect
values to correct ones.
- As a consequence of the running-variance fix,
'tsEvaTransformSeriesToStatSeasonal_ciPercentile' no longer returns an all-NA
'trendSeries' on short series. Previously the incorrect running variance could
yield negative values whose square root produced NaNs that propagated through
the seasonal standard-deviation estimation; this is now resolved.
From NEWS.md in the release
Install
Health
ERRORexamplesr-oldrel-macos-arm64, r-release-macos-arm64
Running examples in ‘RtsEva-Ex.R’ failed The error most likely occurred in: > ### Name: tsEvaTransformSeriesToStatSeasonal_ciPercentile > ### Title: tsEvaTransformSeriesToStatSeasonal_ciPercentile > ### Aliases: tsEvaTransformSeriesToStatSeasonal_ciPercentile > > ### ** Examples > > timeAndSeries <- ArdecheStMartin > timeStamps <- ArdecheStMartin[,1] > series <- ArdecheStMartin[,2] > #select only the 5 latest years > yrs <- as.integer(format(timeStamps, "%Y")) > tokeep <- which(yrs>=2015) > timeStamps <- timeStamps[tokeep] > series <- series[tokeep] > timeWindow <- 365 # 1 year > percentile <- 90 > result <- tsEvaTransformSeriesToStatSeasonal_ciPercentile(timeStamps, + series, timeWindow, percentile) computing trend... trend on the 90 percentile computing trend seasonality... Warning in pracma::interp1(avgTmStamp, monthAvgVec, timeStampsN, method = "spline") : Points in argument in 'x' unsorted; will be sorted. Warning in pracma::interp1(avgTmStamp, monthAvgVex, timeStampsN, method = "spline") : Points in argument in 'x' unsorted; will be sorted. computing the slowly varying 90th percentile... computing standard deviation seasonality... Warning in pracma::interp1(avgTmStamp, monthAvgVec, timeStampsN, method = "spline") : Points in argument in 'x' unsorted; will be sorted. Warning in pracma::interp1(avgTmStamp, monthAvgVex, timeStampsN, method = "spline") : Points in argument in 'x' unsorted; will be sorted. > plot(result$trendSeries) Warning in min(x) : no non-missing arguments to min; returning Inf Warning in max(x) : no non-missing arguments to max; returning -Inf Error in plot.window(...) : need finite 'ylim' values Calls: plot -> plot.default -> localWindow -> plot.window Execution halted
- ERROR11 OK, 2 ERRORNow
- ERROR11 OK, 3 ERROR2026-03-10
Documentation
- Help pages
- 59
- Examples that run
- 98%50 run in a plain check · 1 only when donttest examples are enabled (R CMD check --as-cran)
- Exported functions with examples
- 98%
- Documented parameters
- 100%
- Return-value docs
- 100%
- Help pages citing references
- 5%
- general-demo HTML
Downloads
Repository
- PRs merged (all time)
- not measured
- Median days to close, 50 most recently updated closed issues
- 6
- Median days to close, 50 most recently updated closed PRs
- not measured
Stars over time
Releases over time
Issues over time
Commits over time
9 development-tooling and community-health practices detected across 5 families in the upstream repository
Checks run against github.com/alowis/rtseva on 2026-10-18.
The R CMD check workflow runs on Linux, macOS and Windows, and on R-devel
GitHub Pages site
Show all practicesHide 1 practice
Dependencies
Code & Tests
Datasets
People & History
Pick two releases to compare their code metrics.
- 1.2.0Latest
- RR 4.6.0 released · 2026-04-24
- 1.1.0
- RR 4.5.0 released · 2025-04-11
- 1.0.02024-06-24
- RR 4.4.0 released · 2024-04-24
Package metadata
- First published
- 2024-06-24
- Total releases
- 3 / 2 yrs
- License
- GPL (>= 3) OSI
- Minimum R
- ≥ 2.10
- Bundled data
- 2.8 MB / 4 files
- Download size
- 3.1 MB
Cite
Cite this package
Run in R for the authors' preferred citation:
citation("RtsEva")This package has no citation file, so citation() returns this entry built from DESCRIPTION.
Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-22, which the citation names so these numbers can be found later. More on citing and the projects behind them.