Example 1. Polynomial Spline. For the polynomial
spline of order on
, the model space is
(6) |
Let
. Define an inner product on as
Let
. Define inner product on as
Table lists statements inside ssr for four simple polynomial splines. We assume variables , and have been calculated based on Bernoulli polynomials. All expressions of the reproducing kernels in this table are available in our library. Note that the domain under construction () is restricted to while the domain under construction () is an arbitrary interval . Thus one needs to transform a variable into before using rk functions in the third column. The rk functions in the fourth column assume the domain for any fixed . One can calculate the reproducing kernel on by a translation, for example .
Example 2. Stein Estimate. A James-Stein shrinkage estimate can be regarded as the solution to () with , and (Gu, 2002).
For shrinkage toward a constant,
(9) |
For shrinkage toward zero,
(10) |
Example 3. Periodic Spline. For the -th order periodic spline on (Wahba, 1990),
ssr(y~1, rk=periodic(t))
Example 4. Thin plate spline (TPS) (Wahba, 1990).
For a TPS of order on with ,
(11) |
ssr(y~t1+t2, rk=tp.pseudo(list(t1,t2)))
The true kernel discussed in Gu and Wahba (1993a) is calculated by the function tp. It takes longer to compute the true kernel and is only necessary for calculating posterior variances.
Example 5. Spline on the sphere is an extension of both
the periodic spline defined on the unit circle and the TPS on .
Let the domain be
, where is the unit sphere.
Any point on can be represented
as
, where (
)
is the longitude and (
) is
the latitude. Define
ssr(y~t1+t2, rk=sphere(cbind(t1,t2),order=3))where and are longitude and latitude respectively.
Example 6. -spline. The penalty term, , is usually used to penalize the roughness of the function . However, sometimes it is advantageous to use other forms of penalty. For example, prior information may be incorporated or even estimated by a penalty to the departure of the non-parametric function from a specific parametric model (Wahba, 1990; Heckman and Ramsay, 2000). Let be a linear differential operator , where denotes the th derivative operator and the 's are continuous real-valued weight functions. The spline estimate with the penalty is called an -spline. See Heckman and Ramsay (2000) and Gu (2002) for more details about the -spline. The lspline function in our library calculates reproducing kernels for the following four -spline models.
(a) Suppose that . If prior knowledge suggests that is close to a linear combination of and , one may use , and . Then
The statement for fitting such a model is
ssr(y~sin(2*pi*t)+cos(2*pi*t)-1, rk=lspline(t,type="sine0"))
If we want to include the constant in the model space, then , ,
ssr(y~sin(2*pi*t)+cos(2*pi*t), rk=lspline(t,type="sine1"))
(b) Suppose that
. If prior knowledge suggests that
is close to a linear combination of and , one
may use
, and . Then
ssr(y~exp(-t), rk=lspline(t,type="exp"))
(c) Suppose that . If prior knowledge suggests that is close to the logistic function , one may use , and . Then
ssr(y~I(exp(t)/(1+exp(t)))-1, rk=lspline(t,type="logit"))
(d) Suppose that . If prior knowledge suggests that is close to a linear combination of , , and , one may use , and . Then
ssr(y~t+cos(t)+sin(t), rk=lspline(t,type="linSinCos"))