fintech-algorithms
Using a coding agent? Give it the skill: npx skills add IslamBaraka90/Fintech-Algorithms-Library What it does →

Dependence, Regression, and Model Foundations

10 algorithms in Financial Mathematics, Statistics, and Data Foundations · 10 with asserted arithmetic.

In this family#

  1. Scatter Plots, Association, and Nonlinear Patterns verified

    Pairs input.x and input.y into plottable points and reports the Pearson correlation over them along with its sign.

    scatterPlotsAssociationAndNonlinearPatterns(input)
  2. Sample Covariance Calculation and Interpretation verified

    Computes the sample covariance between input.x and input.y using the n-1 denominator, and reports which way the two series move together.

    sampleCovarianceCalculationAndInterpretation(input)
  3. Pearson Correlation Calculation and Interpretation verified

    Computes the Pearson correlation between input.x and input.y and its absolute value as a sign-free strength score.

    pearsonCorrelationCalculationAndInterpretation(input)
  4. Spearman Rank Correlation and Kendall Tau verified

    Replaces input.x and input.y with their ranks, averaging ranks across ties, then reports the Spearman correlation of those ranks and Kendall's tau-a from the concordant and discordant pair counts.

    spearmanRankCorrelationAndKendallTau(input)
  5. Correlation, Causation, Confounding, and Spurious Relationships verified

    Contrasts the pooled correlation of input.x and input.y with the correlation recomputed inside each label in input.groups, which is where a confounded or reversed relationship shows itself.

    correlationCausationConfoundingAndSpuriousRelationships(input)
  6. Simple Ordinary Least Squares Regression verified

    Fits a single-predictor ordinary least squares line of input.y on input.x and returns the fitted coefficients with the in-sample fitted values.

    simpleOrdinaryLeastSquaresRegression(input)
  7. Intercepts, Slopes, Coefficients, and Predictions verified

    Fits the least squares line of input.y on input.x and evaluates it at one new predictor value, input.predictX.

    interceptsSlopesCoefficientsAndPredictions(input)
  8. Residuals, MAE, MSE, and RMSE verified

    Returns the least squares residuals of input.y on input.x together with the three usual summaries of their size.

    residualsMaeMseAndRmse(input)
  9. R-Squared and Adjusted R-Squared verified

    Reports the share of the variation in input.y that the least squares fit on input.x accounts for, and the same figure adjusted for the one estimated slope.

    rSquaredAndAdjustedRSquared(input)
  10. Regression Assumptions, Heteroskedasticity, and Multicollinearity verified

    Runs three diagnostics on the least squares fit of input.y on input.x: the mean residual, a correlation between fitted values and absolute residuals standing in for non-constant error variance, and the correlation with input.otherPredictor standing in for collinearity.

    regressionAssumptionsHeteroskedasticityAndMulticollinearity(input)

What they share#

Every topic here is a record-transform, so once you have called one the rest follow the same shape. Import paths differ only in the final segment:

ts
import { scatterPlotsAssociationAndNonlinearPatterns } from "fintech-algorithms/foundations/dependence-regression-and-model-foundations/scatter-plots-association-and-nonlinear-patterns";
import { sampleCovarianceCalculationAndInterpretation } from "fintech-algorithms/foundations/dependence-regression-and-model-foundations/sample-covariance-calculation-and-interpretation";

Read them in the order above — the sequence is pedagogical, not alphabetical.

Where this sits#

Financial Mathematics, Statistics, and Data Foundations collects 120 algorithms across 12 families. For the concept behind this family rather than the call signatures, see the concept guides.