A Model Has a Lifecycle

An NIR supplier-change case connects prediction errors, Hotelling’s T² and Q diagnostics, instrument transfer and controlled model maintenance: validation establishes evidence for an intended use, and monitoring asks whether it still applies.
Graphic titled 'A Model Has a Lifecycle', subtitled 'Establish evidence. Monitor performance. Investigate change.' Three panels. Establish: an analyst loading a sample into a benchtop NIR instrument beside sample vials, with 'Representative samples' and 'Independent evaluation'. Use and monitor: an analyst reviewing a data table on screen beside an in-line probe on a process vessel, with 'Prediction error + model diagnostics' and 'Valid measurements and traceability'. Maintain: jars of excipient beside an instrument and a checklist on a clipboard, with 'Investigate before updating' and 'Verify the revised procedure'. A line reads 'Preserve versions, evidence and the intended purpose', and the footer reads 'A new supplier is a question to investigate, not an automatic reason to retrain.'
Establish evidence, monitor performance during use, and investigate changes before controlled maintenance. Conceptual teaching illustration; the supplier-change case and numerical examples below are invented for instruction.

The one idea

Validation establishes evidence for an intended use under defined conditions. Monitoring asks whether that evidence continues to apply.

A frozen model does not change its coefficients by itself, but the world supplying its inputs does. Raw materials, instruments, sampling, software, temperature and process conditions can all challenge performance. The model is the method, and it has a validation and a lifecycle exactly as an high-performance liquid chromatography (HPLC) method does.

International Council for Harmonisation (ICH) Q14 explicitly addresses multivariate model establishment, routine use and maintenance, including monitoring that can trigger rebuilding. A model-maintenance plan connects these activities, rather than treating calibration as a one-time event [1].

The case: an approved supplier, an unfamiliar spectrum

Our near-infrared (NIR) procedure predicts active pharmaceutical ingredient (API) concentration in a powder blend. The formulation, reference procedure and operating range are defined, and independent evaluation supported the procedure’s intended role in the control strategy.

A newly qualified excipient supplier is introduced. The material meets its incoming requirements, but the NIR spectra begin to differ from historical spectra. Model diagnostics rise. The concentration predictions stay plausible.

Several explanations are possible. The new excipient may have a different particle-size distribution, moisture level, physical form or scattering behavior. The probe might be fouled. The reference samples might not match the measured process material. A coincident instrument problem might be responsible.

Supplier qualification and model applicability answer different questions. A material can be acceptable under its purchasing specification while presenting variation the calibration never saw.

Do not assume a plausible prediction proves applicability, or that an unusual spectrum proves the material is defective.

Monitor performance and applicability separately

These kinds of evidence complement each other:

EvidenceWhat it can revealImportant limitation
Matched reference comparisonsActual prediction error and systematic bias for the checked samplesCoverage and reference uncertainty limit the conclusion
Spectral and model diagnosticsUnusual input patterns or departure from the represented variationAn unusual input does not automatically mean the prediction has failed
Instrument and acquisition checksChanges in hardware response or measurement qualityPassing checks do not establish complete model suitability
Process and material recordsContext for causes, timing and potentially affected outputA temporal association alone does not prove causation

The maintenance plan should say what is checked, how often, by whom, and what triggers investigation or action. Reference-check frequency and update triggers should reflect the model’s impact and risk. ICH’s Q8/Q9/Q10 implementation material discusses these elements [2].

Prediction error is not the same as a spectral residual

For a quantitative model, define the prediction error consistently. In this reading:

ei=y^i−yreference,ie_i=\widehat{y}_i-y_{reference,i}

A positive error means overprediction. The mean error estimates bias in the evaluated set; an error-magnitude summary such as the root mean square error of prediction (RMSEP) describes disagreement for that set. Both depend on the samples and reference results used.

In a principal component analysis (PCA)-based spectral diagnostic, the residual means something different: the part of the measured X spectrum the retained components do not reconstruct. It can be large even when a checked Y prediction stays close to its reference value.

Calling both quantities “residuals” without naming their space confuses an investigation. Say whether you mean a prediction error in concentration units or a spectral reconstruction diagnostic.

T² and Q ask different questions

For a retained PCA representation, two commonly used diagnostics are:

  • Hotelling’s T²: a distance within the retained score space, accounting for the variation along each component.
  • Q residual, or squared prediction error in X: a measure of variation outside the retained component subspace.

An extreme but familiar spectral pattern can give a high T². A new spectral feature that the retained components describe poorly can give a high Q. Both can rise together. These are the same two distances that SIMCA uses to decide class membership.

Thresholds depend on the model, the data, the statistical assumptions and the intended response. There is no universal T² or Q limit for every instrument, preprocessing method or product. A diagnostic limit is not a product specification.

