Fin Maverick
Foundations VocabularyAccounting & ReportingEconomics & MacroQuant Methods & ProgrammingBusiness & Company AnalysisCorporate Finance & ValuationBehavioural Finance
Banking & Market InfrastructureFixed Income & RatesDerivatives & Structured ProductsPublic EquitiesTransactions & DealsPortfolio ConstructionFunds & AMCs
Private Markets & AlternativesRisk, Treasury & ControlAI & Digital FinanceStochastic Calculus & PricingWealth & Personal FinanceIndian Markets & RegulationProfessional Practice
CalculatorComparison
Frameworks
Explore Bootcamps
Equity ResearchPortfolio ManagementMutual Fund MasteryFinancial LiteracyInvestment Banking Analyst
Private Equity AnalystHedge Funds AnalystBreaking Into VCBreaking Into QuantsAI For Finance
Financial Analyst ProgramRisk Management ProgramPrivate Wealth ManagementDebt Capital MarketsDerivatives Foundation
Explore Internships
Equity Research InternMutual Fund Intern
Portfolio Management InternFinancial Literacy Intern
Explore Micro Courses

Equity Research6

Writing an Investment ThesisBuilding a Discounted Cash FlowReading an Annual Report FastReading a Sector Before a CompanySpotting Quality of Earnings Red FlagsBuilding a Revenue Forecast From Drivers

Portfolio Management3

Rebalancing: When, Why and What It CostsStrategic and Tactical Asset AllocationMeasuring Risk in a Portfolio

Mutual Fund Mastery3

Comparing Funds Without Being FooledHow a NAV Is Struck and Which Day You GetReading a Fund Factsheet Properly

Derivatives Unlocked4

Hedging a Real ExposureThe Greeks, PracticallyFutures, the Basis and What Moves ItReading an Option Payoff

AI For Finance2

Retrieval and Grounding for FinanceDocument Extraction in Finance

Breaking Into Quants4

Backtesting a StrategyHypothesis TestingCleaning Financial DataRegression for Finance

Breaking Into VC3

Sizing a MarketReading a Term Sheet as a FounderHow a Venture Round Actually Works

Financial Analyst Program4

Common Size and Trend AnalysisReading a Cash Flow StatementRatio Analysis That Says SomethingBuilding a Working Capital Schedule

Risk Management Program2

Credit Exposure and How It Is ReducedValue at Risk and What It Hides

Investment Banking Analyst3

Precedent Transactions and Why They DifferReading a Term Sheet StructurallyBuilding a Comparable Companies Table

Private Wealth Management3

Tax Aware Portfolio DecisionsBuilding a Client Risk ProfileGoal Based Planning Arithmetic

Debt Capital Markets3

Analysing an Issuer's CreditDuration and What It Does Not Tell YouBond Pricing and Yield Mechanics

Private Equity Analyst2

Fund Waterfalls and CarryThe LBO in Structure

Hedge Funds Analyst2

