The tangent exponential model can be numerically unstable for values close to \(r = 0\).
This function corrects these incorrect values, which are interpolated using splines.
The function takes as input an object of class fr
and returns the same object with
different rstar
values.
spline.corr(fr, method = c("cobs", "smooth.spline"))
an object of class fr
, containing as additional arguments spline
and a modified rstar
argument.
an object of class fr
, normally the output of gpd.tem or gev.tem.
string for the method, either cobs
(constrained robust B-spline from eponym package) or smooth.spline
While penalized (robust) splines often do a good job at capturing and correcting for numerical outliers and NA
, it
may also be driven by unusual values lying on the profile log-likelihood the curve or fail to detect outliers (or falsely identifying `correct' values as outliers). The user should always validate by comparing the plots of both the uncorrected (raw) output of the object with that of spline.corr
.
If available, the function uses cobs
from the eponym package. The latter handles constraints and smoothness penalties, and is more robust than the equivalent smooth.spline
.