I'm confused --- this looks like an ordinary linear
regression.
Thanks for clarifying the normal_rng.
Yeah, the knots are at fixed positions. I used R’s model.matrix function and splines::ns to generate a design matrices for the training and prediction datasets. I just used stan to estimate the parameters for the pre-constructed design matrix for the training data, so the stan code I used looks very similar to that for a regression.
I was playing around with the code and worked out how to create interpolations beyond the range of the training dataset,
The updated codes here if anyone’s interested,