# Problems with modeling a cumulative dependant variable

I am building a .NET program. One of its functions is to provide a predictive model for a vehicles life-to-date maintenance costs, basically what is the cumulative cost(Y) for a vehicle at specific year(X). I decided to use a 2nd degree polynomial least squares fit and for the most part it does a good job. Sometimes though the curve will peak and start trending downward which doesn't make sense for life-date-cost since its a cumulative value...(X,Y) > (X-1,Y).

This negative trend happens when the difference in cost for say, year 2 to year 3 is less than year 1 to year 2. Some sample data that gives me a negative trend:

(1,328.76) (2,1133.12) (3,1366.07)

My solution for now is to check for a negative trend and if its found use a linear best fit instead but I feel like that's a messy fix. I've thought about implementing some sort of minimum value for the change from year to year...essentially turning the curve into a linear line at a certain X value but that seems complicated to implement. Does anyone see a better way of doing this or a better model to use? I'm not very knowledgeable with statistics so go easy on me :-p

Edit

Each vehicle has a varying amount of data depending on how long its been in service, with a soft max at 15 years. So the last data point for each vehicle is for the most recent year(2011 in this case) and we are really only interested in extrapolating 5 years beyond that point. As we use the model year to year, we will get more data for the vehicles which require the model to be altered. Thats why I choose the polynomial least squares fit because its easy to just run the new data back through that function and get a new equation.

• What software are you using to fit the predictive model? Is it .NET, or are you just implementing the model in .NET that you fit elsewhere? There are strategies pre-programmed in statistical software such as R, SAS, SPSS, etc. that would be hard to do from scratch w/o a good deal of expertise. Also, are you going to need to do extrapolation, or will all future predictions be w/i the interval spanned by your training data? NB extrapolation raises difficult issues; see here: using-a-regression-model-to-make-prediction-when-to-stop. Oct 16, 2012 at 13:51
• Hi @gung. Can you give some detail on the strategies you have in mind? That would, I think, be an answer. Oct 16, 2012 at 14:18
• I'm not using any software to find the model...I suppose I should start there. I initially used Excel's trendline function. I'm using .NET to implement whatever model I find. Your link makes a good point. I edited my question with some more details regarding extrapolation.
– Jack
Oct 16, 2012 at 14:29