I need advice on fitted functions in the below image.
I fitted the below function using a multivariate adaptive regression splines from the
earth package in R.
fit <- earth(x = pred, y = resp, keepxy = T,newvar.penalty = 2, degree= 1,pmethod = "cv", nfold = 10, ncross =3, varmod.method = "rlm")
Visually seeing, the line should always go down but as you can see for the later part of the data, my function goes up even though there are not really data. I am not sure why this is happening. Any advice