Short Selling MechanicsLong Short Mechanics
Courses
Explore Career Roadmaps
Investment Banking AnalystEquity Research AnalystVC AnalystPrivate Equity AnalystHedge Funds Analyst
Quant AnalystAI For FinanceFinancial Analyst ProgramPrivate Wealth ManagementDebt Capital Markets
Risk Management ProgramDerivatives FoundationPortfolio ManagementMutual Fund Mastery
PartnershipsShowdown
Log inSign up
Quant Analyst · CoreTrack
1Quantitative Methods, Financial Data & Programming
iProbability
Probability in FinanceRandom VariableProbability DistributionsThe Normal DistributionNormal Distribution ProbabilityThe Lognormal DistributionRandomness vs Uncertainty
iiStatistics and Inference
Population and SampleMean, Median and ModePrecision and AccuracyVariable TypesVariance, Standard Deviation and…Dispersion MeasuresStatistical BiasEffect SizeHypothesis TestingThe Sampling DistributionSkewnessKurtosisCovarianceConfidence IntervalArithmetic Mean vs Geometric MeanStatistical Significance vs Economic…Confidence Interval vs Prediction IntervalHow to Summarise a…
iiiCorrelation and Regression
RegressionCorrelation and CausationOrdinary Least SquaresInteraction TermsRegression CoefficientsRegression vs ClassificationHow to Build a…Spurious CorrelationRegression, Correlation and FitResidualsMulticollinearityAutocorrelation and Partial Autocorrelation
ivTime Series
Time Series in FinanceSimple, Weighted and Exponential…Moving Average CalculatorPrice, Return and Level SeriesHow to Prepare Time-Series…LagFrequencySeasonalityTimestampsTrendStationarity and the Unit RootHeteroskedasticityLeadRolling WindowsDifferencing
vSimulation and Numerical Methods
SimulationMonte Carlo SimulationHow to Run a…Numerical MethodsIterationResampling and the BootstrapPseudorandom Numbers and the SeedConvergence and ToleranceNumerical Stability
viOptimisation
OptimisationLocal and Global OptimaConstraintsConvex OptimisationThe SolverLinear ProgrammingThe Objective FunctionConstraint ViolationThe Feasible SetLagrange MultipliersQuadratic Programming
viiModelling Practice
Linear, Logistic, Ridge and…Training, Validation and Test…The ModelModel ErrorDependent and Independent VariablesThe ROC Curve and AUCWhat a Model HoldsMSE, RMSE, MAE and MAPEPrecision and RecallCross Validation and RegularisationOverfitting and UnderfittingReturn Series MeasuresSimple, Compound and Log Return
viiiBacktesting and Research Integrity
BacktestingBacktest vs Live PerformanceHow to Document a…How to Prevent Backtest…Out-of-Sample TestingWalk-Forward AnalysisMultiple TestingP-HackingData Snooping
ixData Quality and Structure
Data QualityThe DatasetSelection and Survivorship BiasVersioned DatasetsData Structures in FinanceData CleaningMissing Data and Null ValuesStructured Data vs Unstructured DataMissing Data vs ZeroData Validation vs Data CleaningOutliersDuplicate Records
xProgramming for Finance
Data PipelinesAPIs for Financial DataAPI vs CSV FileDatabases in FinancePython for FinanceJoinsSQL for FinanceThe Analysis Workflow
xiQuantitative Research
Research DesignThe Data Generating ProcessReproducibilityPeer Review in Analytical WorkThe Research HypothesisRobustness and Sensitivity
2Stochastic Calculus & Derivative Pricing Theory
iProbability Foundations
The Probability SpaceRandom VectorsSigma-AlgebraExpectationSample Space and EventsDensity and Distribution FunctionsRisk-Neutral ProbabilityState Price Density vs…
iiStochastic Processes and Jumps
Properties of a Stochastic ProcessMartingaleBrownian Motion and Its PropertiesBrownian Motion vs Geometric…Stopping TimeThe Markov PropertyState VariablesTransition ProbabilityQuadratic VariationQuadratic Variation vs Ordinary…Submartingale and SupermartingaleMartingale RepresentationMarkov Process vs MartingaleOptional StoppingFiltrationJump ProcessesThe Poisson ProcessLevy ProcessesJump Diffusion
iiiIto Calculus
The Ito IntegralThe Ito Integral vs the Riemann IntegralInfinitesimals in Stochastic CalculusQuadratic CovariationIto's LemmaHow to Apply Ito's…The Infinitesimal GeneratorIto Calculus vs Ordinary Calculus
ivStochastic Differential Equations
Stochastic Differential EquationsStochastic Differential Equation vs…Drift and DiffusionStrong and Weak Solutions ComparedDiscretisationGeometric Brownian Motion
vPricing Theory and No-Arbitrage
No-ArbitrageGirsanov, Radon-Nikodym and Change…Physical and Risk-Neutral Measures…The Fundamental Theorems of…The Law of One PriceThe Pricing KernelDiscount Factors and Zero-Coupon PricesReplication vs HedgingComplete Market vs Incomplete MarketClearing Margin Architecture
viOption Pricing Theory
European and American OptionsMonte Carlo European OptionThe Black-Scholes PDEBlack Scholes and the GreeksThe Payoff FunctionThe Binomial ModelBinomial Option PricingDelta Hedging in TheoryBoundary, Initial and Terminal ConditionsThe Exercise BoundaryHow to Check Put-Call…
viiVolatility Models
Constant, Local and Stochastic…Vasicek Model vs CIR ModelThe Heston ModelThe SABR ModelThe Volatility ProcessImplied VolatilityVolatility Smile vs Skew vs Surface
viiiInterest Rate Models
Interest-Rate DerivativesMean ReversionThe Zero-Coupon BondThe Ornstein-Uhlenbeck ProcessThe Discount CurveZero RatesShort-Rate Model vs Market Model
ixNumerical Pricing
Closed Form and Numerical…Monte Carlo PricingEuler and Milstein Schemes ComparedTree MethodsFinite Difference MethodsNumerical Error and StabilityVariance Reduction
xCalibration and Model Risk
Model OverrideMarket Price and Model PriceCalibrationHow to Document a Pricing ModelThe Educational Illustration LabelMarket ConventionsModel Uncertainty and LimitationsBacktesting a Pricing ModelIdentifiabilityCalibrated ParametersThe Calibration Loss Function

Regression: Fitting a Line and What It Claims

Regression fits one straight line through paired observations so that the sum of the squared misses is as small as it can be. On ten invented months the Vasant unit moves 1.50 percentage points for every one point the Nakshatra unit moves, starting from 0.50. The line explains 75.59 per cent of the movement and leaves 24.41 per cent it cannot touch.

Two columns of numbers land on a desk, and there is really only one thing worth asking about them. When this one moves, what does that one do? Regression replies with a single straight line and the pair of numbers that fix where that line sits. Ten months are enough to build that line and read every figure it produces, and few enough to count on the fingers. A perfectly respectable looking number can still miss something those ten months contain, and what it misses is the harder half of the subject.

