IMLInvestment
Model Library

Validation examples

Choosing a reference model: match the calculation to the question

Select an inspectable mathematical baseline by output, assumptions and input burden, not by treating a synthetic example as a performance ranking.

Name the question before the model

A reference model is useful when its output answers a precisely stated question. An allocation rule returns weights, a portfolio variance calculation evaluates given weights, and a regression estimates a conditional relationship under its specified setup. None automatically supplies the others. Start by writing the quantity required, its units and the decision it will inform. If the question is how a fixed portfolio's risk changes under a supplied covariance matrix, a variance calculator is more direct than an optimizer. Choosing a more elaborate model can add assumptions without adding relevant information. Mathematical sophistication is not itself a selection criterion.

Compare the input burden

Equal weighting needs an eligible asset set but no volatility estimate. Inverse-volatility weighting needs positive, comparable volatility inputs and an explicit normalization. A minimum-variance allocation also depends on covariance and constraints. These differences determine which uncertainties enter the output. Adding estimated correlations may improve the question's representation while increasing estimation sensitivity. The scikit-learn covariance guide explains how sample properties and regularization affect covariance estimation; a regularized matrix is a different estimator, not an automatic upgrade. Before selecting a reference, ask whether its necessary inputs exist with compatible units, observation windows and asset identities, and whether their uncertainty can be examined.

Read a synthetic comparison as arithmetic

The table uses two hypothetical assets with annual volatilities of 10% and 20%, zero correlation, and long-only weights summing to one. Equal weights produce variance 0.0125. Inverse-volatility weights are two thirds and one third, giving variance approximately 0.008888889. Minimum-variance weights are 0.8 and 0.2, giving variance 0.008. These values follow from the same supplied covariance assumptions and do not represent estimated returns or observed investment outcomes. The minimum-variance result is smallest because that is its optimization objective in this example. It does not prove that the rule will remain preferable when inputs are estimated or conditions change.

Separate verification from empirical validation

An independent calculation can verify that each table row follows its formula. Boundary tests can check equal volatilities, a zero-risk input that must be rejected, or a perfectly correlated case with a documented solution policy. Such checks test software and mathematical conventions, not investment effectiveness. Empirical validation asks a different question using observations, a stated sample design and relevant uncertainty. Do not present a larger number of synthetic fixtures as a larger independent market sample. A model card should identify which evidence exists and leave absent evidence absent, rather than promoting an arithmetic demonstration into a claim about future performance.

Keep model selection outside the test sample

If a later research task compares models on observed data, reserve evaluation information before fitting transformations or selecting settings. scikit-learn's common-pitfalls documentation explains why fitting preprocessing on the full dataset leaks information into evaluation. Its cross-validation guide also distinguishes time-ordered evaluation from random splits. A chronological split is not sufficient by itself: feature availability and any overlapping target intervals still need scrutiny. Repeatedly choosing among variants after seeing the same test results makes that sample part of selection. Record the candidate set, selection criterion and evaluation boundary before inspecting outcomes, rather than describing the eventual winner as a predeclared reference.

Include implementation assumptions in the comparison

Two allocation rules can be compared fairly only when surrounding assumptions are visible. The eligible universe, rebalance timing, treatment of cash, missing-data policy and transaction-cost units can matter as much as the weight formula. Equal weighting does not mean zero trading, and a lower calculated variance does not guarantee lower cost. Use the same pretrade holdings when comparing turnover, then retain any deliberate differences as separate assumptions. A compact reference comparison should show which quantities are held fixed and which are allowed to change. Otherwise an apparent model difference may actually come from an inconsistent preparation or accounting convention.

Write a bounded selection record

Conclude with a short record naming the selected reference, its version, the question it answers, required inputs and reasons alternatives were excluded. State whether the choice is for teaching, implementation verification or a separately designed empirical study. Identify conditions that would invalidate the selection, such as unavailable covariance estimates or a requirement for constraints the reference does not implement. Preserve an alternative simple baseline where it helps reveal sensitivity. The result is not a universal ranking or a recommendation to allocate capital. It is a traceable choice of calculation whose assumptions can be inspected before its outputs are used elsewhere.

Independently checked hypothetical inputs: annual volatilities 0.10 and 0.20, correlation zero, no costs and weights summing to one. Variance is 0.01 times weight A squared plus 0.04 times weight B squared. This is not a performance ranking.
Synthetic allocation ruleWeight AWeight BAnnual variance in decimal-return-squared units
Equal weight0.50.50.0125
Inverse volatility2/31/30.008888889
Two-asset minimum variance0.80.20.008

Primary references

These sources support methods and conventions. The example values are original constructions, not observations extracted from these documents.

Related investigations

Allocation references

Turnover definitions: count the trades before comparing the number

Distinguish gross trading, half-turnover, cash movements and drift using a fully reconciled synthetic rebalance.

Allocation references

Transaction cost units: from a quoted rate to portfolio drag

Reconcile basis points, trade notional, ticket fees and portfolio-level drag without confusing a cost assumption with observed execution.

Implementation contracts

The model card input contract: make valid inputs unambiguous

Specify shape, units, identity, numerical domains and rejection behavior before treating a mathematical example as reusable code.

Implementation contracts

Missing data and alignment: decide what was actually observable

Keep missingness, stale observations, asynchronous timestamps and covariance sample selection visible in a calculation's input history.