Description Usage Arguments Value Examples
The aim of this function is to find the best combination of parameters 'prop.knots' and 'alpha' for Partial Splines function through a k-fold Cross Validation.
1 2 3 4 5 6 7 8 9 10 |
y |
response variable, must be a vector |
x |
explanatory variables, must be a dataframe |
tx |
spline variable, must be a vector |
k.fold |
number of folds |
alpha.v |
vector of alpha values to compare |
knots.v |
vector of prop.knots values to compare |
plot.it |
if TRUE, it plots a point for each combination of the parameters; the size of the point is related to the MSE on the test-set. The smaller point is circled in red |
... |
further arguments passed to 'PartialSplines' |
returns a list containing the optimal values for alpha and prop.knots and a dataframe with the mse for each combination of the parameters
1 2 3 4 5 6 7 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.