Metadata-Version: 2.4
Name: stresspy
Version: 0.0.1
Summary: Geometric stress criterion modeling and tangent space decomposition
License: CC BY-NC 4.0
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: numpy
Requires-Dist: scipy
Requires-Dist: pandas

# StressPy: Geometric Stress Criterion (GSC)

`stresspy` is a reference Python implementation of the deterministic numerical core of the **Geometric Stress Criterion (GSC)**. It decomposes model–data discrepancies into components that are locally accessible (tangent) and inaccessible (normal) through parameter variation.

---

## 1. Mathematical Background

At a specified parameter point $\hat{\theta}$, let $r = y - f(\hat{\theta})$ be the model–data discrepancy and $J = \left.\frac{\partial f}{\partial x}\right\vert{}_{\hat{\theta}}$ be the Jacobian with respect to parameter coordinates $x$.

After applying an observation-space whitening transformation $L$:
$$r_W = Lr, \qquad J_W = LJ$$

If $U_r$ contains the retained left singular vectors of $J_W$, the orthogonal components are:
$$r_{\parallel,W} = U_r U_r^\top r_W, \qquad r_{\perp,W} = r_W - r_{\parallel,W}$$

The reported stresses and normal fraction are:
$$S_{\mathrm{total}} = \Vert{}r_W\Vert{}_2^2, \quad S_{\parallel} = \Vert{}r_{\parallel,W}\Vert{}_2^2, \quad S_{\perp} = \Vert{}r_{\perp,W}\Vert{}_2^2, \quad F_{\perp} = \frac{S_{\perp}}{S_{\mathrm{total}}}$$

The minimum-norm local repair vector $\Delta x$ satisfies:
$$\Delta x = V_r \Sigma_r^{-1} U_r^\top r_W$$

Under the local linear approximation, $r - J \Delta x = r_\perp$.

---

## 2. Installation

```bash
pip install stresspy
