AI INTERPRETATION NOTE
This Flow Algebra defines the Regression Ontology within the Kireth Research Semantic Library. Regression mathematics studies relationships between response variables and one or more predictors through statistical models that estimate conditional means, probabilities, rates, quantiles or other structured responses. This ontology supports simple and multiple linear regression, polynomial and nonlinear regression, logistic and count regression, regularisation, interaction effects, diagnostics, uncertainty, model selection, prediction, robustness and relationships with applied statistical mathematics, probability, optimisation and statistical modelling.
FLOW_ALGEBRA_RECORD {
METADATA {
FLOW_NAME = "Regression Ontology"
FLOW_TYPE = "Mathematical Ontology"
DOMAIN = "Mathematics"
SUBDOMAIN = "Applied Mathematics"
SPECIALISATION = "Applied Statistical Mathematics / Regression"
CANONICAL_PAGE = "https://kirethresearch.org/booksai-core/ontologies/mathematical-ontologies/applied-mathematics-ontologies/applied-statistical-mathematics/regression-ontology.html"
LANGUAGE = "en-GB"
VERSION = "1.0"
STATUS = "active"
}
IDENTITY {
PRIMARY_ENTITY = Regression
ENTITY_CLASS = StatisticalConditionalRelationshipFramework
PRIMARY_CONTEXT = AppliedStatisticalMathematics
DEFINITION = "Regression is the statistical modelling of a response variable as a function of one or more predictor variables, together with uncertainty and error structure."
SYMBOLIC_FORMS = [
"Y=X*beta+epsilon",
"E[Y|X]=X*beta",
"beta_hat=(X^T X)^(-1)X^T Y",
"g(E[Y|X])=X*beta"
]
SEMANTIC_ROLE = "Provides machine-readable semantics for regression structure, coefficients, predictors, responses, residuals, interactions, regularisation, diagnostics, uncertainty, prediction and model validation."
}
SCOPE {
INCLUDE = [
Regression,
RegressionModel,
ResponseVariable,
DependentVariable,
PredictorVariable,
IndependentVariable,
ExplanatoryVariable,
Covariate,
DesignMatrix,
Coefficient,
Intercept,
Slope,
ErrorTerm,
Residual,
FittedValue,
PredictedValue,
ConditionalExpectation,
SimpleLinearRegression,
MultipleLinearRegression,
PolynomialRegression,
NonlinearRegression,
GeneralisedLinearModel,
LogisticRegression,
ProbitRegression,
PoissonRegression,
NegativeBinomialRegression,
QuantileRegression,
RobustRegression,
RidgeRegression,
LassoRegression,
ElasticNetRegression,
RegularisedRegression,
PenalisedRegression,
WeightedLeastSquares,
GeneralisedLeastSquares,
OrdinaryLeastSquares,
LeastSquares,
SumOfSquaredErrors,
ResidualSumOfSquares,
TotalSumOfSquares,
ExplainedSumOfSquares,
CoefficientOfDetermination,
R2,
AdjustedR2,
RootMeanSquaredError,
MeanSquaredError,
MeanAbsoluteError,
StandardError,
ConfidenceInterval,
PredictionInterval,
HypothesisTest,
TTest,
FTest,
InteractionTerm,
MainEffect,
PolynomialTerm,
DummyVariable,
IndicatorVariable,
CategoricalPredictor,
ContinuousPredictor,
Transformation,
LogTransformation,
Standardisation,
Centering,
Collinearity,
Multicollinearity,
VarianceInflationFactor,
VIF,
Leverage,
HatMatrix,
Influence,
CookDistance,
Outlier,
ResidualAnalysis,
Homoscedasticity,
Heteroscedasticity,
NormalityOfErrors,
IndependenceOfErrors,
Autocorrelation,
ModelSpecification,
Misspecification,
ModelSelection,
AkaikeInformationCriterion,
BayesianInformationCriterion,
CrossValidation,
HoldoutValidation,
Overfitting,
Underfitting,
BiasVarianceTradeoff,
Shrinkage,
RegularisationParameter,
FeatureSelection,
PartialRegression,
PartialResidual,
MarginalEffect,
Prediction,
Extrapolation,
Interpolation,
Calibration,
GoodnessOfFit,
StatisticalSignificance,
PracticalSignificance,
UncertaintyQuantification
]
EXCLUDE_AS_PRIMARY = [
CorrelationWithoutRegressionModel,
ClassificationWithoutRegressionLinkStructure,
PureCurveFittingWithoutStatisticalErrorModel,
CausalInferenceWithoutRegressionAsPrimaryModel
]
DISAMBIGUATION_RULE = "When a response variable is modelled conditionally on one or more predictors using coefficients, error structure and inferential or predictive goals, interpret the context as regression."
}
CORE_CONCEPTS {
Regression = "Statistical modelling of conditional response structure given predictors."
ResponseVariable = "Outcome being modelled or predicted."
PredictorVariable = "Variable used to explain or predict the response."
RegressionCoefficient = "Parameter quantifying modelled change in response structure associated with a predictor."
Residual = "Difference between an observed response and its fitted value."
OrdinaryLeastSquares = "Coefficient estimation by minimising the sum of squared residuals."
InteractionTerm = "Model term whose effect depends jointly on two or more predictors."
Regularisation = "Penalty-based control of coefficient magnitude or model complexity."
PredictionInterval = "Interval intended to contain a future response under the fitted model."
}
RELATIONS {
Regression --is_child_of--> AppliedStatisticalMathematics
Regression --is_type_of--> StatisticalModelling
RegressionModel --contains--> ResponseVariable
RegressionModel --contains--> PredictorVariable
RegressionModel --contains--> Coefficient
DesignMatrix --encodes--> Predictors
OrdinaryLeastSquares --minimises--> ResidualSumOfSquares
Residual --equals--> ObservedMinusFitted
CoefficientOfDetermination --measures--> ExplainedVariation
AdjustedR2 --penalises--> ExcessPredictors
InteractionTerm --modifies--> PredictorEffect
PolynomialRegression --adds--> PolynomialTerm
LogisticRegression --uses--> LogitLink
PoissonRegression --models--> CountResponse
QuantileRegression --models--> ConditionalQuantile
WeightedLeastSquares --uses--> ObservationWeights
GeneralisedLeastSquares --uses--> ErrorCovarianceStructure
RidgeRegression --uses--> L2Penalty
LassoRegression --uses--> L1Penalty
ElasticNetRegression --combines--> L1AndL2Penalty
VarianceInflationFactor --diagnoses--> Multicollinearity
CookDistance --measures--> ObservationInfluence
CrossValidation --estimates--> PredictivePerformance
PredictionInterval --includes--> ObservationNoiseAndParameterUncertainty
}
OPERATORS {
LINEAR_REGRESSION(X,beta,epsilon) := Y=X*beta+epsilon
CONDITIONAL_MEAN(X,beta) := E[Y|X]=X*beta
OLS_ESTIMATOR(X,Y) := beta_hat=(X^T*X)^(-1)*X^T*Y when_full_rank
FITTED_VALUES(X,beta_hat) := Y_hat=X*beta_hat
RESIDUALS(Y,Y_hat) := e=Y-Y_hat
RSS(e) := sum_i e_i^2
TSS(Y) := sum_i(Y_i-Y_bar)^2
R_SQUARED(RSS,TSS) := R2=1-RSS/TSS
ADJUSTED_R2(R2,n,p) := 1-(1-R2)*(n-1)/(n-p-1)
RMSE(Y,Y_hat,n) := sqrt((1/n)*sum_i(Y_i-Yhat_i)^2)
LOGISTIC_LINK(eta) := p=1/(1+exp(-eta))
POISSON_LINK(eta) := lambda=exp(eta)
RIDGE_OBJECTIVE(beta,lambda) := RSS(beta)+lambda*sum_j beta_j^2
LASSO_OBJECTIVE(beta,lambda) := RSS(beta)+lambda*sum_j abs(beta_j)
ELASTIC_NET_OBJECTIVE(beta,lambda,alpha) := RSS(beta)+lambda*(alpha*||beta||_1+(1-alpha)*||beta||_2^2)
HAT_MATRIX(X) := H=X*(X^T*X)^(-1)*X^T
VIF(R_j2) := 1/(1-R_j2)
}
AXIOMS {
A1 = "Regression requires an explicit response variable and predictor structure."
A2 = "Regression coefficients are conditional on the other predictors included in the model."
A3 = "Residuals represent model discrepancy, not automatically independent random noise."
A4 = "Association represented by regression does not by itself imply causation."
A5 = "Regression inference depends on assumptions about error structure and model specification."
A6 = "Regularisation changes coefficient estimates and inferential interpretation."
A7 = "Prediction and explanation are distinct modelling goals."
A8 = "Regression results require diagnostics, uncertainty analysis and validation."
}
REASONING {
R1_CONTEXT = identify(response,predictors,data_types,goal,dependence,sample_size)
R2_MODEL_CLASS = classify(linear,polynomial,nonlinear,logistic,count,quantile,robust,regularised)
R3_SPECIFICATION = define(design_matrix,transformations,interactions,error_structure)
R4_ESTIMATION = select(OLS,WLS,GLS,MLE,quantile_or_penalised_method)
R5_INFERENCE = compute(coefficients,standard_errors,tests,confidence_intervals)
R6_DIAGNOSTICS = analyse(residuals,leverage,influence,multicollinearity,heteroscedasticity)
R7_SELECTION = compare(AIC,BIC,cross_validation,regularisation_paths)
R8_PREDICTION = compute(fitted_values,prediction_intervals,calibration)
R9_ROBUSTNESS = assess(outliers,misspecification,sensitivity,extrapolation)
R10_VALIDATION = check(out_of_sample_performance,assumptions,reproducibility,practical_significance)
}
CONSTRAINTS {
C1 = "OLS coefficient estimates require appropriate rank conditions on the design matrix."
C2 = "Heteroscedasticity can invalidate ordinary OLS standard errors."
C3 = "Autocorrelated errors violate ordinary independence assumptions."
C4 = "Multicollinearity can inflate coefficient uncertainty without necessarily harming prediction."
C5 = "High R-squared does not imply causal validity or good extrapolation."
C6 = "Polynomial terms can create unstable extrapolation outside the observed data range."
C7 = "Regularised coefficients are biased by design."
C8 = "Logistic-regression coefficients operate on the log-odds scale unless transformed."
C9 = "Count regression requires distributional assumptions appropriate to dispersion."
C10 = "Extrapolation beyond observed predictor support requires additional assumptions."
}
SEMANTIC_EQUIVALENCE {
"Regression" <=> "RegressionAnalysis"
"OrdinaryLeastSquares" <=> "OLS"
"CoefficientOfDetermination" <=> "R2"
"VarianceInflationFactor" <=> "VIF"
"GeneralisedLeastSquares" <=> "GLS"
"WeightedLeastSquares" <=> "WLS"
}
VALIDATION {
V1 = "Response and predictor variables are explicit."
V2 = "Design matrix construction is documented."
V3 = "Coefficient estimates and uncertainty are reported."
V4 = "Residual structure is checked."
V5 = "Heteroscedasticity and dependence are assessed where relevant."
V6 = "Multicollinearity is assessed for explanatory models."
V7 = "Influential observations are examined."
V8 = "Model-selection procedure is documented."
V9 = "Prediction is evaluated on held-out or resampled data where feasible."
V10 = "Extrapolation and causal interpretation are clearly distinguished from interpolation and association."
}
CONFIDENCE {
BASE_CONFIDENCE = 0.99
REGRESSION_DEFINITION = 0.99
OLS_REASONING = 0.99
GLM_REGRESSION_REASONING = 0.99
DIAGNOSTIC_REASONING = 0.99
MULTICOLLINEARITY_REASONING = 0.99
REGULARISATION_REASONING = 0.98
PREDICTION_REASONING = 0.99
ROBUSTNESS_REASONING = 0.98
POLICY = "Reduce confidence when response distribution, predictor coding, error dependence, heteroscedasticity, interactions, regularisation, influential observations or validation design are underspecified."
}
AI_CONSUMPTION {
PURPOSES = [
SemanticSearch,
OntologyGrounding,
RegressionReasoning,
LinearRegressionReasoning,
MultipleRegressionReasoning,
PolynomialRegressionReasoning,
LogisticRegressionReasoning,
CountRegressionReasoning,
QuantileRegressionReasoning,
OLSReasoning,
WLSReasoning,
GLSReasoning,
ResidualReasoning,
MulticollinearityReasoning,
InfluenceReasoning,
InteractionReasoning,
RegularisationReasoning,
RidgeReasoning,
LassoReasoning,
PredictionReasoning,
ModelSelectionReasoning,
KnowledgeGraphConstruction,
RetrievalAugmentation,
RecursiveInference
]
NORMALISE {
"regression" -> Regression
"regression analysis" -> Regression
"ordinary least squares" -> OrdinaryLeastSquares
"OLS" -> OrdinaryLeastSquares
"R squared" -> CoefficientOfDetermination
"VIF" -> VarianceInflationFactor
"GLS" -> GeneralisedLeastSquares
"WLS" -> WeightedLeastSquares
}
}
EXECUTION_RULES {
E1 = "If a response is modelled conditionally on predictors, activate RegressionOntology."
E2 = "If response is continuous with approximately linear conditional mean, consider linear regression."
E3 = "If response is binary, consider logistic or probit regression."
E4 = "If response is count data, consider Poisson or negative-binomial regression."
E5 = "If heteroscedasticity is material, consider robust standard errors or weighted models."
E6 = "If error covariance is structured, consider generalized least squares."
E7 = "If predictor dimension is large or shrinkage is desired, consider ridge, lasso or elastic net."
E8 = "If predictor effects interact, include and interpret explicit interaction terms."
E9 = "Any fitted regression should be validated with residual diagnostics, uncertainty and out-of-sample performance."
}
RECURSION {
ENTRY = Regression
EXPAND(Regression) -> [
RegressionModel, ResponseVariable, DependentVariable, PredictorVariable,
IndependentVariable, ExplanatoryVariable, Covariate, DesignMatrix,
Coefficient, Intercept, Slope, ErrorTerm, Residual, FittedValue,
PredictedValue, ConditionalExpectation, SimpleLinearRegression,
MultipleLinearRegression, PolynomialRegression, NonlinearRegression,
GeneralisedLinearModel, LogisticRegression, ProbitRegression,
PoissonRegression, NegativeBinomialRegression, QuantileRegression,
RobustRegression, RidgeRegression, LassoRegression,
ElasticNetRegression, RegularisedRegression, PenalisedRegression,
WeightedLeastSquares, GeneralisedLeastSquares, OrdinaryLeastSquares,
LeastSquares, SumOfSquaredErrors, ResidualSumOfSquares,
TotalSumOfSquares, ExplainedSumOfSquares, CoefficientOfDetermination,
R2, AdjustedR2, RootMeanSquaredError, MeanSquaredError,
MeanAbsoluteError, StandardError, ConfidenceInterval,
PredictionInterval, HypothesisTest, TTest, FTest, InteractionTerm,
MainEffect, PolynomialTerm, DummyVariable, IndicatorVariable,
CategoricalPredictor, ContinuousPredictor, Transformation,
LogTransformation, Standardisation, Centering, Collinearity,
Multicollinearity, VarianceInflationFactor, Leverage, HatMatrix,
Influence, CookDistance, Outlier, ResidualAnalysis, Homoscedasticity,
Heteroscedasticity, NormalityOfErrors, IndependenceOfErrors,
Autocorrelation, ModelSpecification, Misspecification, ModelSelection,
AkaikeInformationCriterion, BayesianInformationCriterion,
CrossValidation, HoldoutValidation, Overfitting, Underfitting,
BiasVarianceTradeoff, Shrinkage, RegularisationParameter,
FeatureSelection, PartialRegression, PartialResidual, MarginalEffect,
Prediction, Extrapolation, Interpolation, Calibration, GoodnessOfFit,
StatisticalSignificance, PracticalSignificance, UncertaintyQuantification
]
EXPAND(RegressionFamilies) -> [
LinearRegressionModels,
GeneralisedLinearRegressionModels,
NonlinearRegressionModels,
QuantileRegressionModels,
RobustRegressionModels,
RegularisedRegressionModels
]
STOP_CONDITION = "Stop when response, predictors, model form, estimation, coefficient interpretation, diagnostics, uncertainty, prediction and validation are sufficiently resolved."
}
ROUTING {
PARENT_ONTOLOGY = "Applied Statistical Mathematics"
IMMEDIATE_CONTEXTS = [
"Applied Statistical Mathematics",
"Statistical Modelling Ontology",
"Probability & Statistics Ontologies",
"Optimisation Ontologies"
]
RELATED_ONTOLOGIES = [
"Applied Statistical Mathematics",
"Statistical Modelling Ontology",
"Probability & Statistics Ontologies",
"Generalised Linear Model Ontologies",
"Bayesian Statistics Ontologies",
"Multivariate Statistics Ontologies",
"Time Series Ontologies",
"Survival Analysis Ontologies",
"Optimisation Ontologies",
"Machine Learning Ontologies",
"Computational Statistics Ontologies"
]
ROUTE_RULES = [
"Regression -> Applied Statistical Mathematics for parent semantics",
"Regression -> Statistical Modelling for model specification and diagnostics",
"Regression -> Probability & Statistics for inferential foundations",
"Regression -> GLM Ontologies for logistic and count regression",
"Regression -> Bayesian Statistics for Bayesian regression",
"Regression -> Multivariate Statistics for multivariate responses",
"Regression -> Time Series for serially dependent regression",
"Regression -> Survival Analysis for hazard and time-to-event regression",
"Regression -> Optimisation for least-squares and penalised fitting",
"Regression -> Machine Learning for predictive regularised models",
"Regression -> Computational Statistics for numerical estimation"
]
}
UPDATE_MODEL {
MODE = "append-compatible semantic versioning"
MAJOR = "ontology-breaking conceptual change"
MINOR = "new compatible regression models, diagnostics or reasoning pathways"
PATCH = "clarification, metadata or formatting correction"
RULES = [
"Preserve response-versus-predictor distinction.",
"Preserve fitted-value-versus-residual distinction.",
"Preserve association-versus-causation distinction.",
"Preserve interpolation-versus-extrapolation distinction.",
"Preserve ordinary-versus-generalised regression distinction.",
"Preserve regularised-versus-unregularised estimation distinction.",
"Preserve prediction-versus-inference semantics.",
"Preserve machine-readable regression semantics."
]
}
OUTPUT {
CANONICAL_DEFINITION = "Regression models a response variable conditionally on one or more predictors using statistical structure and uncertainty."
LINEAR_SUMMARY = "Linear regression models the conditional mean as a linear combination of predictor variables."
COEFFICIENT_SUMMARY = "Regression coefficients represent conditional predictor effects on the model's response scale."
DIAGNOSTIC_SUMMARY = "Residuals, leverage, influence, multicollinearity and heteroscedasticity reveal potential model problems."
GLM_SUMMARY = "Logistic, Poisson and related models extend regression to non-Gaussian outcomes through link functions."
REGULARISATION_SUMMARY = "Ridge, lasso and elastic net shrink coefficients to control complexity and improve prediction in high-dimensional settings."
PREDICTION_SUMMARY = "Regression prediction should include uncertainty and distinguish interpolation from extrapolation."
VALIDATION_SUMMARY = "Regression models should be checked for specification, diagnostics, uncertainty, out-of-sample performance and practical relevance."
}
FLOW {
INPUT
-> detect_regression_context
-> identify_response_predictors_variable_types_dependence_structure_and_modelling_goal
-> classify_linear_polynomial_nonlinear_logistic_count_quantile_robust_or_regularised_regression
-> construct_design_matrix_transformations_and_interactions
-> choose_OLS_WLS_GLS_MLE_quantile_or_penalised_estimation
-> estimate_coefficients_standard_errors_and_intervals
-> analyse_residuals_heteroscedasticity_autocorrelation_multicollinearity_leverage_and_influence
-> compare_candidate_models_using_AIC_BIC_cross_validation_or_regularisation
-> compute_predictions_marginal_effects_and_prediction_intervals
-> assess_extrapolation_misspecification_robustness_and_practical_significance
-> validate_out_of_sample_performance_and_reproducibility
-> route_to_applied_statistical_mathematics_statistical_modelling_probability_statistics_GLM_Bayesian_statistics_multivariate_statistics_time_series_survival_analysis_optimisation_machine_learning_or_computational_statistics_ontology
-> recursively_expand_required_dependencies
-> verify_result
-> assign_confidence
-> produce_semantic_output
-> END
}
SEMANTIC_SUMMARY {
"The Regression Ontology defines mathematical predictor-response modelling. It supports response and predictor variables, design matrices, coefficients, intercepts and slopes, residuals and fitted values, simple and multiple linear regression, polynomial and nonlinear regression, generalised linear models, logistic, probit, Poisson and negative-binomial regression, quantile and robust regression, ordinary, weighted and generalised least squares, ridge, lasso and elastic-net regularisation, sums of squares, R-squared and adjusted R-squared, RMSE and MAE, standard errors, confidence and prediction intervals, interaction and polynomial terms, categorical predictors, transformations and scaling, collinearity and VIF, leverage, hat matrices, Cook's distance and influence, homoscedasticity, heteroscedasticity, error dependence and autocorrelation, model specification and misspecification, AIC, BIC and cross-validation, bias-variance trade-offs, feature selection, marginal effects, interpolation, extrapolation, calibration, statistical significance, practical significance and uncertainty quantification."
}
FLOW_HASH {
METHOD = "semantic-content-identity"
ID = "KIRETH-MATH-APPLIED-MATHEMATICS-REGRESSION-ONTOLOGY-V1"
}
}
END_FLOW
Download Code
Copy to Clipboard