Why Use a B-Spline Basis?
A flexible longitudinal trajectory can be represented as a linear combination of basis functions. The choice of basis affects how easily the trajectory can be calculated and how changes to its coefficients influence different times. In a truncated power basis, changing a coefficient can alter the fitted curve over a wide portion of follow-up. A B-spline basis has a useful contrasting property: each basis function is nonzero only over a bounded interval determined by nearby knots.
This matters in a joint model because the longitudinal trajectory may enter other model components, such as an event submodel. A local change to the trajectory basis can therefore be interpreted precisely: it changes the fitted longitudinal value only where that basis function is nonzero. The calculations here concern the basis and its trajectory representation; they do not by themselves specify an event-association structure.
The degree is one less than the order: degree 0 gives piecewise-constant functions, degree 1 gives piecewise-linear functions, and degree 2 gives piecewise-quadratic functions. With \(m+1\) knots and degree \(p\), the basis functions indexed \(i=0,\ldots,m-p-1\) are defined on the interior knot range, subject to the endpoint convention below. Repeated knots are allowed, and are often used at the boundaries.
For a longitudinal trajectory, write $$ m_i(t)=\sum_{j=0}^{K-1} c_{ij}B_{j,p}(t), $$ where \(m_i(t)\) is the modeled trajectory for individual \(i\), \(c_{ij}\) is its coefficient for basis function \(j\), and \(K\) is the number of basis functions. The coefficients have the units of the trajectory, such as marker units; the basis functions are dimensionless. Whether coefficients vary by individual or are shared is determined by the larger model, not by the basis definition.
Constructing and Evaluating a Basis
The recursion builds higher-degree functions from lower-degree functions. To evaluate a basis at time \(t\), first determine which degree-zero interval contains \(t\); then apply the recursion to the nearby indices. Most terms are zero, so a calculation generally involves only a few functions. At an interior time, at most \(p+1\) degree-\(p\) basis functions are nonzero.
Consider the clamped knot sequence \(U=(0,0,0,1,2,3,3,3)\), with degree \(p=2\). There are \(8-2-1=5\) quadratic basis functions, indexed \(0,\ldots,4\). The modeled time range is \([0,3)\) under the half-open interval definition. At the right endpoint, one may define the standard endpoint extension by setting the final basis function to 1 and the others to 0 at \(t=3\). State the convention used, because the half-open recursion alone gives all functions value zero at \(t=3\).
Worked Example: Evaluating Five Quadratic Basis Functions
Use \(U=(0,0,0,1,2,3,3,3)\) to calculate all five basis values at \(t=0.5\). Since \(0\le 0.5<1\), \(B_{2,0}(0.5)=1\); the other degree-zero functions are zero.
At degree 1, the recursion gives \(B_{1,1}(0.5)=\frac{1-0.5}{1-0}B_{2,0}(0.5)=0.5\), and \(B_{2,1}(0.5)=\frac{0.5-0}{1-0}B_{2,0}(0.5)=0.5\). All other degree-one values needed for the quadratic basis are zero.
Now apply the recursion at degree 2: \(B_{0,2}(0.5)=\frac{1-0.5}{1-0}B_{1,1}(0.5)=0.5(0.5)=0.25\). For the next function, \(B_{1,2}(0.5)=\frac{0.5-0}{1-0}B_{1,1}(0.5)+\frac{2-0.5}{2-0}B_{2,1}(0.5)\) \(=0.5(0.5)+\frac{1.5}{2}(0.5)=0.25+0.375=0.625\). Also, \(B_{2,2}(0.5)=\frac{0.5-0}{2-0}B_{2,1}(0.5)=0.25(0.5)=0.125\). The last two values are zero, so the vector is \((B_{0,2},B_{1,2},B_{2,2},B_{3,2},B_{4,2})=(0.25,0.625,0.125,0,0)\). Its entries sum to 1, as expected for an interior time.
“Contained in” is important: the function is zero outside the stated interval, but repeated knots or boundary details can make it zero at some points inside it as well. The interval is determined by the knot sequence and degree, not by the fitted coefficient values. A coefficient change of \(\delta\) therefore has a time-varying impact within the support, scaled by the corresponding basis function.
Why the Support Is Local
The support property follows directly from the recursion. For degree zero, \(B_{i,0}\) can be nonzero only on \([u_i,u_{i+1})\). Suppose degree-\((p-1)\) functions have supports contained in their corresponding knot spans. In the recursion for \(B_{i,p}\), the first term can be nonzero only where \(B_{i,p-1}\) is nonzero, within \([u_i,u_{i+p}]\). The second can be nonzero only where \(B_{i+1,p-1}\) is nonzero, within \([u_{i+1},u_{i+p+1}]\). Their union is contained in \([u_i,u_{i+p+1}]\). This proves the support statement by induction.
The basis also has the partition-of-unity property: for a valid knot vector, the degree-\(p\) basis functions sum to 1 over the interior time range, excluding the right endpoint unless the endpoint extension is applied. The reason is that the degree-zero indicators sum to 1 on each half-open interval. In the recursion, the two weights attached to any lower-degree function \(B_{j,p-1}(t)\), after summing over the degree-\(p\) index, add to \(\frac{t-u_j}{u_{j+p}-u_j}+\frac{u_{j+p}-t}{u_{j+p}-u_j}=1\) when the denominator is positive. This preserves the sum as the degree increases. The zero-denominator convention handles repeated knots; endpoint values still require care.
Worked Example: Measuring the Local Effect of a Coefficient Change
Use the same quadratic basis, and consider the trajectory \(m_i(t)=\sum_{j=0}^4 c_{ij}B_{j,2}(t)\). Suppose only \(c_{i1}\) is increased by 4 marker units. The change in the trajectory is \(\Delta m_i(t)=4B_{1,2}(t)\). From the first example, at \(t=0.5\) this is \(4(0.625)=2.50\) marker units.
At \(t=1.5\), the degree-zero function active on \([1,2)\) is \(B_{3,0}=1\). The recursion gives \(B_{2,1}=0.5\) and \(B_{3,1}=0.5\). Then \(B_{1,2}(1.5)=\frac{2-1.5}{2-0}B_{2,1}(1.5)=\frac{0.5}{2}(0.5)=0.125\). Thus the coefficient change adds \(4(0.125)=0.500\) marker units at \(t=1.5\).
The support of \(B_{1,2}\) is \([u_1,u_4]=[0,2]\). Since \(2.5\) lies outside that interval, \(B_{1,2}(2.5)=0\), and the change at \(t=2.5\) is exactly 0 marker units. The same coefficient change therefore has different effects at different times and none after its support ends.
Using the Basis in a Joint-Model Trajectory
A B-spline basis is a design for representing a smooth or piecewise-polynomial time trend with a finite set of coefficients. The calculation of the basis is separate from the assumptions of the longitudinal response model and from the event-time model. For example, a longitudinal submodel may use a conditional mean of the form \(m_i(t)\) above, while an event submodel may subsequently use a feature of that trajectory. The basis alone does not determine which feature is associated with event risk.
The key practical distinction from the truncated power basis is the pattern of coefficient influence. In a truncated power representation, changing a coefficient associated with a knot can influence the trajectory over a long subsequent time range. In a B-spline representation, each coefficient multiplies a local basis function. This locality can make fitting numerically better behaved and makes it easier to adjust one region without directly changing the entire later curve. It does not mean the fitted coefficients are independent, nor that estimating them has no indirect effect on other fitted quantities.
Worked Example: A Small Basis Design Row
Suppose a quadratic trajectory uses the five coefficients \((c_{i0},c_{i1},c_{i2},c_{i3},c_{i4})=(10,12,14,16,18)\) marker units with the same knot sequence. At \(t=0.5\), the basis vector is \((0.25,0.625,0.125,0,0)\). The fitted trajectory value is
The result is 11.75 marker units. Only the first three coefficients contribute at this time. If \(c_{i4}\) changes, the value at \(t=0.5\) is unaffected because \(B_{4,2}(0.5)=0\). This is a property of the basis row, not evidence that the underlying coefficients are statistically unrelated.
Assumptions, Diagnostics, and Limitations
Basis construction requires a nondecreasing knot sequence and a specified degree. A fitted trajectory additionally requires a defined coefficient vector and an agreed time domain. The basis calculation itself makes no distributional assumption about the marker or event time. In an actual joint model, likelihood assumptions, random-effect structure, and event-submodel assumptions must be assessed separately.
Useful checks include verifying that the knot vector is ordered, the number of basis functions matches the vector length and degree, computed basis values are nonnegative up to numerical tolerance, and basis values sum to 1 at interior times. Evaluate times just to either side of each distinct knot as well as representative times within intervals. At a right boundary, explicitly verify the software's endpoint convention rather than applying the half-open definition and assuming the basis sums to 1 there.
Common failures include using inconsistent indexing in the recurrence, retaining a term whose denominator is zero, or assigning a basis function the wrong support. These can produce negative values, a sum different from 1, or a coefficient change that appears to influence times outside its support. A practical diagnostic is to perturb one coefficient by a small amount and recalculate the trajectory across a grid of times: the difference must equal \(\delta B_{j,p}(t)\) and must vanish outside that basis function's support.
Local support is not a guarantee of a well-estimated curve. If observations are sparse in a region, its fitted coefficients may be uncertain; closely spaced or poorly chosen knots can also create numerical or interpretive difficulties. Moreover, local basis functions overlap, so several coefficients can jointly affect the same time range. Knot placement, boundary behavior, continuity choices, and any penalties are separate modeling decisions. B-splines are an alternative representation to truncated power bases, not a substitute for checking model fit or for selecting a suitable trajectory complexity.
Common Mistake
For graduate-level work, keep three objects distinct: the knot sequence determines support and shape; the basis functions give the time-specific weights; and the fitted coefficients determine the trajectory expressed in those weights. Confusing these roles can lead to incorrect statements about which time periods a coefficient affects or how an estimated coefficient should be interpreted.
Check Your Understanding
Answer each question, then compare with the solutions below.
- For degree \(p=2\), what interval contains the support of \(B_{3,2}\)?
- If coefficient \(c_{i1}\) is increased by 2 marker units, what is the trajectory change at \(t=0.5\) in the worked knot example?
- Why does the half-open definition require an endpoint convention at the right boundary \(t=3\)?
- At \(t=2.5\), what is the effect of changing \(c_{i1}\) in the worked example, and why?
- Name two checks that can reveal an incorrectly calculated basis vector.
Solutions. (1) Its support is contained in \([u_3,u_6]\), by the formula \([u_j,u_{j+p+1}]\). (2) At \(t=0.5\), \(B_{1,2}=0.625\), so the change is \(2(0.625)=1.25\) marker units. (3) Every degree-zero half-open interval excludes its right endpoint; under the recursion all degree-two functions are consequently zero at \(t=3\), so a standard extension is needed if the final basis value should be 1 there. (4) The change is 0 marker units because \(2.5\) is outside \(B_{1,2}\)'s support \([0,2]\). (5) For example, check nonnegativity and that the basis values sum to 1 at an interior time; also verify the knot order, index count, and zero-denominator handling.