Open moritzpschwarz opened 4 years ago
I agree, a more useful error-message is desirable. I would suggest this should be handled by regressorsMean() and regressorsVariance(), which are called by both arx() and isat() in creating the regressor matrix. One idea could be to introduce the check after the if(na.omit) part (and before the 'output' part) of the code.
Note that there is a related issue, namely whether character vectors should automatically be converted to dummies (one for each level) as in lm(). Here is an example:
y <- rnorm(20); x <- rnorm(20); z <- letters[1:20]
lm(y ~ x+z)
I think this is really neat and convenient. It would be nice if arx()/isat() could handle character vectors in the same way. Note that matrices of class 'zoo' can be a mix of both numeric and character vectors, so the fact that all data-handling in the 'gets' package relies on 'zoo' objects should not be a limitation. Again, I think the right place to introduce this type of functionality is in regressorsMean() and regressorsVariance(). As an idea, we could add (say) an argument 'factors.as.dummies' with default 'FALSE', which converts a character vector to its associated dummies if set to 'TRUE'. If 'FALSE', then a more meaningful error message could be returned if any of the variables in 'mxreg' (or 'vxreg') are non-numeric.
I think we should improve the error that occurs when a character or Date column is in the estimation data.
The current error that is printed is not directly pointing to the issue:
I think we should strive towards something like: "Please remove all non-numeric columns from your estimation data" or alternatively just ignore the columns in the estimation. What do you think?
Below a quick example to illustrate the error.