View source: R/interpolators.R
| cardinal_cubic_b_spline | R Documentation |
Constructs a cardinal cubic B-spline interpolator given data points.
cardinal_cubic_b_spline(
y,
t0,
h,
left_endpoint_derivative = NULL,
right_endpoint_derivative = NULL
)
y |
Numeric vector of data points to interpolate. |
t0 |
Numeric scalar representing the starting point of the data. |
h |
Numeric scalar representing the spacing between data points. |
left_endpoint_derivative |
Optional numeric scalar for the derivative at the left endpoint. |
right_endpoint_derivative |
Optional numeric scalar for the derivative at the right endpoint. |
An object of class cardinal_cubic_b_spline with methods:
interpolate(x): Evaluate the spline at point x.
prime(x): Evaluate the first derivative of the spline at point x.
double_prime(x): Evaluate the second derivative of the spline at point x.
y <- c(1, 2, 0, 2, 1)
t0 <- 0
h <- 1
spline_obj <- cardinal_cubic_b_spline(y, t0, h)
x <- 0.5
spline_obj$interpolate(x)
spline_obj$prime(x)
spline_obj$double_prime(x)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.