Skip to main content

Module monomial

Module monomial 

Source
Expand description

Monomial basis: B_j(t) = t^j for j = 0, 1, …, nbasis-1.

§Evaluation matrix

The evaluation matrix is column-major of shape (n × nbasis):

eval_matrix[i + j * n] = argvals[i].powi(j as i32)

§Roughness penalty

The default roughness order is lfd_order = 2 (curvature). The penalty matrix is computed analytically using the exact Gram integral of the lfd_order-th derivative of each basis function.

For integer exponents e_i, e_j and domain [a, b]:

c_i = e_i * (e_i-1) * … * (e_i-d+1)   (falling factorial)
c_j = e_j * (e_j-1) * … * (e_j-d+1)

R[i,j] = 0                                  if c_i ≈ 0 or c_j ≈ 0
        = c_i * c_j * ln(b/a)               if |e_i + e_j - 2d + 1| < 1e-15
        = c_i * c_j * (b^p - a^p) / p       otherwise, p = e_i + e_j - 2d + 1

Reference: standard polynomial calculus, same semantics as R’s fda package create.monomial.basis.

Functions§

monomial_basis
Construct a monomial (polynomial power) basis over argvals with nbasis functions.