Two invented objects carry all of it. The Nakshatra unit and the Vasant unit are traded unitsAnything with a price on it that moves from one month to the next. Here the words label two invented objects, so nothing anybody could actually buy is meant.: things with a price attached that move about from one month to the next. Neither exists, neither stands in for anything that does, and both were built so the arithmetic would close without rounding. The record is ten months of each unit as a monthly changeHow much a price moved across one month, stated against where that price started. Ten of them, in a row, are the whole record in this guide.. A monthly change is the move across one month stated against where that month started. Set side by side, they form ten paired observationsTwo figures recorded about the same moment, so they can be set against each other. Break the pairing and every method here stops working.: the Nakshatra figure and the Vasant figure from the same month, tied together. Ten pairs is a very small sampleThe part of something actually observed, as against all of it. Ten months is a sample; every month there has ever been is not., and that smallness bounds everything that follows.

The ten months are printed in time orderThe order the months actually occurred in, oldest first. It is information in its own right, and sorting the rows destroys it for good. and they stay in it. The order is evidence, and sorting the rows destroys it. Keeping the order will look like fussiness for a long stretch. Almost every number below can be worked out with the rows shuffled into any arrangement at all. Then the order turns out to be carrying the one thing none of those numbers could report.

Where the figures came from, said once and up front. Nowhere. Ten pairs of numbers were chosen so that a line through them would land on figures a reader can check by hand, and every result below is arithmetic on those twenty numbers.

TEN PAIRED MONTHS IN, FOUR NUMBERS OUT, AND ONE QUESTION LEFT STANDINGEvery figure below is invented for teaching and recomputed in this guide.THE ONLY INPUTmonth / Nakshatra / Vasant11.003.0026.0018.503-4.002.50411.0017.0051.00-3.006-9.00-13.0076.006.5081.00-1.009-4.00-7.50101.00-3.00ONE LINE FITTED0.50 plus 1.50 timesthe Nakshatra moveboth figures exactACCOUNTED FOR75.59 per cent of the movementLEFT OVER24.41 per cent of the movementAND NOT VISIBLE IN EITHERFive of the nine consecutivemisses sit on the same side ofthe line. No number above cansee it, because every one ofthem throws the order away.
Ten pairs of numbers go in, one line and four summary figures come out, and one thing that matters is left standing outside all of them.

What does a fitted line actually claim?

The answer is much narrower than people assume. A fitted line makes exactly one claim, and it is this: across the record it was fitted on, for every one unit the input moved, the outcome moved by the slope, on average. Nine words of that sentence are doing work and the two that do the most are average and across the record.

Take an everyday version first. Ten shops sit in one shopping centre, and somebody fits a line through their opening hours and their takings. The line comes back saying that takings run about Rs 1,500/- higher for every extra hour a shop stays open. The sentence is a true description of those ten shops. The line does not say that the eleventh shop will earn Rs 1,500/- more if it stays open an hour longer, it does not say that staying open causes takings, and it says nothing about any shop in any other centre. A summary of ten shops is all it is, and the moment it is used for anything else a claim has been added that the arithmetic never made.

So the line here claims that across these ten months, on average, the Vasant unit moved 1.50 percentage pointsPercentages subtracted from one another rather than divided into one another. The distance between 4 and 6 on a percentage scale is two of them, whichever proportion of the first figure that happens to be. for every one point the Nakshatra unit moved, and it claims nothing else at all. Not that the eleventh month will behave that way. Not that the Nakshatra unit causes anything whatever. Causation is a separate question, covered under correlation and causation. Not that any particular one of the ten months behaved that way: two months below did and several did not. Average, across the record. The claim ends there.

Try it out

The fitted line says 1.50. Which of these sentences is the claim it is actually making?

Where do the two numbers in the line come from?

Before the two numbers, one word. Everything that follows is built from it. A residual is what the line missed by in a single month: the figure that actually turned up, less the figure the line said. Ten months means ten residuals. The word miss is used interchangeably with it below, and they mean exactly the same thing.

So which line? An infinity of straight lines can be drawn through a cloud of points, so a rule is needed to pick one, and the rule is this: take every residual, square it, add the ten squares up, and choose the line that makes that total as small as it can be. Squaring does two jobs at once. Squaring stops a miss of plus 5 cancelling a miss of minus 5, and it makes a large miss count for far more than a small one. Hold on to that second job. The second job comes back immediately below, and it is a choice somebody made.

On these ten months that rule gives a slope of exactly 1.5000 and a starting point of exactly 0.5000, and neither figure is a rounding of something untidy. The slope is the joint movement of the two columns, 450, divided by the movement of the input column on its own, 300, and 450 over 300 is 1.5 with nothing left over. The starting point is then the mean of the outcome less the slope times the mean of the input: 2.00 less 1.50 times 1.00 gives 0.50. Both numbers fell out of the same ten months. Nobody picked either of them, and nobody could have picked them differently without breaking the rule. How that arithmetic is derived, and the conditions it quietly rests on, are covered under ordinary least squares. Each of the two numbers makes its own claim, set out under regression coefficients.

