This repository contains the code for generating data, running the experiments, and creating the figures accompanying the paper Greedy Knot Selection Algorithm for Restricted Cubic Spline Regression.
example-curves.Rmd
generates figures illustrating ground truth, a_1,
and a_2 curves for a sample.
knot-removal-figure.Rmd
generates figures showing the effect of removing
inner knots, comparison to standard approach, and how BIC scores are affected
by an increasing number of knots.
updated-experiments.Rmd
contains the source code for the experiments.
Data can be generated from the R-code but are also available as files in this repository. There are two ready-made datasets. The first dataset is experiment-results-2023-03-20-15-29-33
, stored in both Rds and CSV formats. This dataset contains the results for each sample. The second dataset is experiment-results-sample-stats-2023-03-20-15-29-33
, also stored in both Rds and CSV formats. This dataset contains various statistics for the results per "ground truth"-function.
Note that the code for the package described in the paper is in a separate publicly available repository, knutar. This package must be built and imported/added to the knutar-experiments
project for the experiments to run.