Dear useRs,
I have a univariate spline application where I have a fixed set of independent
variable values. I would like to be able to generate an interpolating spline,
given a set of dependent variables, which can easily return the value of the
interpolant over its entire range, for use in an intensive variational problem.
I am familiar with stats:spline, stats:splinefun and splines::interpSpline.
The reason I cannot simply use those functions is that there are caveats on the
interpolant. I would like the degree of the interpolant to vary from cubic
over part of the range, while still keeping the maximum orders of derivative
continuities possible at the changepoints. In other words, over some parts of
the domain the interpolant will be piecewise cubic, while over other parts it
might be piecewise linear and/or quadratic.
I can kludge some splines::bs() calls and their subsequent predict() calls
together, by going under their hoods and manipulating their parts and
attributes, then using these as the right hand side of an lm() call. There
are a couple of issues with this. First, while I may get this kludge to work
at first, under the hood these objects are no longer correctly specified for
being proper "bs" objects. The next application of these functions might fail
badly. Second, I do not have a handle on the scope of the variational problem,
and thus do not know of a permanent fine grid to use. Therefore this method
requires reevaluating the bs() and predict() call for different grids, and thus
performing the subsequent kludges numerous times.
So may I be privy to efficient ways, if any, to customize an interpolating
spline in this way in R? My ideal solution would easily produce a function
analogous to the output of stats::splinefun, but which account for the varied
orders. Websearching was not helpful.
Thanks,
John
John Szumiloski, Ph.D.
Associate Principle Scientist, Biostatistics
Biometrics Research
WP53B-120
Merck Research Laboratories
P.O. Box 0004
West Point, PA 19486-0004
(215) 652-7346 (PH)
(215) 993-1835 (FAX)
Notice: This e-mail message, together with any attachme...{{dropped:14}}
______________________________________________
[email protected] 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.