Normalized total variation of n-th finite
differences is calculated for each column in
y
then averaged. These averaged values are smoothed (if requested)
and sampled to find knot positions which equalize the jumps of n-th
derivative. If any of found knots fall inside a same x interval, TV is
smoothed till no such situation occurs.
iknots(x, y, nki = 1L, n = 3L, lenfit = 12L, smooth = FALSE)
Numeric vector, estimated knot positions
Numeric vector
Numeric vector or matrix
Integer scalar, number of internal knots to estimate (1 by default)
Integer scalar, polynomial order of B-spline (3 by default)
Integer scalar, length of knots for linear spline to fit the total variation if greater than 0, otherwise full linear interpolation is used (12 by default)
Logical scalar, should total variation be smoothed? (FALSE by default)