Statistics for Optimal overhauls and replacements of deteriorating and stochastically failing equipment