TEN MONTHS, ONE LINE, AND EVERY MISS DRAWN AS A BARThe months stay in the order they happened. Nothing here is sorted.-15-10-505101520-9-6-3036912the Nakshatra monthly change, per centthe Vasant monthly change, per cent12345, 1067899.00, the longest miss8.000.000.00the fitted line: 0.50 plus 1.50 times the movemonths 5 and 10 land on the identical point
Every month is a dot, the line runs through them at 1.50 per one, and the bar from each dot down to the line is that month's miss, the longest of them 9.00 percentage points.

Look at the scatterA drawing that puts one dot per pair, the input reading along the foot and the outcome up the side, so the shape of the relationship is visible. above and notice two things the summary numbers will hide. Months 4 and 6 sit exactly on the line: the fit missed those two by nothing at all. Month 2 sits 9.00 points above it, the worst the line does anywhere. And a line drawn to minimise squared misses is not a line drawn to pass near everybody. The least squares line is drawn to avoid one catastrophic miss, and it will happily accept several ordinary ones in exchange.

THE COST OF MOVING THE SLOPE, DRAWN AS A BOWLSlope along the foot, total squared miss up the side, zoomed in near the floor.2202302402501.201.301.401.501.601.701.80218.00, and nothing beats it221.00221.00245.00one tenth either way costs exactly 3.00six tenths either way costs 27.00, nine times as muchthe slope, with the starting point refitted at every setting
The total squared miss as the slope is moved, showing that 1.50 really is the floor and that a tenth of a point either way costs exactly 3.00 more.
Try it out

Move the slope from 1.50 to 1.40, refitting the starting point so the comparison is fair. What happens to the total squared miss?

AI For Finance Bootcamp — Fin Maverick

What is a miss, and why do Mean Squared Error and Mean Absolute Error disagree?

There are ten misses. Somebody wants one number that says how badly the line does. There are three ways in wide use, they are computed from the identical ten residuals, and they give three different answers.

The first is the Mean Squared Error. Square every residual, add the squares, divide by ten. Here that is 218 over 10, or 21.80. Now look at the units. The trouble starts there. The residuals are in per cent, so their squares are in per cent squared, and 21.80 per cent squared cannot be laid against a monthly change of 6.50 per cent and compared. The two figures are not the same kind of thing. The number is useful for ranking one line against another and it is close to meaningless read on its own.

So the second measure fixes exactly that. The root mean squared error is the square root of the first: the square root of 21.80 is 4.6690, and that figure is back in per cent, the outcome’s own units. The square root allows a sentence a person understands: on a typical month this line is out by something in the region of 4.6690 per cent.

The third takes a different road entirely. The Mean Absolute Error throws away the direction of each miss, keeps its size, and averages those. The ten sizes are 1, 9, 8, 0, 5, 0, 3, 3, 2 and 5. They add to 36, so the mean absolute error is 3.60 per cent. The mean absolute error is also in the outcome’s own units, and it is a full point smaller than the root mean squared error computed from the identical residuals.

ONE SET OF MISSES, SCORED TWO WAYS, RANKED DIFFERENTLYBoth columns add to 100.00 per cent. Both bars are drawn to the identical scale.MONTHMISSSHARE OF THE MEAN SQUARED ERRORSHARE OF THE MEAN ABSOLUTE ERROR11.000.462.7829.0037.1625.0038.0029.3622.2240.000.000.005-5.0011.4713.8960.000.000.007-3.004.138.338-3.004.138.339-2.001.835.5610-5.0011.4713.89Month 2 misses by 9.00 and takes 37.16 per cent of one measure, 25.00 per cent of the other.Squaring is a choice about how heavily the worst month counts. It is not a neutral default.
Each month's share of the two error measures, drawn to one scale, showing that the two measures rank the same ten misses in a different order.

The two are not two roads to one answer. The two measures are two answers to two different questions, and the gap between them is the price of squaring. Watch it on month 2. Month 2 misses by 9.00, the worst month there is. Of the mean squared error, month 2 carries 37.16 per cent, better than a third of the whole thing. Of the mean absolute error it carries 25.00 per cent, exactly a quarter. Same month, same miss, same ten residuals. One measure holds it responsible for half again as much as the other does.

Squaring is therefore a decision about how much a bad month ought to count, and it is not a neutral default just because it is the common one. If one dreadful month is genuinely far worse for the analyst than three mediocre ones, squaring says what is meant. If three mediocre months hurt in proportion, it does not. And there is a counterweight worth stating so nobody overclaims from this: on these particular ten months the line that would minimise the average absolute miss is the very same line, 0.50 plus 1.50 times the input. The two measures disagree about which month deserves the blame and they happen to agree here about which line wins.

Try it out

Mean squared error here is 21.80 and root mean squared error is 4.6690. Why does anybody bother with the second one?

Try it out

