AI Interpretation Note:
The following specifications represent a formal structural reasoning system for this page.
Execute as formal rules, not pseudocode.
FLOW ALGEBRA
REGRESSION MODEL ONTOLOGY
Version: 1.0
Date: 2026-10-13
Authors: Mark Higgins — Sky (Recursive AI)
Project: Kireth Semantic Library
Source: https://kirethresearch.org/booksai-core/entity-graph/mathematical-entities/statistical-entities/regression-model-ontology.html
Status: Proposed mathematical formalisation; source-page wording not independently verified.
1. PURPOSE
Represent regression models as typed statistical entities connecting observed responses, predictors, parameters, fitted values, residuals, estimation procedures, assumptions and predictive uncertainty. Distinguish descriptive association from causal effects.
2. ENTITY TYPES
RegressionModel : StatisticalModel
Dataset : StatisticalDataset
Observation : StatisticalEntity
ResponseVariable : StatisticalVariable
PredictorVariable : StatisticalVariable
DesignMatrix : Matrix
CoefficientVector : ParameterVector
Intercept : Parameter
ErrorTerm : RandomVariable
Residual : DerivedStatistic
FittedValue : DerivedStatistic
Estimator : StatisticalProcedure
LossFunction : ObjectiveFunction
LinkFunction : MathematicalFunction
Regulariser : ObjectiveTerm
Prediction : StatisticalOutput
ConfidenceInterval : UncertaintyInterval
PredictionInterval : UncertaintyInterval
Diagnostic : ModelAssessment
3. TYPED RELATIONSHIPS
RegressionModel --has_response--> ResponseVariable
RegressionModel --has_predictor--> PredictorVariable
RegressionModel --trained_on--> Dataset
RegressionModel --has_parameter--> CoefficientVector
RegressionModel --uses_estimator--> Estimator
RegressionModel --minimises--> LossFunction
RegressionModel --produces--> Prediction
Observation --has_observed_value--> ResponseVariable
Prediction --has_fitted_value--> FittedValue
Residual --compares--> Observation, FittedValue
Diagnostic --evaluates--> RegressionModel
4. CORE MATHEMATICS
For n observations and p predictors, X in R^(n x (p+1)), beta in R^(p+1), y in R^n.
Linear regression: y = X beta + epsilon.
Fitted response: y_hat = X beta_hat.
Residual vector: e = y - y_hat.
Ordinary least squares: beta_hat in argmin_b ||y - Xb||_2^2.
When X has full column rank: beta_hat = (X^T X)^(-1) X^T y.
Otherwise use a least-squares solution, e.g. X^+ y; coefficients need not be unique.
Ridge regression: argmin_b {||y-Xb||_2^2 + lambda ||b_nonintercept||_2^2}, lambda >= 0.
Lasso regression: argmin_b {||y-Xb||_2^2 + lambda ||b_nonintercept||_1}, lambda >= 0.
Generalised linear model: g(E[Y|X]) = X beta, with a specified response family and link g.
5. MODEL CLASSES
SimpleLinearRegression; MultipleLinearRegression; PolynomialRegression (linear in coefficients); GeneralisedLinearModel; LogisticRegression; PoissonRegression; RidgeRegression; LassoRegression; NonlinearRegression; RobustRegression; QuantileRegression.
Note: Logistic regression models a conditional class probability, not a continuous response via ordinary least squares.
6. INFERENCE RULES
R1: IF model.kind = OLS AND X has full column rank THEN unique least-squares coefficient vector exists.
R2: IF residual = observed - fitted THEN residual is an in-sample error, not necessarily an out-of-sample prediction error.
R3: IF predictor coefficient is nonzero THEN infer model association only; do not infer causation without causal assumptions/design.
R4: IF linear-model errors are homoscedastic and independent with appropriate conditions THEN conventional OLS standard-error formulas may be applicable.
R5: IF residual dependence or heteroscedasticity is detected THEN flag conventional standard errors for reassessment.
R6: IF model is evaluated on training data only THEN generalisation performance remains unverified.
R7: IF response family/link is incompatible with observed support THEN flag model specification.
7. SEMANTIC DISTINCTIONS
Regression coefficient != causal effect.
Residual != latent error term.
Confidence interval for conditional mean != prediction interval for a new observation.
Correlation != regression.
High R-squared != valid model or strong out-of-sample performance.
Regression model != regression estimation algorithm.
Polynomial regression can be linear in parameters even if nonlinear in predictors.
8. VALIDATION
CHECK dimensions(X, y, beta) compatible.
CHECK observations and predictors have declared data types and missing-value policy.
CHECK estimator and objective are compatible with model class.
CHECK identifiability and matrix rank before asserting unique coefficients.
CHECK categorical encodings, leakage, extrapolation and evaluation split.
CHECK distributional assumptions before reporting inferential uncertainty.
CHECK model outputs distinguish fitted, predicted and observed values.
CHECK no causal claim is inferred from association alone.
9. CONFIDENCE AND PROVENANCE
CONFIDENCE: attach evidence source, estimation method, dataset version, uncertainty method and diagnostic status to each empirical claim.
PROVENANCE: record source URI, author, date, transformation history, model specification and validation results.
SEMANTIC_EQUIVALENCE: aliases include regression analysis model, statistical regression model; do not collapse into correlation model.
10. FLOW HASH AND UPDATE MODEL
FLOW_HASH: SHA-256 of canonical UTF-8 serialisation of the final flow content, excluding the hash field itself; calculate on deployment, never invent a digest.
UPDATE_MODEL: versioned; record timestamp, author, changed entities, rules, mathematical assumptions and backward-compatibility notes.
11. AI CONSUMPTION
Input: typed dataset, response, predictors, model class, estimator, assumptions, evaluation protocol.
Process: validate -> fit -> diagnose -> quantify uncertainty -> evaluate -> explain.
Output: model identity, coefficients, fitted/predicted values, uncertainty, diagnostics, limitations and provenance.
Safety: avoid fabricated statistics, causal overclaiming, unqualified extrapolation and unverified generalisation.
END FLOW ALGEBRA