Generates reproducible random truth functions by sampling from P-spline priors. Uses the same penalty structure as mgcv, so wiggliness maps to effective degrees of freedom. Truth is in the B-spline span, avoiding approximation bias.
make_random_truth_generator(
yind,
xind,
z_ref = NULL,
wiggliness = 1,
k_truth = list()
)List with generator functions for each term type.
Response grid points.
Functional covariate grid points.
Reference z values for smooth terms.
Controls smoothness (default: 1). Higher = more wiggly. Typical range: 0.001 (very smooth) to 10 (very wiggly).
List with basis dimensions per term type. Defaults: ff_s = 8, ff_t = 8, smooth_z = 8, smooth_t = 8, linear = 8, intercept = 8, concurrent = 8.