# Modeling remaining duration for prediction

Suppose we're in the business of repairing broken specialty widgets and reselling them. At each point in time, we want to predict how much cash we'll make in the next 30 days on the existing inventory. All widgets are different although some may have similar characteristics.

The data we have: a list of all widgets repaired in the past 5 years, along with widget characteristics (numeric and categorical variables), dates of start and finish, original value, and resale value. We also have a list of all widgets that are currently being repaired, which contains the same info excluding finish date and resale value.

We have reason to believe that widget characteristics can help predict time to repair and resale value ratio.

My current idea is this: consider two models, one to predict the time until finish, and one to predict a "resale ratio", i.e. $\frac{\text{resale value}}{\text{original value}}$.

I'd like to focus on the first model.

One possibility is to take the finished repairs, and fit time to repair ~ characteristics via a gamma GLM. This is straightforward and can be cross validated. However, how would we handle cases when the predicted repair time is less than elapsed time?

Another possibility is to utilize techniques in survival analysis, but I'm not familiar with it and am not able to find existing case studies.

I'm sure similar problems have been solved in many fields, so I'd like feedback on best practices and whether I'm on the right track.

• Define elapsed time. – AdamO Sep 16 '14 at 16:21
• @AdamO Date of valuation (when we're doing the prediction) minus date of repair start date. In other words, we predict that the repair should have finished already. I guess we could make an assumption that it'll finish repair tomorrow. I'm not sure we'd have a meaningful regression if we use elapsed time as a covariate though... – kevinykuo Sep 16 '14 at 16:40

I assume this prediction model has the sole purpose of allowing you to determine whether a purchase will be lucrative, e.g. $TV>0$. As a caveat, there is a strong risk management aspect to this: you can wait for low-balling sales that require minimal work for maximum TV. You can specify $TV > c$, $c>0$ for a decision rule, but this will cost you when many nearly new (e.g. high RV, low TT low RC) have many units with TV - RC - PV < c, TT very low. Incorporating these into a single metric would be useful.