powered by
dfset fits a natural cubic spline for a range of degrees of freedom, and returns the df minimising the BIC or AIC.
dfset
dfset(x, y, data = parent.frame(), FUN = BIC, df = 1:15, plot = FALSE, ...)
vector of x coordinates.
vector of y coordinates.
data frame containing x and y.
x
y
function to be minimised (e.g. BIC or AIC).
vector of degrees of freedom to be searched.
logical controlling plotting of FUN versus df.
parameters to pass to plot.
plot
Optimal degrees of freedom.
# NOT RUN { data(heights) dfset(age, height, heights, FUN=BIC, plot=TRUE) dfset(age, height, heights, FUN=function(a) AIC(a, k=1)) # }
Run the code above in your browser using DataLab