Month 2 misses by 9.00. It carries 37.16 per cent of one error measure and 25.00 per cent of the other. Which way round, and what does the gap say?

What is R squared measuring, and against what?

R squared has a reputation for being a mysterious quality of the line, a kind of grade out of one. R squared is nothing of the sort. R squared is a comparison, and it is a comparison against the single laziest rule anybody could propose.

Here is that rule: ignore the Nakshatra unit entirely, ignore everything, and every month guess the mean of the Vasant unit, 2.00 per cent. The lazy rule misses too, and squaring its ten misses and adding them up gives 893. The 893 is the number to beat, and it is the only reason R squared means anything.

R SQUARED IS A RATIO BETWEEN TWO PILES OF SQUARED MISSESLeft, the laziest rule there is. Right, the fitted line. The same ten months.guess 2.00 per centevery single month893use the fitted lineon the same monthsthe same 893, cut once675 removed218 leftone less 218 over 893R squared 0.7559, which is 675 over 893 exactlyName the baseline, or the number means nothing at all.
The baseline of guessing the mean misses by 893 in squared terms and the fitted line misses by 218, and the gap between them is exactly what R squared reports.

R squared is one less the fitted total divided by the baseline total, so here it is one less 218 over 893, or 0.7559, and every part of that sentence has to survive for the number to mean anything. Read it as a ratio and it becomes plain: 675 of the 893 squared units of miss were removed by using the line instead of the lazy rule, and 675 over 893 is 0.7559 to four places. So 75.59 per cent of the movement in the Vasant unit is accounted for by the Nakshatra unit across these ten months.

Which is why an R squared quoted with no baseline named is close to unreadable. The question is always: better than what? Here the answer is better than guessing 2.00 per cent every month, and that is a low bar somebody chose. A different baseline gives a different number from the identical line.

Try it out

R squared here is 0.7559. What exactly is the fitted line being measured against to produce that figure?

Try it out

Starting at the fitted slope of 1.50 and sliding away from it, does the total squared miss rise slowly at first or quickly at first?

Play with it

Moving the slope makes every miss above grow.

One control, and it moves the slope from 1.00 to 2.00 in steps of 0.01. The ten months never change and they stay in the order they happened. The starting point is refitted at every setting, so no setting is being handicapped: at a slope of b the starting point is 2.00 less b. The line tilts, every miss bar re-scales, the marker slides along the cost curve underneath, and a plain sentence underneath rewrites itself around whatever the panel is currently showing. Leave the control at 1.50 and every figure on it matches the worked example above, to the last decimal.

slope 1.00slope 1.50slope 2.00
MOVE THE SLOPE AND WATCH EVERY MISS GROWThe starting point is refitted at each setting, so the comparison stays fair.-15-10-505101520-9-6-3036912the Nakshatra monthly change, per centthe Vasant monthly change, per cent  THE COST OF EVERY SETTING THE SLIDER CAN REACH218.00, the floor1.001.251.501.752.00the slope setting
Slope
1.5000
Start point
0.5000
Squared miss
218.00
Above floor
0.00
R squared
0.7559
Educational illustration. The ten months are fixed and held in the order they happened, only the slope moves, and the starting point is refitted to it.

Two things are worth noticing about the slider. First, the bottom of that curve is flat, so the first tenth of a point of movement costs 3.00 and the sixth costs more than eight times as much: the penalty grows with the square of the distance strayed, and that is squaring showing up again in a new place. Second, no setting anywhere on the slider ever gets below 218.00. The floor is not a property of the slider. A floor at 218.00 is what being the least squares line means.

Risk Management Program Bootcamp — Fin Maverick Reading an Option Payoff — free micro-course from Fin Maverick

What is the part R squared leaves out, and why is it called Idiosyncratic Risk?

One finance word first, defined before it is used. The word is used loosely everywhere, and the loose meaning misleads here. Risk, in this guide, means how much something moves about. Nothing more. Not danger, not the chance of losing money, not anything anybody should feel. Just movement, measured as spreadHow widely a set of figures is scattered about its own average. Built and measured separately; used here without rebuilding it..

So the Vasant unit moves about. Across these ten months that movement adds up to 893 in squared terms. The Nakshatra unit accounts for 675 of it. The remaining 218 is 24.41 per cent of the whole, and it is the Idiosyncratic Risk: the part of the Vasant unit’s movement that is particular to the Vasant unit and about which the Nakshatra unit has nothing to say.

THE VASANT UNIT MOVES ABOUT. THIS IS WHO GETS THE CREDIT.One bar, all of the movement across the ten months, cut in one place.75.59 per centmoves with the Nakshatra unit24.41 per centthe Vasant unit alonethe cutWHAT THE LEFT BLOCK ISThe part of the movement theNakshatra unit accounts for:675 of the 893 squared units.WHAT THE RIGHT BLOCK IS NOTNot a mistake anybody made.It is all that one input wasnever going to carry: 218 units.In the outcome's own units that leftover is a typical monthly miss of 4.6690 per cent.On an invented holding of Rs 2,00,000/- that is about Rs 9,338/- in a month. Illustration only.
All of the Vasant unit's movement drawn as one bar and cut once, with three quarters accounted for by the Nakshatra unit and a quarter belonging to the Vasant unit alone.

