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.
Usage
spline.corr(fr, method = c("cobs", "smooth.spline"))
Value
an object of class fr
, containing as additional arguments spline
and a modified rstar
argument.
Details
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
.
Warning
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
.