In partial least squares (PLS) applications, understand exactly which diagnostics the deployed system calculates; do not assume every software package calculates or labels them the same way.

A calculated example: three different situations

Figure titled 'Model diagnostics and prediction error answer different questions', two panels each showing three groups of 30 synthetic observations with short bars at the means. Left, 'Q: unexplained variation in X', squared reconstruction residual on a log scale from 10⁻⁶ to 10⁰: the baseline group (teal) is scattered from about 10⁻⁶ to 3 × 10⁻² with a mean near 3 × 10⁻³; the input-pattern change group (orange) sits tightly near 2, about three orders of magnitude higher; the outcome-relationship change group (purple) matches the baseline. Right, 'Prediction error against reference Y', predicted minus reference: baseline and input-pattern change both cluster around 0 within about ±0.07; the outcome-relationship change group sits near −0.8. Footer: synthetic contrasts, same fixed PCA diagnostic and prediction equation in all scenarios, 30 observations per scenario, no alert limits or acceptance criteria.
Synthetic example: a one-component PCA model fitted to 200 development observations of two variables, plus a simple fixed prediction equation, ŷ = x₁. The three scenarios are constructed contrasts, not successive events in one production run, and no statistical alert limits or acceptance criteria are shown.

In the baseline scenario, new observations follow the development relationship. In the input-pattern change, the second input variable shifts while the first stays the same. Q rises (its mean goes from about 0.003 to about 2.0, in arbitrary units) because the joint input pattern has changed, but the prediction equation uses only the first variable, so the prediction error does not change.

In the outcome-relationship change, X stays like the baseline while the relationship to the reference outcome shifts. Q is unchanged, while the prediction error moves to about −0.8.

The demonstration is deliberately simple. It shows that input diagnostics and reference comparisons are not substitutes for each other. It does not claim that a particular diagnostic will always catch or always miss a real pharmaceutical change.

Download the synthetic scenario data.

Investigate the supplier-change signal

Before changing the calibration, follow a structured investigation:

  1. Establish validity. Check timestamps, sample matching, acquisition conditions, model version, preprocessing and reference results.
  2. Check the measurement system. Examine instrument checks, window cleanliness, probe contact, temperature and sample presentation.
  3. Compare the material. Review supplier information and the relevant physical or chemical characterization against the old supplier’s material.
  4. Assess current performance. Obtain suitable independent matched references across relevant conditions, including the decision-critical range.
  5. Assess impact. Determine which results and material could be affected, and apply the established operating and quality-system response.

An elevated diagnostic may need action before the root cause is resolved. Follow the predefined controls for unsupported results, rather than carrying on because the displayed concentration looks reasonable.

Agreement with the reference in a few samples is reassuring but does not establish coverage across the full new variation. Design the follow-up work around the scientific question.

The investigation, worked on synthetic data

Figure titled 'Investigate the signal before you touch the model', six panels for a synthetic NIR blend-assay model calibrated on excipient supplier E1, with supplier E2 entering on day 21 of 40. Trigger: bars of the percentage of spectra over the diagnostic limits each day; Q flags 0 to 4% of spectra on E1 days and 100% on every E2 day, while T² flags none until a few late E2 days, at most 8%. Steps 1–2, validity and the instrument: a daily wavelength check stays within ±0.1 nm of 1680.0 nm against a ±0.5 nm band on all 40 days, with a note that the model version, preprocessing and sample pairing were unchanged. Step 3, compare the material: the fitted centre of the excipient band near 2270 nm for 12 E1 lots clusters between 2270.83 and 2270.97 nm inside an E1 mean ±3 SD band, while 3 E2 lots sit at 2272.95 to 2273.01 nm. Step 4, assess current performance: predicted minus HPLC at challenge levels 90, 95, 100, 105 and 110% of label claim, three blends each per supplier, inside a pale ±1.0% band; E1 RMSEP 0.5%, E2 RMSEP 0.6%; the E2 level means run from −0.93 to +0.11%, closest to the band edge at 95%. Step 5, assess impact: routine reference-check errors by day, scattered around 0 for E1 and slightly below 0 for E2, with a note that 20 production days on E2 need assessment. A summary panel lists the evidence and the response: accuracy holds, but a diagnostic that flags every result has stopped working, so extend the calibration with E2 under change control.
Synthetic teaching data. Diagnostic limits are the 99th percentiles of an independent set of 60 E1 validation blends, not the calibration set; the ±1.0% requirement is illustrative. The figure follows the five steps above in order.