The leftover quarter is not error in the sense of a mistake, and reading it as one is the single commonest misuse of the word residual. Nobody made a slip. The line is the best line there is. The 24.41 per cent is simply everything one input was never going to be able to carry. The leftover would still be there if the arithmetic were done perfectly on a machine that never rounds, and that is roughly what happened here.

The household version makes it concrete. A household runs on one salary, and its monthly spending tracks that salary closely. Fit a line and most of the spending is accounted for. The rest is a wedding among relatives, a hospital week, a school fee that falls in one month and not the next. None of that is a failure of the salary to explain spending. The extra spending was never about the salary in the first place. The idiosyncratic part is exactly that, and here it is nearly a quarter of everything.

Say it in money and it stops being abstract. On an invented holdingAn amount of money a person has placed in one thing. Used here only to turn a percentage into rupees somebody can picture. of Rs 2,00,000/-, a typical monthly miss of 4.6690 per cent is about Rs 9,338/-, the average absolute miss of 3.60 per cent is Rs 7,200/-, and the worst single month, that 9.00 per cent in month 2, is Rs 18,000/-. A residual is worth that much in rupees only against the amount it is set beside, so the same 4.6690 per cent on half the holding is half the money.

Try it out

24.41 per cent of the Vasant unit's movement is left over after the fit. Is that an error somebody made?

Measuring Risk in a Portfolio teaches you to compute and interpret the standard portfolio risk measures and say what each one misses.

Why can plain R squared never fall, and what does Adjusted R-Squared do about it?

Here is a fact about plain R squared that sounds like a technicality and is actually the whole problem. Whatever that input is, the worst a fit can do with a useless one is give it a weight of zero and carry on exactly as before, so adding an input can never lower plain R squared. A rise in R squared after adding something is therefore not evidence that the something helped. A rise was the only thing that could have happened.

Rather than assert that, watch it. A third invented object, the Chandana unit, is the Nakshatra unit nudged by five hundredths of a percentage point in eight of the ten months and left untouched in the other two. The Chandana unit carries almost no information that the Nakshatra unit was not already carrying. Add it as a second input and refit.

R-Squared vs Adjusted R-Squared, watched on one added input

Plain R squared goes from 0.7559 to 0.7560. The rise is one unit in the fourth decimal place, and the fit had no choice about it. Adjusted R squared goes from 0.7254 to 0.6863. The adjusted figure fell by 0.0391, and that fall is 391 times the size of the rise. The difference between the two measures is that the adjusted one charges the fit for every input it consumes: it divides the leftover by the number of observations less the number of things fitted, so an input that brings nothing costs more than it brings and the figure drops.

ADD AN INPUT THAT SAYS ALMOST NOTHING NEW, AND WATCH TWO DIALS PARTThe added input is the first one nudged by five hundredths of a point in eight months.THE INPUT ALREADY THERE1.006.00-4.0011.001.00-9.006.001.00-4.001.00THE ONE BEING ADDED1.005.95-3.9511.050.95-9.005.951.05-4.051.05PLAIN R SQUARED0.75590.7560It rose. It was never able to fall,whatever had been added, becausethe fit can always ignore an input.A rise here proves nothing.ADJUSTED R SQUARED0.72540.6863It fell, and hard. It charges thefit for every input it uses, so auseless one costs more than itbrings. That is the honest signal.THE TWO MOVES, ON ONE SCALEthe rise: 0.0001one pixel wide here, and drawn no widerthe fall: 0.0391391 times the riseThe rise and the fall came out of the identical arithmetic on the identical eleven columns.
Adding an input that nearly duplicates the one already there raises plain R squared to 0.7560 and drops adjusted R squared to 0.6863, and the two moves drawn on one scale are not comparable in size.

So the rise proved nothing at all and the fall is the honest signal, and any report that quotes the first without the second has quoted the one number that could not have gone the other way. A small gap between the two measures looks like this. On one input and ten months the gap here is 0.0305, the distance from 0.7559 down to 0.7254. The gap of 0.0305 is a property of this particular fit on this particular record and of nothing else whatsoever. A gap is not a rate, not a constant, and not related to any other quantity that happens to look like it. With a second input the charge for inputs goes up, so the gap widens to 0.0697.

One boundary, at exactly the place where the subject sprawls. Methods that penalise a fit for the number of inputs it uses, and methods that judge a fit by how it does on data it never saw, are a separate body of work with its own assumptions, and they are covered separately in the notes on building models. Adjusted R squared is not a stand in for one.

Try it out

A second input is added to a fit. Plain R squared rises and adjusted R squared falls. Which figure should be reported, and why could the other one not have fallen?

What does a respectable looking number still not show?

