Packages

class B_Spline extends BasisFunction with Error

The B_Spline class provides B-Spline basis functions 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 differentiability. B-Spline basis functions form a popular form of basis functions used in Functional Data Analysis.

See also

http://web.mit.edu/hyperbook/Patrikalakis-Maekawa-Cho/node17.html -----------------------------------------------------------------------------

Linear Supertypes
Error, BasisFunction, AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. B_Spline
  2. Error
  3. BasisFunction
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new B_Spline(ττ: VectoD, mMax: Int = 4, clamp: Boolean = true)

    ττ

    the time-points of the original knots in the time dimension

    mMax

    the maximum order, allowing splines orders from 1 to mMax

    clamp

    flag for augmenting ττ

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. val DEBUG: Boolean
    Attributes
    protected
  5. def abf(m: Int)(t: VectoD): MatrixD

    Obtain the value of the m-th order basis functions (all) at time 't'.

    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.

    m

    the order of all the basis function

    t

    the time parameter

    Definition Classes
    BasisFunction
  6. def abf_(m: Int = mMax)(t: Double): VectorD

    Evaluate each of the τ.dim-1-many order m B-spline basis functions at t non-recursively, using an efficient dynamic programming approach.

    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.

    m

    the order of all the basis function

    t

    point to evaluate

    Definition Classes
    B_SplineBasisFunction
    See also

    Carl de Boor (1978). A Practical Guide to Splines. Springer-Verlag. ISBN 3-540-90356-9.

  7. def apply(m: Int)(j: Int)(t: Double): Double

    Obtain the value of the m-th order 'j'-th basis function at time 't'.

    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.

    m

    the order of the basis function

    j

    indicates which basis function

    t

    the time parameter

    Definition Classes
    BasisFunction
  8. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  9. def bb(m: Int)(j: Int)(t: Double): Double

    Order 'm' B-Spline basis functions (general recurrence).

    Order 'm' B-Spline basis functions (general recurrence).

    m

    the order of the spline function (degree = order - 1)

    j

    indicates which spline function

    t

    the time parameter

  10. def bf(m: Int)(j: Int)(t: Double): Double

    Evaluate the 'j+1'-th order m B-spline basis function at t non-recursively, using an efficient dynamic programming approach.

    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.

    m

    the order of the basis function

    j

    indicates which basis function

    t

    point to evaluate

    Definition Classes
    B_SplineBasisFunction
    See also

    Carl de Boor (1978). A Practical Guide to Splines. Springer-Verlag. ISBN 3-540-90356-9.

  11. def bf1(j: Int)(t: Double): Double

    Obtain the value of the 1st order 'j'-th basis function at time 't'.

    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.

    j

    indicates which basis function

    t

    the time parameter

    Definition Classes
    BasisFunction
  12. def bf2(j: Int)(t: Double): Double

    Obtain the value of the 2nd order 'j'-th basis function at time 't'.

    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.

    j

    indicates which basis function

    t

    the time parameter

    Definition Classes
    BasisFunction
  13. def bf3(j: Int)(t: Double): Double

    Obtain the value of the 3rd order 'j'-th basis function at time 't'.

    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.

    j

    indicates which basis function

    t

    the time parameter

    Definition Classes
    BasisFunction
  14. def bf4(j: Int)(t: Double): Double

    Obtain the value of the 4th order 'j'-th basis function at time 't'.

    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.

    j

    indicates which basis function

    t

    the time parameter

    Definition Classes
    BasisFunction
  15. def bfr(m: Int)(j: Int)(t: Double): Double

    Adjusted order 'm' B-Spline basis functions (general recurrence).

    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.

    m

    the order of the spline function (degree = order - 1)

    j

    indicates which spline function

    t

    the time parameter

  16. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
  17. def count(m: Int): Int

    The number of basis functions for a specified order.

    The number of basis functions for a specified order.

    m

    the order of the basis function

    Definition Classes
    BasisFunction
  18. def dot_(m: Int)(i: Int, j: Int)(g: BasisFunction, a: Double = 0.0, b: Double = 1.0): Double

    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'.

    m

    the order of the basis function

    i

    indicates which basis function of 'this'

    j

    indicates which basis function of 'g'

    g

    the other function

    a

    the start of the interval

    b

    the end of the interval

    Definition Classes
    BasisFunction
  19. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  20. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  21. final def flaw(method: String, message: String): Unit
    Definition Classes
    Error
  22. def getCache(m: Int, t: VectoD): Array[MatrixD]

    Retrieves the cached design matrices

    Retrieves the cached design matrices

    Definition Classes
    BasisFunction
  23. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  24. def getOrder: Int

    Retrieve the order of the this B_Spline.

    Retrieve the order of the this B_Spline.

    Definition Classes
    B_SplineBasisFunction
  25. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  26. val head: Double
    Attributes
    protected
  27. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  28. val l: Int
    Attributes
    protected
  29. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  30. val needCompute: Boolean
    Attributes
    protected
    Definition Classes
    BasisFunction
  31. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  32. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  33. def range(m: Int = mMax): Inclusive

    Range of "usable" splines when using the bs function.

    Range of "usable" splines when using the bs function. This is needed, since extra splines may be generated by the general B-spline recurrence.

    m

    the order of the spline

    Definition Classes
    B_SplineBasisFunction
  34. def recomputeCache: Unit

    Recompute cached matrices

    Recompute cached matrices

    Definition Classes
    BasisFunction
  35. def size(m: Int = mMax): Int

    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.

    m

    the order of the spline

    Definition Classes
    B_SplineBasisFunction
  36. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  37. val tail: Double
    Attributes
    protected
  38. def toString(): String
    Definition Classes
    AnyRef → Any
  39. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  40. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  41. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  42. val Φ: MatrixD
    Attributes
    protected
    Definition Classes
    BasisFunction
  43. val Φt: MatrixD
    Attributes
    protected
    Definition Classes
    BasisFunction
  44. val ΦtΦ: MatrixD
    Attributes
    protected
    Definition Classes
    BasisFunction
  45. val τ: VectoD
    Attributes
    protected

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

Inherited from Error

Inherited from BasisFunction

Inherited from AnyRef

Inherited from Any

Ungrouped