Optimize inventory management by analyzing historical data