# UAnalytics
.NET bindings for the u-analytics statistical process control and reliability engine.
## Features
- **Control charts**: X̄-R, X̄-S, I-MR for variables; p, np, c, u and Laney p′ for
attributes, with Phase I baselines for Phase II limits
- **Run rules**: applied to any series against limits you supply, or to a chart's own
- **Process capability**: Cp, Cpk, Pp, Ppk, Cpm, and a percentile method for
non-normal data
- **Measurement systems analysis**: Gage R&R by the Average & Range method and by
ANOVA, each returning the charts the method plots
- **Reliability**: Weibull fitting by maximum likelihood (`WeibullMle`) and median-rank
regression (`WeibullMrr`); `WeibullReliability` — MTBF, R(t), h(t) and B-lives
- **Non-normal capability**: `BoxCoxCapability`, and `SigmaToPpm` / `PpmToSigma` on the
1.5σ-shift convention
- **Event-time trend**: whether one unit's events (failures of a repairable system,
incidents) arrive at a changing rate — `LaplaceTrendTest`, `MilHdbk189Test`, and the
power-law process (Crow-AMSAA) fit `PowerLawProcessFit`. Pass the end of observation,
or `null` when it stopped at the last event
- **Hypothesis tests**: t (one-sample, Welch, paired), Mann-Whitney, Wilcoxon,
Jarque-Bera, Shapiro-Wilk, Anderson-Darling, Mann-Kendall, ANOVA, Kruskal-Wallis, Levene, Bartlett,
χ² goodness of fit and independence, Fisher's exact; Bonferroni and
Benjamini-Hochberg adjustment
- **Stationarity**: `AdfTest` (augmented Dickey-Fuller)
- **Change detection**: changepoints in one series or several aligned ones
(`DetectChangepointsMulti`), `Cusum` and `Ewma` charts for small sustained shifts,
period estimation, spectral residual scoring
- **Correlation and regression**: correlation matrices, simple linear regression
- **Distribution fitting**: best-fit selection across candidate distributions
## Installation
```bash
dotnet add package UAnalytics
```
## Usage
```csharp
using UAnalytics;
using var analytics = new AnalyticsClient();
var chart = analytics.XbarRChart(new[]
{
new[] { 10.1, 10.3, 9.8 },
new[] { 10.0, 10.2, 10.1 },
new[] { 9.9, 10.4, 10.2 },
});
Console.WriteLine(chart.GetProperty("ucl").GetDouble());
```
Every method returns a `System.Text.Json.JsonElement`, so a result can be read
field by field or deserialized into your own type.
Input that cannot be analysed is refused rather than approximated, with a code
naming what was wrong and the index of the row it was wrong in.
## Platforms
Windows, Linux and macOS (x64 and arm64). The native library ships inside the
package; no separate install is needed.
## License
MIT