**Example 1**. *Polynomial Spline*. For the polynomial
spline of order on
, the model space is

(6) |

Let
. Define an inner product on as

Then we have

where and 's are Bernoulli polynomials (Craven and Wahba, 1979).

Let
. Define inner product on as

Then (Wahba, 1990)

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) |

The corresponding

**Example 3**. *Periodic Spline*. For the -th order periodic
spline on
(Wahba, 1990),

The function

ssr(y~1, rk=periodic(t))

**Example 4**. *Thin plate spline* (TPS) (Wahba, 1990).
For a TPS of order on with ,

(11) |

where

A pseudo reproducing kernel (conditional positive definite rather than positive definite) for is , where is the Euclidean distance, and

The function

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

where is the surface Laplacian on the unit sphere

The model space , where and

is a RKHS with RK , where

is the rk of , is the angle between and , and 's are the Legendre polynomials. . is in the form of an infinite series which is inconvenient to compute. Closed form expressions are only available for and . Wahba (1981) proposed replacing by a topologically equivalent norm under which closed form of rk's can be derived. See Wahba (1981), Wahba (1982), Wahba (1990) and Wahba and Luo (1996) for more details. The function

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 , ,

The statement for fitting such a model is

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

The statement for fitting such a model is

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

The statement for fitting such a model is

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

The statement is

ssr(y~t+cos(t)+sin(t), rk=lspline(t,type="linSinCos"))