Tangent stress r∥
The part of the residual aligned with directions the model can produce through small parameter changes.
Conventional metrics summarise fit or compare models. StressPy adds a local geometric view of the discrepancy.
The part of the residual aligned with directions the model can produce through small parameter changes.
The part of the residual outside those directions at the evaluated parameter point, under the chosen weighting and numerical rank.
This is a local diagnosis. Normal stress alone does not establish global structural inadequacy, and tangent accessibility does not guarantee a useful finite nonlinear repair. Calibration and repair checks help interpret the result.
Built around the weighted Jacobian and singular value decomposition, with diagnostics that connect geometry to model behaviour.
Quantify the two residual components and the normal fraction of total discrepancy.
DECOMPOSITIONInspect the dimension of the model’s locally accessible response space.
LOCAL GEOMETRYAccount for observational uncertainty, with standard deviations and variance floors.
UNCERTAINTYUse bootstrap or Monte Carlo reference distributions to put stress in context.
REFERENCE DISTRIBUTIONSCompute a minimum-norm local parameter correction associated with the accessible component.
PARAMETER ADJUSTMENTEvaluate steps along a repair direction to examine whether the actual nonlinear model improves.
LOCAL → FINITEInstall StressPy, then follow the package documentation for the interface and examples available in your installed release.
Package & documentation ↗$ pip install stresspy# A typical diagnostic workflow
StressPy implements diagnostics developed around the Geometric Stress Criterion (GSC): examining model–data discrepancy relative to a model’s locally accessible response directions.
The construction applies to differentiable model responses, including ODE models. It complements measures such as RMSE and model-selection criteria such as AIC and BIC.
Have a question, spotted a problem, or tried StressPy on your own model? Your feedback is welcome.
integralconstraints@gmail.comThe form opens a draft in your email app. Review it there and send it when you’re ready.
Understand the direction of model error.
StressPy splits the weighted residual into two orthogonal components. Tangent stress measures discrepancy aligned with the response directions available through small parameter changes. Normal stress measures the component outside that local space.
Inspect both stress magnitudes and the normal fraction: normal stress divided by total stress. A fraction describes the balance of the error, not its absolute size. When total stress is zero, that fraction is undefined.
A substantial tangent component suggests a direction worth exploring through parameter adjustment. A substantial normal component identifies discrepancy that the current local linear approximation cannot remove.
The result depends on the parameter point, observational weighting, and numerical rank. Noise can create normal stress, and curvature can change what is accessible farther away. Use calibration and nonlinear repair checks before drawing a broader conclusion.
Count the response directions the model can express locally.
The singular values of the weighted Jacobian describe how strongly parameter combinations affect model responses. Numerical rank counts the singular directions retained under the chosen threshold.
Compare the retained rank with the number of parameters and observations. A low rank can reflect redundant parameter effects, weak sensitivities, or limitations of the experimental design.
Vary the rank threshold and check whether the stress decomposition changes materially. If constructing the Jacobian numerically, also check sensitivity to the finite-difference step size.
Numerical rank is a local, threshold-dependent quantity. It does not by itself establish global parameter identifiability. Parameter scaling and derivative accuracy can affect which directions are retained.
Define what a unit of discrepancy means.
Weighting sets the geometry in which error is measured. With independent observational standard deviations, each residual is divided by its standard deviation and the corresponding Jacobian row is scaled in the same way.
Check whether a few observations have extremely small estimated uncertainties. These observations can dominate the weighted discrepancy and the resulting decomposition.
Use uncertainty estimates appropriate to the observations. A justified variance floor can prevent unrealistically small estimates from receiving excessive weight. Compare plausible weighting choices and report important sensitivity.
Weighting changes both the residual and the tangent space in weighted coordinates. Equal weighting is also a modelling choice. Diagonal weights do not represent correlations between observations.
Put the observed stress against a reference.
Bootstrap or Monte Carlo calibration compares observed stress with stresses obtained under a specified reference mechanism. It helps assess whether the observed result is unusual under those assumptions.
Inspect the reference distribution as well as a reported p-value. The number of simulations limits tail resolution: with the usual plus-one correction, the smallest attainable p-value is 1 / (B + 1), where B is the number of replicates.
Choose a reference that reflects the noise, design, and fitting procedure relevant to your question. Record the simulation count and random seed, and check that the reference reproduces the analysis steps needed for the intended test.
A calibrated result is conditional on its reference assumptions. A small p-value does not identify a missing mechanism; a large p-value does not prove model adequacy. Effect size and scientific context remain essential.
Turn tangent accessibility into a candidate parameter step.
A pseudoinverse of the weighted Jacobian gives a minimum-norm parameter displacement that corrects the tangent component in the local linear approximation. With residual defined as model minus observations, the correction has the opposite sign to the pseudoinverse acting on that residual.
Inspect the displacement magnitude and its individual parameter changes. Large changes can signal weakly sensitive directions or a correction that extends beyond the useful local neighbourhood.
Treat the displacement as a direction to test. Try scaled steps, evaluate the actual model, and check physical bounds and parameter constraints before interpreting a step as a feasible repair.
Minimum norm depends on the parameter coordinates and their scaling. The unconstrained linear correction need not respect bounds, and it cannot remove the normal component within that same linear approximation.
Test whether the real model follows the local prediction.
Evaluate the actual model at scaled steps along a proposed repair direction. Compare the resulting discrepancy with the starting value and with the improvement predicted by the local linear approximation.
Look for a range of step sizes that reduces the actual error. A very small useful range suggests limited local validity; failed or nonphysical evaluations indicate that a proposed step is not usable.
Start with small steps and examine a range of magnitudes. Keep the observational weights fixed when comparing errors, and record solver failures or constraint violations alongside successful evaluations.
A successful small step demonstrates improvement along that tested direction. It does not establish a complete finite repair or a global optimum. Failure along one direction also does not prove that every possible parameter adjustment will fail.