checkAndCorrectData checks that the data is set correctly and
throws an error if there is something wrong with the data.
checkAndCorrectData(data, p)a numeric vector or class 'ts' object containing the data. NA values are not supported.
a positive integer specifying the autoregressive order of the model.
Returns the data as a class 'ts' object.