pspline_penalty()

pspline_penalty()#

liesel.contrib.splines.pspline_penalty(d, diff=2)[source]#

Builds an (n_param x n_param) P-spline penalty matrix.

Parameters:
  • d (int) – Integer, dimension of the matrix. Corresponds to the number of parameters in a P-spline.

  • diff (int, default: 2) – Order of the differences used in constructing the penalty matrix. The default of diff=2 corresponds to the common P-spline default of penalizing second differences.

Returns:

A 2d array, the penalty matrix.