The figure works the five steps on one constructed case: an NIR blend-assay model (SNV and PLS with 4 latent variables), calibrated on 60 E1 blends at 85–115% of label claim and run for 40 production days. The only thing that differs between the suppliers is one excipient band near 2270 nm: E2’s sits 2 nm higher.

  • The trigger. Q flags every E2 spectrum from day 21. T² flags none for two weeks and at most 8% on any later day. This is a new spectral pattern, not an extreme version of a familiar one. Meanwhile the predicted assay stays near 100% of label claim, exactly the “plausible prediction” this reading warns about.
  • Steps 1–2, validity and the measurement system. The model version, preprocessing and sample pairing are unchanged, and the daily wavelength check stays within ±0.1 nm of its target on every day. The signal is not the instrument and not the data handling.
  • Step 3, the material. The band position is measured on pure excipient from each lot. Twelve E1 lots agree to within 0.15 nm; all three E2 lots sit 2.1 nm higher, far outside E1’s lot-to-lot range. E2 passed its incoming tests, but the spectrometer can tell it apart.
  • Step 4, current performance. Routine checks near 100% of label claim can’t answer whether accuracy holds across the range, so the team makes E2 blends at five levels and assays them by HPLC. Every E2 level mean is inside the illustrative ±1.0% requirement, but the margin is thin at 95% (−0.93% from three blends). A careful team would add replicates there before leaning on the result.
  • Step 5, impact. Twenty production days ran on E2. Their routine reference checks average −0.28%, so there is no sign of out-of-specification product. But every release decision in that period was made while the applicability flag was on, and each needs assessing under the site’s procedure.

How can a 2 nm shift be measured when the spectrometer reads every 10 nm? The band is about 75 nm wide, so it spans many readings. Fitting the band’s shape through all of them locates its centre to a few hundredths of a nanometre, much finer than the spacing between readings, in the same way a fitted chromatographic peak has a retention time finer than the detector’s sampling interval. The fit used here is a Gaussian band on a gently curved baseline over 2180–2380 nm. Neighbouring bands offset every lot’s absolute centre by the same amount (about 0.9 nm), so the absolute value isn’t meaningful, but the difference between lots is, and it recovers the 2 nm that was built into the simulation.

The finding matches the fourth row of the table below: acceptable new variation that the model does not cover. Accuracy holds for now. But a Q limit that flags every result no longer separates the unusual from the routine, so a real problem would hide inside the alarm that is already on. The response is a controlled calibration extension that adds E2 lots and is re-evaluated on both E1 and E2 material. Silencing Q by moving its limit would be the wrong response.

Same signal, two outcomes

Step 4 is where the investigation forks. To show both branches, the figure below runs a second, hypothetical supplier, E3, through the identical model, limits and steps. E3’s band sits 10 nm higher instead of 2 nm.

Figure titled 'Same signal, two outcomes: step 4 decides the response', three panels. Left, 'Step 3: how far each band moved': fitted band centres near 2270 nm for 12 E1 lots at about 2270.9 nm, 3 E2 lots at about 2273.0 nm labelled +2.1 nm, and 3 E3 lots at about 2280.9 nm labelled +10.0 nm. Centre, 'Step 4, E2: passes': predicted minus HPLC at challenge levels 90 to 110% of label claim, three blends per level, level means between −0.93 and +0.11%, all inside a pale ±1.0% band; over 20 days Q flags 100% of E2 spectra and T² 1%; beneath, worst level mean −0.93% at 95%, accuracy holds, the diagnostic no longer works, extend the calibration with E2 under change control. Right, 'Step 4, E3: fails': level means between −1.94 and −0.87%, four of the five levels below the −1.0% edge; Q flags 100% of spectra and T² 100%; beneath, worst level mean −1.94% at 105%, accuracy fails, contain the output made while the flag was on and do not use the model for release until it is rebuilt.
Synthetic teaching data; E3 is hypothetical, for comparison only. Both suppliers trip Q on every spectrum. Only the designed challenge separates a model that still works from one that doesn't.
E2 (arrived)E3 (hypothetical)
Band shift, built in → measured2 nm → 2.1 nm10 nm → 10.0 nm
Q flags (share of spectra over 20 days)100%100%
T² flags1%100%
Challenge level means−0.93 to +0.11%−1.94 to −0.87%
Against the illustrative ±1.0% requirementPasses at every levelFails at four of five levels
ResponseExtend the calibration under change controlContain the output made while flagged; rebuild before release use

Three lessons sit in that table. Q alone cannot tell the two cases apart: both flag every spectrum. T² is no help either, since it flags E3 but barely E2, and nothing about “T² is quiet” means the predictions are right. The designed challenge across the decision range is what separates “the model still works but its diagnostic doesn’t” from “the model no longer works”, and that difference decides between a planned calibration update and containing product. The predicted assay looked plausible for both.

Choose the response that addresses the cause

