Description Usage Arguments Value See Also
View source: R/Optimal_knot_research.R
This function uses AIC criterion to estimate optimal position and number of knots by fitting free-knot splines to data with one independent and one dependent variable. It is assumed that knots are estimated for least-squares splines with no penalty using genetic algorithm.
1 2 3 4 | Optimal_knot_research(
data,degree = 3,minknot = 2,maxknot = 2,
criteria = "AIC",...
)
|
data |
a data frame containing the independent variable (y) and the dependent one (x). |
degree |
an integer scalar indicating the degree of the spline it. By default, this value is fixed at 3 |
minknot |
an integer scalar indicating the minimum number of knots to consider. By default, this variable is fixed at 2 |
maxknot |
an integer scalar indicating the maximum number of knots to consider. By default, this variable is fixed at 2. |
criteria |
a character varaiable indicating the criterion to be used for determining the number and the positions of knots. Choices are "AIC" for Akaike information criterion (by default), "AICc" for corrected AIC, "BIC" for Bayesian information criterion, "adjAIC" for an adjusted version of AIC, "GCV" for generalized cross-validation and "adjGCV" for an adjusted version of GCV. |
... |
Further arguments to be passed (see freeknotfit for more details). |
A numerical vector of optimal knots whose number can varied from minknot
to maxknot
freeknotfit
for more details about the method.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.