Calibration optimization and efficiency in near infrared spectroscopy