FindingPossible response, subject to the established strategy
Fouled probe windowRestore the measurement condition and verify performance
Incorrect sample pairing or reference resultCorrect the data issue and assess the affected conclusions
New acceptable variation already handled adequatelyDocument the evidence; consider justified monitoring or applicability updates
Acceptable new material variation not adequately modeledDevelop a controlled calibration extension or rebuild, and evaluate it
Material or process is unsuitableAddress the material or process issue; do not train the problem into acceptability

Adding every flagged sample to the calibration can normalize a failure rather than improve the procedure. First establish what the sample represents and whether it belongs within the intended use.

Likewise, moving a diagnostic threshold until the alarm stops is a model change that needs justification. The goal is continued suitability, not a quiet dashboard.

Instrument transfer is an analytical change

The team now wants to run the procedure on another NIR instrument. Copying the coefficient file is easy. Demonstrating equivalent performance is the real task.

Instruments can differ in wavelength response, resolution, detector characteristics, optics and sample presentation. Transfer may involve instrument matching, a suitable standardization technique (piecewise direct standardization is a common one) or redevelopment, followed by appropriate evaluation on the receiving system.

Use samples relevant to the intended range and sources of variation. Check bias and error against suitable references, not only the average spectra. Keep the full pipeline, including preprocessing and diagnostic calculations, under control.

An instructive pharmaceutical paper by Cogdill, Anderson and Drennen examined NIR calibration monitoring and transfer across instruments and maintenance events. It compared several transfer techniques and combined instrument measures with T² and Q diagnostics. Its findings show why transfer has to be evaluated experimentally, rather than assuming one technique or sample count works everywhere [3].

Updating the model returns us to development

If recalibration is justified, define what is changing: the intended population, calibration samples, variables, preprocessing, algorithm, number of components, decision thresholds or instrument domain.

Keep development and independent assessment separate. New lots used to update the calibration cannot also serve as untouched evidence of its performance. Re-evaluate the relevant historical conditions as well as the new variation; improving the new-supplier fit can worsen old-supplier performance.

Document why samples are added or removed. Keep earlier models, their supported scope, and the evidence behind each version. Verification or revalidation should match the nature and impact of the change. Regulatory reporting depends on the applicable authorization, the Q12 established conditions and regional requirements; it is not settled by the analyst’s label “minor update” [1, 4].

The deployable object is the full procedure

A versioned model package should identify the calibration data and references, preprocessing parameters, variable selection, coefficients, diagnostic definitions and limits, software dependencies, intended scope, validation evidence and operating instructions.

Deployment includes verifying that the correct version reaches the correct instrument or process system. Keep a controlled recovery or rollback route where appropriate. Reverting the software does not automatically settle the disposition of material made during a questionable period.

Routine monitoring then resumes under the updated plan. A controlled update is another evidence-supported state of the procedure, not the end of its lifecycle.

Where the analyst sits

The analyst interprets change. Is it real material variation, a measurement artefact, an unsupported domain, or a changed relationship to quality? Which evidence is still valid, and which conclusions need reassessing?

A lifecycle approach keeps useful models useful by keeping their purpose, assumptions, performance and changes visible. It also sets up the language-model reading, where version changes and task-specific evaluation raise related questions.

For discussion

  1. Why can Q rise while concentration predictions still agree with reference results?
  2. Why can prediction error rise without a corresponding shift in the measured X distribution?
  3. A new supplier’s excipient passes incoming tests but produces unusual spectra. What would you investigate before extending the calibration?
  4. What evidence would support transfer to a second instrument, beyond copying the model file?
  5. Why should an updated model be challenged on both historical and newly introduced variation?

Bridge back to the week

Next: From Spectra to Language, which asks the same questions of a language model drafting an investigation summary. Return to Week 11.

Data and sources

Synthetic monitoring data: three scenarios of 30 observations, with inputs, reference and predicted Y, Q and prediction error; scenario means. Supplier investigation: daily diagnostics, routine reference checks, instrument checks, band centres by lot, challenge results and summary; hypothetical E3: band centres, challenge and pass/fail comparison; reproduction script and requirements. Figures: 3840 × 2160 pixels, computed with fixed seeds.

[1] ICH Q14, Analytical Procedure Development, Section 8, particularly recalibration and model maintenance and Figure 3 on the multivariate lifecycle. Final guidance (PDF).

[2] ICH Q8/Q9/Q10 questions and answers and points to consider: model verification, reference comparisons, update triggers and recalibration planning. Guidance page.

[3] R. P. Cogdill, C. A. Anderson and J. K. Drennen, “Process analytical technology case study, part III: Calibration monitoring and transfer,” AAPS PharmSciTech 6 (2005) E284–E297. A pharmaceutical NIR example from well before the current artificial intelligence (AI) boom. Open-access article.

[4] ICH Q2(R2), Validation of Analytical Procedures: intended-use validation context. Guidance page.

The supplier-change case is a constructed teaching example; the monitoring scenarios are synthetic.