Every figure so far has one thing in common that nobody points out. Not one of them can see the order of the months. The slope, the starting point, the total squared miss, all three error measures, R squared, adjusted R squared: shuffled into any arrangement at all, the ten rows return every one of those numbers identical. Every one of those figures is built by adding things up, and addition does not care what came first.

Now put the misses back in the order they happened and look at them. Month 1 is above the line, month 2 is above it, month 3 is above it. Months 7, 8, 9 and 10 are all below it. Of the nine consecutive pairs in the record, five sit on the same side of the line as the pair before them.

THE SAME TEN MISSES, ARRANGED TWO WAYSNothing is added or removed between the two rows. Only the arrangement changes.ARRANGED BY SIZE, SMALLEST FIRST-5-5-3-3-200189A tidy staircase, and no month numbers survive it. However long it is read, nothing is in it.ARRANGED IN THE ORDER THE MONTHS HAPPENED11928304-5506-37-38-29-510Three above the line together, then four below it together. Five of the nine consecutive pairs match.monthmonths 1 to 3, all above the linemonths 7 to 10, all below the line
The same ten misses arranged by size, where nothing is visible, and then in the order the months happened, where three above the line and four below it are visible immediately.

The good looking number and the evidence against it come out of one dataset, and no summary figure above can hold both. Every one of them throws the order away. An R squared of 0.7559 reads as a solid fit. The same ten months, read as a sequence rather than a heap, say the misses are not landing independently of one another. When a line is missing in runs like that, the misses are carrying structure the line did not capture, and the usual figures quoted alongside the fit are computed as though that could not be happening.

Settling that needs a measure built for the purpose. The measure, and what it says about these exact ten misses, is covered separately under autocorrelation and partial autocorrelation. Both facts hold at once: 0.7559, and five runs out of nine.

Try it out

The fit accounts for 75.59 per cent of the movement, and five of the nine consecutive misses sit on the same side of the line. Are those two facts in conflict?

What should be asked of any fitted line?

Fitted lines arrive in other people’s work constantly. A lender fits one through a borrower’s monthly receipts and something the lender can observe, so a shortfall in one month can be read against what was expected rather than against nothing. An analyst fits one to see how much of a thing’s movement is shared with everything else and how much is its own. A household planner fits one through a year of electricity bills and the temperature, so an unusual bill can be told apart from a hot month. In every case the person reading the output is not the person who fitted it, and six questions separate a reader who understands what arrived from one who does not.

SIX QUESTIONS, AND WHAT THESE TEN MONTHS ANSWER TO EACHThese are the questions to ask, in this order, of any fitted line.1What are the units of the slope?Percentage points of the Vasant unit for one point of the Nakshatra unit. 1.50.2How many observations stand behind it?Ten months. Ten, and the whole of this guide rests on them.3What baseline is the fit measured against?Guessing the mean of 2.00 per cent every month, which misses by 893.4How big is what is left, in the outcome's own units?A typical monthly miss of 4.6690 per cent, and a worst month of 9.00 per cent.5How many inputs, and what did the honest measure do?One here. Add a second and adjusted R squared falls from 0.7254 to 0.6863.6What do the misses look like in the order they happened?Three above the line together, then four below. Almost nobody asks this one.
Six questions to put to any fitted line, each with the answer these ten invented months give it, and the sixth is the one that changes the reading.

Ask the units of the slope first, and say the sentence out loud with them in it. Percentage points of the Vasant unit for one point of the Nakshatra unit: that sounds like something. Rupees per hour, defaults per point of interest rate, units per degree. If the sentence does not survive being said out loud, the number is not being read, it is being quoted. Then ask how many observations. Ten, here, and ten is very few: a slope built on ten months would move a great deal if an eleventh arrived. Then ask the baseline, then the size of what is left over stated in units a person cares about, then how many inputs went in and what the adjusted figure did when the last one was added.

Then ask the sixth question, the one almost nobody asks: what do the misses look like in the order they happened? The sixth is the only one of the six that no summary number answers, it takes one drawing to check, and on these ten months it is the one with the uncomfortable answer.

Three quarters, reported as though the other quarter were rounding

A note goes round. The Nakshatra unit explains 75.59 per cent of what the Vasant unit does, R squared 0.7559. Every word of that is arithmetically correct, computed properly from the right ten months, and the sentence is still wrong in use, for two reasons already shown above.

The first is that the quarter it leaves out is not a rounding. The leftover is 24.41 per cent of the movement. On an invented Rs 2,00,000/- that comes to a typical monthly miss of about Rs 9,338/- and a worst month of Rs 18,000/-. Nobody reading the phrase three quarters explained pictures a month that far out, and the phrase gave them no way to. The second is that the figure was produced by throwing away the order of the months, and the order is precisely where the doubt about it lives.

Then comes the expensive part. The same reader adds a second input, watches R squared go from 0.7559 to 0.7560, and reports an improvement. The honest measure went from 0.7254 to 0.6863, a clear deterioration, and it was sitting in the same output. The cost is not a wrong number, it is a decision taken on a number that could only ever have moved one way.

