[R] splint
spencerg
spencer.graves at prodsyse.com
Sat Jul 11 05:28:00 CEST 2009
Hello:
For any package on CRAN, you can download the "*.tar.gz" source
file. When this is unzipped, the result will typically include a
subdirectory "src", containing the source code for routines written in
Fortran or C or C++.
You didn't say where one could find the function "splint". The
following identified a likely source:
library(RSiteSearch)
spl <- RSiteSearch.function('splint')
HTML(spl)
This identified a function "splint" in the "fields" package for
"Cubic spline interpolation". The help file includes the statement
that, "Extrapolation outside the range of the x values will be a linear
function." If I'm not mistaken, I believe this means that they use
"natural splines" rather than the more common b-splines, which do not
support extrapolation. In any event, because it uses cubic splines
(whether natural splines or B-splines or some other kind), it will have
knots. Moreover, if I'm not mistaken, for an interpolating spline, it
will have a knot at each data point.
R has other capabilities for "cubic spline interpolation", which I
found as follows:
csi <- RSiteSearch.function("cubic spline interpolation")
HTML(csi)
This identified 32 help pages in 20 different packages matching
the search term. Possibly the most important is the "splinefun"
function in the "stats" package. It includes an option to use a
"natural" spline. It also mentions the "splines" package, which
includes a function "ns" to "Generate a Basis Matrix for Natural Cubic
Splines".
Hope this helps.
Spencer Graves
jlfmssm wrote:
> I am trying to understand idea for splint, but it use Fortran code.
> Does anyone know how to see that Fortran code?
>
> Is splint a not-knot spline method?
>
> Thanks,
>
> jfm
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
>
More information about the R-help
mailing list