DB_Spline
The DB_Spline
class provides B-Spline basis functions with derivatives for various orders 'm', where the order is one more than the degree. A spline function is a piecewise polynomial function where the pieces are stitched together at knots with the goal of maintaining continuity and differentability. B-Spline basis functions form a popular form of basis functions used in Functional Data Analysis.
Value parameters
- clamp
-
whether or not to clamp the ends of the knot vector using
B_Spline.clamp
- mMax
-
the maximum order, allowing splines orders from 1 to mMax
- ττ
-
the time-points of the original knots in the time dimension
Attributes
- See also
- Graph
-
- Supertypes
-
trait DBasisFunctionclass B_Splinetrait BasisFunctionclass Objecttrait Matchableclass AnyShow all
Members list
Value members
Concrete methods
First derivatives of order 'm' B-Spline basis functions (general recurrence).
First derivatives of order 'm' B-Spline basis functions (general recurrence).
Value parameters
- j
-
indicates which spline function
- m
-
the order of the spline function (degree = order - 1)
- t
-
the time parameter
Attributes
First derivatives of order 'm' B-Spline basis functions (dynamic programming apporach)
First derivatives of order 'm' B-Spline basis functions (dynamic programming apporach)
Value parameters
- j
-
indicates which spline function
- m
-
the order of the spline function (degree = order - 1)
- t
-
the time parameter
Attributes
- Definition Classes
Adjusted derivatives of order 'm' B-Spline basis functions (general recurrence). These are adjusted so that the first "usable" spline is at j = 0
. The valid range of usable splines is defined in range
.
Adjusted derivatives of order 'm' B-Spline basis functions (general recurrence). These are adjusted so that the first "usable" spline is at j = 0
. The valid range of usable splines is defined in range
.
Value parameters
- j
-
indicates which spline function
- m
-
the order of the spline function (degree = order - 1)
- t
-
the time parameter
Attributes
Second derivatives of order 'm' B-Spline basis functions (general recurrence).
Second derivatives of order 'm' B-Spline basis functions (general recurrence).
Value parameters
- j
-
indicates which spline function
- m
-
the order of the spline function (degree = order - 1)
- t
-
the time parameter
Attributes
Obtain the value of 2nd derivative of the m-th order 'j'-th basis function at time 't'. Or alternatively, obtain the 2nd derivative basis function by calling d2bf(m)(j) only. Ex: val x = d2bf(m)(j)(t) retrieves the 2nd derivative value of the j-th basis function at 't'. val f = d2bf(m)(j) retrieves the 2nd derivative of the j-th basis function.
Obtain the value of 2nd derivative of the m-th order 'j'-th basis function at time 't'. Or alternatively, obtain the 2nd derivative basis function by calling d2bf(m)(j) only. Ex: val x = d2bf(m)(j)(t) retrieves the 2nd derivative value of the j-th basis function at 't'. val f = d2bf(m)(j) retrieves the 2nd derivative of the j-th basis function.
Value parameters
- j
-
indicates which basis function
- m
-
the order of the basis function
- t
-
the time parameter
Attributes
- Definition Classes
Adjusted second derivatives of order 'm' B-Spline basis functions (general recurrence). These are adjusted so that the first "usable" spline is at j = 0
. The valid range of usable splines is defined in range
.
Adjusted second derivatives of order 'm' B-Spline basis functions (general recurrence). These are adjusted so that the first "usable" spline is at j = 0
. The valid range of usable splines is defined in range
.
Value parameters
- j
-
indicates which spline function
- m
-
the order of the spline function (degree = order - 1)
- t
-
the time parameter
Attributes
Obtain the value of nth derivative of the m-th order basis functions (all) at time 't'. Or alternatively, obtain the basis function by calling dnabf(m)(j) only. Ex: val x = dnabf(m)(t) retrieves the nth derivative value of the value of all the basis functions at 't'. val f = dnabf(m) retrieves the nth derivative value of all the basis functions.
Obtain the value of nth derivative of the m-th order basis functions (all) at time 't'. Or alternatively, obtain the basis function by calling dnabf(m)(j) only. Ex: val x = dnabf(m)(t) retrieves the nth derivative value of the value of all the basis functions at 't'. val f = dnabf(m) retrieves the nth derivative value of all the basis functions.
Value parameters
- m
-
the order of all the basis function
- n
-
the order of the derivative
- t
-
the time parameter
Attributes
- Definition Classes
Obtain the value of nth derivative of the m-th order basis functions (all) at time 't'. Or alternatively, obtain the basis function by calling dnabf(m)(j) only. Ex: val x = dnabfr(n)(m)(t) retrieves the nth derivative value of the value of all the basis functions at 't'. val f = dnabfr(n)(m) retrieves the nth derivative value of all the basis functions. Note that this is the recursive approach as opposed to the dynamic programming approach.
Obtain the value of nth derivative of the m-th order basis functions (all) at time 't'. Or alternatively, obtain the basis function by calling dnabf(m)(j) only. Ex: val x = dnabfr(n)(m)(t) retrieves the nth derivative value of the value of all the basis functions at 't'. val f = dnabfr(n)(m) retrieves the nth derivative value of all the basis functions. Note that this is the recursive approach as opposed to the dynamic programming approach.
Value parameters
- m
-
the order of all the basis function
- n
-
the order of the derivative
- t
-
the time parameter
Attributes
Obtain the value of nth derivative of the m-th order basis functions (all) at time 't'. Or alternatively, obtain the basis function by calling dnabf(m)(j) only. Ex: val x = dnabfr(m)(t) retrieves the nth derivative value of the value of all the basis functions at 't'. val f = dnabfr(m) retrieves the nth derivative value of all the basis functions. Note that this is the recursive approach as opposed to the dynamic programming approach.
Obtain the value of nth derivative of the m-th order basis functions (all) at time 't'. Or alternatively, obtain the basis function by calling dnabf(m)(j) only. Ex: val x = dnabfr(m)(t) retrieves the nth derivative value of the value of all the basis functions at 't'. val f = dnabfr(m) retrieves the nth derivative value of all the basis functions. Note that this is the recursive approach as opposed to the dynamic programming approach.
Value parameters
- m
-
the order of all the basis function
- n
-
the order of the derivative
- t
-
the time parameter
Attributes
N-th derivatives of order 'm' B-Spline basis functions (general recurrence).
N-th derivatives of order 'm' B-Spline basis functions (general recurrence).
Value parameters
- j
-
indicates which spline function
- m
-
the order of the spline function (degree = order - 1)
- n
-
the n-th derivative to be computed
- t
-
the time parameter
Attributes
Adjusted n-th derivative of order 'm' B-Spline basis functions (general recurrence). These are adjusted so that the first "usable" spline is at j = 0
. The valid range of usable splines is defined in range
.
Adjusted n-th derivative of order 'm' B-Spline basis functions (general recurrence). These are adjusted so that the first "usable" spline is at j = 0
. The valid range of usable splines is defined in range
.
Value parameters
- j
-
indicates which spline function
- m
-
the order of the spline function (degree = order - 1)
- n
-
the n-th derivative to be computed
- t
-
the time parameter
Attributes
Adjusted n-th derivative of order 'm' B-Spline basis functions (general recurrence). These are adjusted so that the first "usable" spline is at j = 0
. The valid range of usable splines is defined in range
.
Adjusted n-th derivative of order 'm' B-Spline basis functions (general recurrence). These are adjusted so that the first "usable" spline is at j = 0
. The valid range of usable splines is defined in range
.
Value parameters
- j
-
indicates which spline function
- m
-
the order of the spline function (degree = order - 1)
- n
-
the n-th derivative to be computed
- t
-
the time parameter
Attributes
Inherited methods
Obtain the value of the m-th order basis functions (all) at time 't'. Or alternatively, obtain the basis function by calling bf(m)(j) only. Ex: val x = bf(m)(t) retrieves the value of all the basis functions at 't'. val f = bf(m) retrieves all the basis functions.
Obtain the value of the m-th order basis functions (all) at time 't'. Or alternatively, obtain the basis function by calling bf(m)(j) only. Ex: val x = bf(m)(t) retrieves the value of all the basis functions at 't'. val f = bf(m) retrieves all the basis functions.
Value parameters
- m
-
the order of all the basis function
- t
-
the time parameter
Attributes
- Inherited from:
- BasisFunction
Evaluate each of the τ.dim-1
-many order m
B-spline basis functions at t
non-recursively, using an efficient dynamic programming approach. ==Example==
Evaluate each of the τ.dim-1
-many order m
B-spline basis functions at t
non-recursively, using an efficient dynamic programming approach. ==Example==
val m = 4 // order m (degree m-1)
val t = VectorD (1, 2, 3, 4) // original time points
val N = B_Spline (t, k) // B_Spline instance
val z = N.abf_ (m)(t) // vector of evaluations
println ("order k basis functions at t = z")
==Implementation Details== Let N(m)(i)
denote the i
-th order k
basis function evaluated at t
. Then each N(m)(i)
depends on the evaluation of N(m-1)(i)
and N(m-1)(i+1)
. Here is an example, given a set of order m=4
B-spline basis functions and knot vector τ
of length n
:
N(1)(0), N(1)(1), N(1)(2), N(1)(3), ..., N(1)(n-1)
|/ |/ |/ |/
N(2)(0), N(2)(1), N(2)(2), ..., N(2)(n-2)
|/ |/ |/
N(3)(0), N(3)(1), ..., N(3)(n-3)
|/ |/
N(4)(0), ..., N(4)(n-4)
This algorithm applies the procedure described above using O(n) storage and O(k*n) floating point operations.
Value parameters
- t
-
point to evaluate
Attributes
- See also
-
Carl de Boor (1978). A Practical Guide to Splines. Springer-Verlag. ISBN 3-540-90356-9.
- Definition Classes
- Inherited from:
- B_Spline
Obtain the value of the m-th order 'j'-th basis function at time 't'. Or alternatively, obtain the basis function by calling bf(m)(j) only. Ex: val x = bf(m)(j)(t) retrieves the value of the j-th basis function at 't'. val f = bf(m)(j) retrieves the j-th basis function.
Obtain the value of the m-th order 'j'-th basis function at time 't'. Or alternatively, obtain the basis function by calling bf(m)(j) only. Ex: val x = bf(m)(j)(t) retrieves the value of the j-th basis function at 't'. val f = bf(m)(j) retrieves the j-th basis function.
Value parameters
- j
-
indicates which basis function
- m
-
the order of the basis function
- t
-
the time parameter
Attributes
- Inherited from:
- BasisFunction
Order 'm' B-Spline basis functions (general recurrence).
Order 'm' B-Spline basis functions (general recurrence).
Value parameters
- j
-
indicates which spline function
- m
-
the order of the spline function (degree = order - 1)
- t
-
the time parameter
Attributes
- Inherited from:
- B_Spline
Evaluate the 'j+1'-th order m
B-spline basis function at t
non-recursively, using an efficient dynamic programming approach. ==Example==
Evaluate the 'j+1'-th order m
B-spline basis function at t
non-recursively, using an efficient dynamic programming approach. ==Example==
val m = 4 // order m (degree m-1)
val t = VectorD (1, 2, 3, 4) // original time points
val N = B_Spline (t, k) // B_Spline instance
val j = 0 // spline j in N.range(m)
val z = N.bf (m)(j)(t(2)) // evaluate at t(2)
println ("order k basis function j at t(2) = z")
==Implementation Details== Let N(m)(i)
denote the i
-th order k
basis function evaluated at t
. Then each N(m)(i)
depends on the evaluation of N(m-1)(i)
and N(m-1)(i+1)
. Here is an example, given a set of order m=4
B-spline basis functions and knot vector τ
of length n
:
N(1)(0), N(1)(1), N(1)(2), N(1)(3)
|/ |/ |/
N(2)(0), N(2)(1), N(2)(2)
|/ |/
N(3)(0), N(3)(1)
|/
N(4)(0)
This algorithm applies the procedure described above using O(k) storage and O(k*k) floating point operations.
Value parameters
- t
-
point to evaluate
Attributes
- See also
-
Carl de Boor (1978). A Practical Guide to Splines. Springer-Verlag. ISBN 3-540-90356-9.
- Inherited from:
- B_Spline
Obtain the value of the 1st order 'j'-th basis function at time 't'. Or alternatively, obtain the basis function by calling bf1(j) only. Ex: val x = bf1(j)(t) retrieves the value of the j-th basis function at 't'. val f = bf1(j) retrieves the j-th basis function.
Obtain the value of the 1st order 'j'-th basis function at time 't'. Or alternatively, obtain the basis function by calling bf1(j) only. Ex: val x = bf1(j)(t) retrieves the value of the j-th basis function at 't'. val f = bf1(j) retrieves the j-th basis function.
Value parameters
- j
-
indicates which basis function
- t
-
the time parameter
Attributes
- Inherited from:
- BasisFunction
Obtain the value of the 2nd order 'j'-th basis function at time 't'. Or alternatively, obtain the basis function by calling bf2(j) only. Ex: val x = bf2(j)(t) retrieves the value of the j-th basis function at 't'. val f = bf2(j) retrieves the j-th basis function.
Obtain the value of the 2nd order 'j'-th basis function at time 't'. Or alternatively, obtain the basis function by calling bf2(j) only. Ex: val x = bf2(j)(t) retrieves the value of the j-th basis function at 't'. val f = bf2(j) retrieves the j-th basis function.
Value parameters
- j
-
indicates which basis function
- t
-
the time parameter
Attributes
- Inherited from:
- BasisFunction
Obtain the value of the 3rd order 'j'-th basis function at time 't'. Or alternatively, obtain the basis function by calling bf3(j) only. Ex: val x = bf3(j)(t) retrieves the value of the j-th basis function at 't'. val f = bf3(j) retrieves the j-th basis function.
Obtain the value of the 3rd order 'j'-th basis function at time 't'. Or alternatively, obtain the basis function by calling bf3(j) only. Ex: val x = bf3(j)(t) retrieves the value of the j-th basis function at 't'. val f = bf3(j) retrieves the j-th basis function.
Value parameters
- j
-
indicates which basis function
- t
-
the time parameter
Attributes
- Inherited from:
- BasisFunction
Obtain the value of the 4th order 'j'-th basis function at time 't'. Or alternatively, obtain the basis function by calling bf4(j) only. Ex: val x = bf4(j)(t) retrieves the value of the j-th basis function at 't'. val f = bf4(j) retrieves the j-th basis function.
Obtain the value of the 4th order 'j'-th basis function at time 't'. Or alternatively, obtain the basis function by calling bf4(j) only. Ex: val x = bf4(j)(t) retrieves the value of the j-th basis function at 't'. val f = bf4(j) retrieves the j-th basis function.
Value parameters
- j
-
indicates which basis function
- t
-
the time parameter
Attributes
- Inherited from:
- BasisFunction
Adjusted order 'm' B-Spline basis functions (general recurrence). These are adjusted so that the first "usable" spline is at j = 0
. The valid range of usable splines is defined in range
.
Adjusted order 'm' B-Spline basis functions (general recurrence). These are adjusted so that the first "usable" spline is at j = 0
. The valid range of usable splines is defined in range
.
Value parameters
- j
-
indicates which spline function
- m
-
the order of the spline function (degree = order - 1)
- t
-
the time parameter
Attributes
- Inherited from:
- B_Spline
The number of basis functions for a specified order.
The number of basis functions for a specified order.
Value parameters
- m
-
the order of the basis function
Attributes
- Inherited from:
- BasisFunction
Obtain the value of nth derivative of the m-th order basis functions (all) at time 't'. Or alternatively, obtain the basis function by calling dnabf(m)(j) only. Ex: val x = dnabf(n)(m)(t) retrieves the nth derivative value of the value of all the basis functions at 't'. val f = dnabf(n)(m) retrieves the nth derivative value of all the basis functions.
Obtain the value of nth derivative of the m-th order basis functions (all) at time 't'. Or alternatively, obtain the basis function by calling dnabf(m)(j) only. Ex: val x = dnabf(n)(m)(t) retrieves the nth derivative value of the value of all the basis functions at 't'. val f = dnabf(n)(m) retrieves the nth derivative value of all the basis functions.
Value parameters
- m
-
the order of all the basis function
- n
-
the order of the derivative
- t
-
the time parameter
Attributes
- Inherited from:
- DBasisFunction
Compute the dot/inner product of nth derivative of 'this' basis function and that of basis function 'g'.
Compute the dot/inner product of nth derivative of 'this' basis function and that of basis function 'g'.
Value parameters
- a
-
the start of the interval
- b
-
the end of the interval
- g
-
the other function
- j
-
indicates which basis function
- m
-
the order of the basis function
- n
-
the order of the derivative
Attributes
- Inherited from:
- DBasisFunction
Compute the dot/inner product of 'this' basis function object and basis function 'g'.
Compute the dot/inner product of 'this' basis function object and basis function 'g'.
Value parameters
- a
-
the start of the interval
- b
-
the end of the interval
- g
-
the other function
- i
-
indicates which basis function of 'this'
- j
-
indicates which basis function of 'g'
- m
-
the order of the basis function
Attributes
- Inherited from:
- BasisFunction
Retrieves the cached design matrices and penalty matrices
Retrieves the cached design matrices and penalty matrices
Value parameters
- m
-
the order of all the basis function
- t
-
the time parameter
Attributes
- Definition Classes
- Inherited from:
- DBasisFunction
Retrieve the order of the this B_Spline.
Range of "usable" splines when using the bs
function. This is needed, since extra splines may be generated by the general B-spline recurrence.
Range of "usable" splines when using the bs
function. This is needed, since extra splines may be generated by the general B-spline recurrence.
Value parameters
- m
-
the order of the spline
Attributes
- Inherited from:
- B_Spline
Recompute cached matrices.
The number of usable spline basis functions for a specified order, given the configured knot vector.
The number of usable spline basis functions for a specified order, given the configured knot vector.
Value parameters
- m
-
the order of the spline
Attributes
- Inherited from:
- B_Spline