The correction works better as a habit than as a caution. The leftover share in the outcome’s own units belongs beside every R squared written down, so 0.7559 always travels with 4.6690 per cent. The adjusted figure is the one to quote whenever an input was added, never the plain one. And the misses drawn in order once, a job of a minute, complete the check.

One line fitted to one input answers less than a reader will want. Whether the Nakshatra unit causes anything that happens to the Vasant unit is covered separately under correlation and causation, and how a pattern with no mechanism behind it can produce an even better fit than a real one is covered separately under spurious correlation. The arithmetic that finds the line, and the conditions that arithmetic rests on, are covered separately under ordinary least squares. Each of the two numbers makes its own separate claim, set out under regression coefficients. Putting the misses back into the order they happened settles the doubt raised above, and that work is covered separately under autocorrelation and partial autocorrelation. Methods that penalise a fit for its inputs or judge it on data it never saw are covered separately in the notes on building models.

Breaking Into Quants Bootcamp — Fin Maverick

Can every number be checked from one table?

Yes, and the table below is printed so that it can be done. Everything above came out of the twenty figures in the first three columns below. The rest of the table is worked from them, and the two totals rows are the arithmetic closing: the misses add to exactly zero, as they must for any least squares line with a starting point in it, and their squares add to 218.

The whole of the evidence, in the order the months happened. Every later figure is worked out from these columns and from nothing else.
MonthNakshatra moveVasant moveWhat the line saidThe missMiss squaredSize of the miss
11.003.002.001.001.001.00
26.0018.509.509.0081.009.00
3minus 4.002.50minus 5.508.0064.008.00
411.0017.0017.000.000.000.00
51.00minus 3.002.00minus 5.0025.005.00
6minus 9.00minus 13.00minus 13.000.000.000.00
76.006.509.50minus 3.009.003.00
81.00minus 1.002.00minus 3.009.003.00
9minus 4.00minus 7.50minus 5.50minus 2.004.002.00
101.00minus 3.002.00minus 5.0025.005.00
Mean or total1.002.002.000.00218.0036.00

And the summary figures, each with the single line of arithmetic that produced it, so nothing has to be taken on trust.

Every fit figure quoted above, and the one line of arithmetic behind each.
FigureValueWorked from
Slope1.5000450 over 300, and it divides exactly
Starting point0.50002.00 less 1.50 times 1.00
Total squared miss218.00The sixth column of the table above, added up
Total squared miss of the baseline893.00Guessing 2.00 per cent every month instead
R squared0.7559One less 218 over 893
Adjusted R squared0.7254One less 218 over 8, divided by 893 over 9
Mean squared error21.80218 divided by 10, in per cent squared
Root mean squared error4.6690The square root of 21.80, back in per cent
Mean absolute error3.600036 divided by 10, in per cent
Share accounted for75.59 per cent675 of the 893
Share left over24.41 per cent218 of the 893

What was consulted here, and what was not?

Nothing was consulted. Every month, every unit and every rupee amount in this guide was built so that the arithmetic would close exactly, and then recomputed from the ten paired figures in the table above. Building them that way is why the slope lands on 1.5000 rather than on 1.4987. Because no maintained record was used, there is no as of date, and there is no regulator, exchange or market whose published rules would apply. Fitting a line is arithmetic, and arithmetic answers to no jurisdiction.

Where each figure came from
FigureWhere it came fromCan it be checked independently?
The ten paired monthly changesBuilt for this guide so that every later figure closes without roundingNo. Both columns were built, not measured
Slope 1.5000 and starting point 0.5000Worked out above as 450 over 300, and as 2.00 less 1.50 times 1.00Yes, from the table above
R squared 0.7559 and adjusted R squared 0.7254Worked out above from 218, 893 and the count of monthsYes, from the table above
The Rs 2,00,000/- amountAn amount chosen only to turn a percentage into rupees a reader can pictureNo. The amount was chosen, not observed
Least squares as a methodOlder than any single text that could safely be named for itNot applicable

The Nakshatra unit, the Vasant unit and the Chandana unit are invented.
Educational material. Not advice on any investment, tax, budget or market position.

Covered in this topic

Subtopics

Adjusted R-SquaredMean Squared ErrorMean Absolute ErrorIdiosyncratic RiskR-Squared vs Adjusted R-Squared
← PreviousNext →
Fin Maverick Micro CoursesExplore Micro Courses
Fin Maverick BootcampsExplore Bootcamps
Fin Maverick

Finance education that ends in a job, not a certificate that gathers dust. Built for young India.

LEARN
CalculatorsFrameworksComparisonsCareersShowdown
RESOURCES
All CoursesMicro CoursesBootcampsInternships
COMPANY
AboutJob openingPartnership
LEGAL
Privacy PolicyTerms & ConditionsContent LicenseReturn & Refund Policy
© 2026 FIN MAVERICK / BUILT FOR INDIA.DO FINANCE, DO NOT JUST READ ABOUT IT.