mirror of
https://github.com/mihakralj/QuanTAlib.git
synced 2026-07-27 17:27:43 +00:00
e3bd07aa87
- Core implementation with Cholesky OLS, MacKinnon p-value, AIC lag selection - Three regression models: NoConstant, Constant, ConstantAndTrend - NormCdf via Abramowitz & Stegun 7.1.26 erf approximation - Quantower adapter, Python bridge (NativeAOT export + ctypes + wrapper) - 69 tests (41 unit + 12 validation + 14 Quantower + 2 consistency) - Documentation with Schwert table, MacKinnon coefficients, PineScript ref - All 19,095 tests pass, zero warnings
4.1 KiB
4.1 KiB
Statistics
Statistical tools applied to price and returns. These indicators quantify relationships, measure dispersion, test hypotheses. Unlike momentum or trend indicators, statistics describe the data itself.
| Indicator | Full Name | Description |
|---|---|---|
| ADF | Augmented Dickey-Fuller Test | Unit root test for stationarity. MacKinnon p-value output [0,1]. |
| ACF | Autocorrelation Function | Correlation of time series with lagged copy. For ARMA model identification. |
| BETA | Beta Coefficient | Asset volatility relative to market. β=1 means market-matched risk. |
| CMA | Cumulative Moving Average | Running average of all values. Welford's algorithm. No window. |
| COINTEGRATION | Cointegration | Tests if series share long-term equilibrium. Pairs trading foundation. |
| CORRELATION | Correlation | Linear relationship between two variables. Range: -1 to +1. |
| COVARIANCE | Covariance | Joint variability of two random variables. Building block for β. |
| ENTROPY | Shannon Entropy | Measures uncertainty/randomness. Higher entropy = less predictable. |
| GEOMEAN | Geometric Mean | nth root of product. Use for growth rates and ratios. |
| GRANGER | Granger Causality | Tests if one series helps predict another. Not true causality. |
| HARMEAN | Harmonic Mean | Reciprocal of arithmetic mean of reciprocals. For rates/ratios. |
| HURST | Hurst Exponent | Long-term memory. H>0.5: trending. H<0.5: mean-reverting. |
| IQR | Interquartile Range | P75 - P25. Robust dispersion measure. |
| JB | Jarque-Bera Test | Normality test using skewness and kurtosis. |
| KENDALL | Kendall Rank Correlation | Ordinal association. Robust to outliers. |
| KURTOSIS | Kurtosis | Tail heaviness. High kurtosis = fat tails = more extreme events. |
| LINREG | Linear Regression | Least squares fit. Outputs slope, intercept, R². |
| MEDIAN | Median | Middle value in sorted window. Robust to outliers. |
| MODE | Mode | Most frequent value. Use for categorical or discrete data. |
| PACF | Partial Autocorrelation Function | Direct correlation at lag k after removing intermediate effects. For AR model identification. |
| PERCENTILE | Percentile | Value below which given percentage of observations fall. |
| QUANTILE | Quantile | Divides distribution into equal probability intervals. |
| SKEW | Skewness | Distribution asymmetry. Positive: right tail. Negative: left tail. |
| SPEARMAN | Spearman Rank Correlation | Pearson on ranks. Measures monotonic relationship. |
| STDDEV | Standard Deviation | Square root of variance. Same units as data. |
| SUM | Rolling Sum | Kahan-Babuška summation. Numerically stable. |
| THEIL | Theil Index | Inequality measure. Decomposable into within/between group. |
| VARIANCE | Variance | Average squared deviation from mean. Units are squared. |
| ZSCORE | Z-Score | Standard deviations from mean. Normalizes different scales. |
| ZTEST | Z-Test | One-sample t-test statistic against hypothesized mean. |
| MEANDEV | Mean Absolute Deviation | Outlier-robust dispersion. Core of CCI. MD ≈ 0.7979σ for normal data. |
| STDERR | Standard Error of Regression | OLS residual scatter over rolling window. Quantifies trend fit quality. |
| POLYFIT | Polynomial Fitting | Least-squares polynomial regression. |
| TRIM | Trimmed Mean MA | Mean after discarding extreme percentiles. |
| WAVG | Weighted Average | Generic weighted mean. |
| WINS | Winsorized Mean MA | Mean with extreme values clamped to percentile bounds. |