[R] stats:: spline's method could not be monoH.FC

Abby Spurdle @purd|e@@ @end|ng |rom gm@||@com
Sun May 3 06:15:17 CEST 2020


> and just today a colleague asked me about spline interpolation
> with general 2nd derivative boundary conditions
>    s''(x_1) = s2_1,  s''(x_n) = s2_2

It should possible via cubic Hermite splines.
A nontrivial design decision in my package was the computation of
slopes at the endpoints.
(Something which I got wrong, twice...)

My guess is that I could write a function in about 60 to 90 minutes,
including all the testing and calculus.

However, I need to note two things:
(1) Cubic Hermite splines do not have a continuous second derivative.
(2) Specifying the second derivatives (at the endpoints) would prevent
the user from specifying the first derivatives (aka the slopes).

Could you please confirm if the function would still be of interest...?

And completely diverging...
> it returns a *function* containing its own state

I use function objects extensively.
However, I haven't been able to find a definitive guide to terminology.
The word "closure" appears to have a lisp origin, but it usage in R is
a bit grey.

Many of my functions have attributes.
However, I recognize that the use the function environments is more
popular, and has the advantage that the user can take advantage of
lexical scoping, but has the disadvantage that copying function
objects can have unexpected results.

Recently, I've been using the terms "Self-Referencing Function
Objects" and "Functions Bundled with Data", but was wondering if these
terms are sub-optimal...?



More information about the R-help mailing list