Expand description
Correlation analysis.
Pearson, Spearman, and Kendall correlation coefficients with p-values, correlation matrices, and Fisher z-transformation confidence intervals.
§Examples
use u_analytics::correlation::{pearson, spearman, kendall_tau_b};
let x = [1.0, 2.0, 3.0, 4.0, 5.0];
let y = [2.0, 4.0, 5.0, 4.0, 5.0];
let p = pearson(&x, &y).unwrap();
assert!(p.r > 0.7);
assert!(p.p_value < 0.2);
let s = spearman(&x, &y).unwrap();
assert!(s.r > 0.7);
let k = kendall_tau_b(&x, &y).unwrap();
assert!(k.r > 0.5);Structs§
- AcfResult
- Result of autocorrelation analysis.
- CorrelationCI
- Confidence interval for a correlation coefficient.
- Correlation
Result - Result of a correlation computation.
- Pacf
Result - Result of partial autocorrelation analysis.
Functions§
- acf
- Compute the sample autocorrelation function (ACF).
- correlation_
ci - Computes confidence interval for a Pearson correlation coefficient using Fisher z-transformation.
- correlation_
matrix - Computes a pairwise Pearson correlation matrix.
- fisher_
z - Computes Fisher z-transformation: z = arctanh(r).
- fisher_
z_ inv - Inverse Fisher z-transformation: r = tanh(z).
- kendall_
tau_ b - Computes Kendall’s tau-b correlation coefficient with tie correction.
- pacf
- Compute the sample partial autocorrelation function (PACF) via Durbin-Levinson recursion.
- pearson
- Computes Pearson product-moment correlation coefficient and p-value.
- spearman
- Computes Spearman rank correlation coefficient and p-value.
- spearman_
matrix - Computes a pairwise Spearman rank correlation matrix.