For example, if P
=c(0,1,2), the function return the penalty matrix
the second order difference of a vector \(tt\). That is $$v^T P_j tt=
\sum_{i=3} ^{n} (\Delta tt_i) ^2$$ where $$\Delta tt_i= tt_i -2 tt_{i-1}
+ tt_{i-2}$$ is the second order difference. More details can be found in
Kraemer, Boulesteix, and Tutz (2008).