A Theoretical Framework for Real Time Release with NIR and Chemometrics