Smoothing splines - understanding cars and speed
In order to determine the parameters required in statistics for fitting a model, multiple methods can be used. In each of the cases, fitting involves the estimating of a small number of parameters from the data. Apart from estimating parameters, two important stages are the identification of a suitable model and the verification of the model. These smoothing methods can be used in a variety of ways: to aid understanding and produce smoothed plots, to identify a suitable parametric model from the shape of the smoothed data, or to focus on the effects of interest in order to eliminate complex effects which are of no use.
How to do it...
Let's get into the details.
Step 1 - exploring the data
The first step is to load the following packages:
> install.packages("graphics")
> install.packages("splines")
> library(graphics)
> library(splines)
Creating a matrix. The cbind()
function takes the sequence of...