Lawfare Group → Knowledge Institute → Lawfare Academy
← Business Analytics and Decision Modeling
Unit 1
From a decision to a model
Learning objectives
- Explain from a decision to a model in your own words.
- Apply the principle to the worked business case.
- Evaluate the answer and identify an assumption that could change it.
From a decision to a model
Define decision variables, objectives, constraints, uncertainty, and the action the analysis informs. Separate controllable choices from external conditions. Model detail is useful only when it improves the decision.
Worked example
A crew-allocation model distinguishes available staff from uncertain incoming demand.
Current on-site learning
Required teaching and complete optional models are supplied on LawfareGroup.com. Publisher and primary links are optional provenance or further reading. Florida is the contemporary state-law default; federal rules and explicitly comparative material are distinguished. Independent subject review and observed human learner testing remain pending.
Work through the reasoning
Draw a timeline, label the cash-flow claimant, and distinguish operating assumptions from financing. For this unit, connect the explanation of from a decision to a model to the worked example before answering the practice question.
Check the limits
Check units, signs, discounting periods, risk assumptions, and the opportunity cost of capital. If the source model and the practical example use different assumptions, state the difference rather than applying the formula or rule mechanically.
Apply it independently
Which is a decision variable? Write an answer before opening the model response. Show the calculation or explain the causal or logical steps. Change one material assumption and say whether your conclusion changes. This practice is optional; you can read every part of the course without submitting work.
Extended text lesson
Continue with Translate an operating decision into a model that can be checked for the full worked case, source readings and optional progressive practice.
Complete current conceptual preparation
From an operating decision to an explicit statistical loss
Put the decision clock before the dataset
The preserved Harbor model already distinguishes integer jobs from crew-hours, contribution from revenue and verification from validation. Keep its 80/150 contributions, two/three-hour durations and twelve-hour capacity exactly as stated. The new Cedar Dispatch investigation below is independent: its quantities are daily requests and reserved service slots, not Harbor jobs or a revision of that scheduling file.
A statistical analysis begins by defining the object counted. A request is not a customer, and six days are not six independently sampled markets. State the population, time window, observation unit, eligibility, outcome maturity and decision deadline. A reservation made at 07:00 cannot use completed requests recorded at 18:00 on that same day. Record when an input existed, not merely the date written into a later export. A field can be historically useful while being unavailable for the proposed live decision.
Define the controllable action separately from uncertain conditions. Management may reserve q service slots, while realized demand D is outside its direct control. A contribution coefficient, demand ceiling or probability is a parameter requiring evidence; typing it into a spreadsheet does not make it a choice or a verified fact. State the no-change baseline and who can authorize a revised capacity commitment. The learning cases require no actual customer, employee, financial account or learner information.
A useful input dictionary names the field, observational grain, units, valid range, timestamp, missing-value rule and accountable source. Preserve a genuine zero-demand day. Do not replace an unreported day with zero, duplicate a day's capacity on every request row or drop a high-demand day because it makes the model inconvenient. These changes alter the target distribution. An excluded day should have an explicit reason and remain distinguishable from a day with no activity.
The same observations support several different summaries
Cedar's six hypothetical daily request counts are 3,3,5,7,8,10. Their total is 36, so the arithmetic mean is six requests/day. Sorted middle observations are five and seven, so the median is also six. The mode is three because it occurs twice. Agreement between the mean and median here does not make either a justified service commitment. The most frequent individual count is not the mean, and the mean is not guaranteed on any one day.
Squared deviations from six total 40. If these are the entire finite six-day population of interest, variance is 40/6, approximately 6.6667 requests squared. If they are an independent representative sample used to estimate a larger population variance, the conventional sample variance is 40/(6−1)=8 and sample standard deviation is sqrt(8), approximately 2.8284 requests. The denominator follows the inferential question, not a desire for a smaller reported spread. In either interpretation, only six fictional days provide little evidence about unseen extremes or seasonal patterns.
Position statistics require a definition. Using interpolation at position 1+(n−1)p gives first quartile 3.5 and third quartile 7.75, so IQR is 4.25. A percentile produced by another convention can differ for a small dataset. A boxplot's rule can flag an unusual point; it cannot establish that the point is wrong. Investigate its source and operating context before changing it.
Display daily observations in time order to inspect drift, clusters and calendar effects. A frequency table describes how often values occurred; a histogram groups ranges and can conceal distinctions through bin selection. A bar chart is appropriate for category counts; a scatterplot requires paired observations and a meaningful predictor . Label units, denominator and missing days. A chart of total requests cannot independently explain whether late delivery was caused by a policy change.
An empirical distribution is a model, not a promise
For this exercise only, assign each of the six days equal probability of recurring. Then P(D=3)=2/6, while each of 5,7,8,10 has probability 1/6. The probabilities sum to one and expected demand is six. This empirical distribution deliberately omits demand values not in the file. That is a numerical teaching assumption, not evidence that eleven requests are impossible.
A continuous normal approximation can place probability on fractional or negative demand and may miss a discrete or asymmetric tail. A normal curve is a model with a specified mean and variance; it is not an automatic consequence of having a mean and standard deviation. A binomial model instead counts successes across a fixed number of independent trials with a common probability. Daily customer demand need not satisfy those conditions. Choose the mechanism and check its assumptions before selecting a named distribution.
Keep three uncertainties separate. Outcome variability concerns tomorrow's D under a specified distribution. Parameter uncertainty concerns how well that distribution was estimated from data. Structural uncertainty concerns omitted regimes, dependence or a changed service area. More simulation trials can improve numerical precision for the assumed distribution while leaving the latter two problems unresolved. A spreadsheet that always returns six has not eliminated any of them.
Derive the action from a loss, not from the mean alone
Suppose an unserved request carries stipulated loss 80 and an unused reserved slot costs 20. These are hypothetical incremental losses relative to a common operating baseline, not prices, employment rules or legal penalties. Define L(q, D)=80*max(D−q,0)+20*max(q−D,0). Assume slots and requests are indivisible, the stated range of capacity is actually available and there is no additional fixed commitment charge. An omitted fixed charge would require a separate comparison.
At q=5 the six shortages total ten requests and unused slots total four. Total loss is 80*10+20*4=880; mean loss is 146.6667. At q=7 shortages total four and unused slots total ten, giving 320+200=520, or 86.6667/day. At q=8 shortages total two and unused slots total fourteen, giving 160+280=440, or 73.3333/day. At q=10 shortage is zero but unused slots total twenty-four, giving 480, or 80/day. Eliminating shortages is not free; the complete stipulated loss prefers eight over ten.
For an integer capacity q, increasing capacity by one reduces loss by 80 when D>q and increases it by 20 when D≤q. The expected increment is 20*P(D≤q)−80*P(D>q)=100*F(q)−80. Add capacity while this is negative; stop when the cumulative probability reaches 80/(80+20)=0.8, subject to feasibility. Here F(7)=4/6 and F(8)=5/6, so eight is the smallest minimizing integer choice. Enumerating all relevant capacities independently verifies this marginal reasoning. A distribution with a flat interval at exactly the critical probability can have multiple minimizers; do not assume every case has a unique optimum.
The arithmetic mean six would yield total loss 700, or 116.6667/day. The mean minimizes expected squared error under an appropriate distribution, but Cedar's decision uses asymmetric absolute losses. A lower forecasting metric therefore need not give the lower operating cost. Capacity ceilings, nonlinear shortage consequences, shared staff, different lead times or a setup charge can change this simple quantile decision.
Worked changed conditions: the preferred commitment reverses
If unused slots instead cost 80 and shortages cost 20, the critical probability becomes 20/(20+80)=0.2. The smallest observed demand already has cumulative probability 2/6, so the isolated model now chooses three slots. Its shortages total eighteen and its loss is 20*18/6=60/day, with no unused slots. This is not a claim that rationing service is ethically or operationally acceptable. A hard minimum service obligation, if applicable, constrains the feasible set and cannot be traded away just because a cost coefficient favors it.
If only seven slots can actually be reserved under the original 80/20 losses, the unconstrained eight-slot recommendation is unavailable. Over feasible integer choices zero through seven, seven is best at 86.6667/day. State the capacity limitation and evaluate whether an authorized extra slot has value: it reduces modeled expected loss by 13.3333/day. An incremental slot price must be added exactly once and compared with that marginal improvement. None of these calculated values independently establishes a real supplier's availability.
Optional complete preparation studio
The following original Academy statistical-method studio is included in full because the earlier required scope assigned descriptive measures, position, distributions, visualization, statistical computing and regression preparation to an outside publisher. All required teaching and manual derivations are here. Its five-company descriptive set, three-state loss distribution and five-period regression are independent numerical fixtures; do not merge them with Cedar's six days, Harbor's job schedule or the reminder trial. Its finance-specific wording describes those independent applications. The optional R procedure is accompanied by manual expected results; no R installation or outside visit is required, and no R execution claim is made.
Make comparisons and predictions with a defined statistical model
The preserved comparison chapter already explains common-size classification, transparent adjustments and recurring-cost skepticism. Its original assigned statistical sequence also needs full preparation here. This studio supplies descriptive measures, probability, distributions, visualization, regression and prediction, with an optional base-R appendix. Every observation is fictional. A statistical fit does not independently verify financial statements, establish causality or authorize an actual investment or lending decision.
Define the observational unit and sample
Decide whether a row is a company-year, invoice, customer or monthly observation. Check currency, scale, period, perimeter, missing values and whether cases were selected because of their outcomes. A convenience sample of surviving listed firms cannot automatically represent failed firms or small private businesses. Repeated months from one firm can be dependent; a larger row count does not create an equally large number of independent businesses. Preserve exclusions and original records before any transformation.
For a separate five-company measure 2,4,4,6,9, mean is 5, median 4 and mode 4. The mean uses every value and responds strongly to extreme observations; the median is the middle ordered value. A weighted mean additionally needs justified nonnegative weights and a defined purpose. An asset-weighted margin answers a different question from the average firm's margin. Do not select the measure solely to obtain the preferred ranking.
Squared deviations from mean 5 sum 28. Population variance for this complete finite set is 28/5=5.6; sample variance as an estimator of an underlying variance uses 28/(5−1)=7, with sample standard deviation√7≈2.646. Name which calculation is used. A coefficient of variation divides standard deviation by mean and is difficult to interpret near zero or with negative values; it is not automatically meaningful for every financial ratio.
Position measures need a quantile convention. Under the linear interpolation used by R's default type 7, positions use 1+(n−1)p. For this ordered five-point set, the 25 th percentile is 4 and 75 th is 6, so IQR 2. The conventional 1.5 IQR fences are 1 and 9; a value exactly 9 is on the upper fence, not outside it. A different small-sample convention can give different quartiles. A flagged outlier requires investigation, not automatic deletion; it could be a valid unusual firm, an error or a different economic regime.
Choose a display that preserves the question
A histogram shows a distribution across bins, not chronological order; changing bins can hide or exaggerate patterns. A boxplot summarizes position/spread under its stated convention but conceals multimodality and sample size unless supplied. A time plot preserves order and can expose seasonality or structural change. A scatterplot shows paired relationships and can reveal nonlinearity, groups and unusual leverage points. State units and scale; a truncated axis or logarithmic transformation needs clear labeling. A log change is not identical to an absolute dollar change.
Before comparing company margins, show the sample and classification bridge. Before fitting sales on an activity driver, inspect the actual paired values and their timing. A neat line through annual totals can hide monthly liquidity failure. The preserved acquisition/perimeter example is an accounting-scope adjustment, not a random sample draw to which any statistical procedure automatically applies.
A probability distribution requires explicit outcomes and weights
For a separate scenario variable L representing a loss, assume outcomes 0,10,50 with probabilities .6,.3,.1. Weights sum 1. Expected loss is 8, but that is not the guaranteed realized loss or the most likely outcome; the mode is 0. E[L²]=280, so variance 280−8²=216 and standard deviation≈14.697. The large spread matters even when the mean appears affordable. Scenario probabilities need evidence or must be labeled illustrative. Expected loss cannot be substituted for the amount due in every possible cash state.
An independent-trials binomial model needs a fixed number of trials, a binary outcome, constant probability and independence. For five trials with p=.2, probability exactly two events is choose(5,2)×.2²×.8³=.2048; at least one is 1−.8⁵=.67232. Shared customer exposure or a common downturn can invalidate independence. The normal distribution is a continuous symmetric model described by mean and variance; standardization z=(x−mean)/standard deviation rescales it. Approximate 68/95/99.7 percent intervals within 1/2/3 standard deviations apply to the normal model, not every skewed financial loss distribution.
Uniform, skewed, heavy-tailed or discrete distributions have different tail properties. A normal approximation can be poor for a bounded ratio, rare loss or tiny sample. Sample mean uncertainty also differs from the distribution of individual outcomes. A high-confidence interval is not proof that every future observation stays inside it or that an assumed probability model is true. Keep model uncertainty and parameter uncertainty distinct.
Derive least squares rather than trust a chart label
For an original five-period file, activity x is 1,2,3,4,5 and outcome y is 3,4,7,8,8. Means are xbar 3, ybar 6. Sxx=Σ(x−3)²=10, Sxy=Σ(x−3)(y−6)=14 and Syy=Σ(y−6)²=22. With a nonconstant x and intercept, ordinary least squares minimizes squared residuals. Slope b=Sxy/Sxx=1.4 and intercept a=ybar−bxbar=1.8. Predicted values are 3.2,4.6,6,7.4,8.8; residuals actual-minus-fitted are −.2,−.6,1,.6,−.8.
Residual squares total 2.4. Explained squared variation 19.6 plus residual 2.4 equals total 22. With an intercept, R²=1−2.4/22=49/55≈.890909. Correlation r=Sxy/√(SxxSyy)=14/√220≈.94388; in this simple intercept regression, r²=R². Neither figure proves that activity caused the outcome. An omitted trend, changed mix or feedback can generate association. A regression without an intercept uses a different decomposition and should not borrow this interpretation silently.
A model y=a+bx+error requires a meaningful conditional relationship. For the conventional standard errors and intervals used next, assume a linear conditional mean, independent errors with mean zero and constant variance, and a normal-error model for exact small-sample t inference. Treat x as appropriately specified and the new observation as comparable. Serial correlation, heteroskedasticity, measurement error, selection or extrapolation can undermine the formula's interpretation. Multiple regression adds predictors but also requires enough independent information; exact collinearity prevents unique coefficients and additional predictors do not eliminate omitted-variable bias.
Distinguish an estimated mean from one future observation
There are n−2=3 residual degrees of freedom because two coefficients were estimated. Residual variance estimate s²=2.4/3=.8. Slope standard error is√(.8/10)≈.282843. At x 0=4, predicted mean is 7.4. Standard error for that mean is√[.8(1/5+(4−3)²/10)]=√.24≈.489898. For one new independent observation, add residual variation:√[.8(1+1/5+1/10)]=√1.04≈1.019804. The second is larger because an individual outcome varies around the unknown mean as well as the mean being estimated.
Using the conventional two-sided 95 percent t critical value 3.182446 with 3 degrees of freedom, the mean-response interval is 7.4±3.182446√.24, approximately 5.841 to 8.959. A single-observation prediction interval is 7.4±3.182446√1.04, approximately 4.155 to 10.645. These intervals are conditional on the model and sampling assumptions. A confidence statement describes the procedure's repeated-sampling coverage, not a guarantee about a fixed parameter or every future realization. Changing the regime can invalidate both. Predicting at x 20 far outside 1–5 is extrapolation; the numerical line's output 29.8 is not a validated forecast.
Do not confuse a confidence interval with a hypothesis-test conclusion. A slope test compares an estimate with a specified null using its uncertainty under assumptions; a small p-value is not the probability the business story is true or that the effect is economically important. Repeated searches across many models can create misleading apparent significance. Validate on appropriate held-out periods or independent data and disclose the selection process.
Optional base-R method appendix
R is a statistical language; an object holds a value, a vector holds ordered entries, and a data frame holds aligned columns. The following optional code enters the synthetic file directly, without any external data download. The complete manual derivation above remains the required learning; software installation is not required to understand the course. No R runtime was available for execution during this preparation, so this appendix is not claimed as a tested software run. Expected numerical values were independently checked from the displayed formulas.
```r d <- data.frame(x = 1:5, y = c(3, 4, 7, 8, 8)) stopifnot(nrow(d) == 5, all(complete.cases(d))) fit <- lm(y ~ x, data = d, na.action = na.fail) coef(fit) residuals(fit) sum(residuals(fit)^2) summary(fit)$r.squared predict(fit, newdata = data.frame(x = 4), interval = "confidence") predict(fit, newdata = data.frame(x = 4), interval = "prediction") quantile(c(2, 4, 4, 6, 9), probs = c(.25, .5, .75), type = 7) plot(d$x, d$y, xlab = "Activity", ylab = "Outcome") abline(fit) plot(fitted(fit), residuals(fit), xlab = "Fitted", ylab = "Residual") abline(h = 0) stopifnot(isTRUE(all.equal(unname(coef(fit)), c(1.8, 1.4)))) ```
The formula y~x includes an intercept by default. Naming the data frame avoids accidentally finding a different x in an interactive workspace. na.fail rejects missing rows rather than silently dropping them and changing the sample. coef reports 1.8/1.4; residuals and their squared total should match the manual file. predict's confidence and prediction options correspond to the two distinct intervals above. A chart or software report does not validate the economic assumptions; inspect residuals, chronology, range and data provenance.
Optional practice 1: a constant outcome shift
Add two to every y in the five-period file while x stays unchanged. Derive the new intercept, slope, residuals, R² and mean prediction at x 4 without fitting a new guessed curve.
Complete shifted-outcome model
Mean y rises from 6 to 8; centered differences and Sxy/Syy are unchanged. Slope stays 1.4, intercept becomes 3.8 and all fitted values rise 2. Residuals, SSE 2.4 and R²49/55 stay unchanged. Predicted mean at x 4 becomes 9.4. If only one observation changes instead, the centered sums need recomputation; a constant-shift shortcut would then be invalid.
Optional practice 2: a hidden common risk
The five binary loss events previously modeled independently with p=.2 instead are perfectly linked:all five occur together with probability .2 and none with probability .8. What happens to exactly-two and at-least-one probabilities? Does the expected number of events change?
Complete dependence model
Exactly two now has probability 0; at least one has probability .2 instead of .67232. Expected count remains 5×.2=1 by linearity of expectation, which does not require independence. The distribution and tail concentration change sharply despite the same marginal probabilities and expected count. Reusing the binomial variance or probabilities after changing dependence would be wrong.
Optional integrated statistical review: 20 points
Describe the sample, distribution and fit, then distinguish mean and single-observation uncertainty and the optional R procedure. Award four points each for data/definition/visualization, correct descriptive/probability arithmetic, least-squares derivation, conditional interval interpretation and validation/reproducibility limits.
Complete integrated model
The descriptive set has mean 5, median 4, sample variance 7 andtype 7 IQR 2. The separate loss distribution has expected 8 andvariance 216; the binomial example requires independence. Regression gives 1.8+1.4 x, SSE 2.4 and R²49/55. At x 4 mean 7.4 has a narrower confidence interval than a single new observation's prediction interval because the latter includes residual outcome variance. Optional R commands reproduce the specified calculation in principle but were not executed here; do not claim runtime verification or causal evidence. Preserve the financial classification/adjustment bridges before interpreting any statistical comparison.
Optional source summaries
R's official manuals document formula/data handling for lm and distinguish confidence from prediction intervals in predict.lm. The original dataset, manual derivation, probability cases and expected outputs above supply required teaching directly on site. Linear models; Prediction intervals, consulted October 29,2026. These are optional reference links; no external reading or R installation is required for the text lesson.
Optional practice: revise the action, not just the chart
Guided: a summary is not the operating policy
Give Cedar's mean, median, sample variance and action under the original loss. Model: mean 6, median 6, sample variance 8; reserve 8 under the stipulated empirical distribution and 80/20 loss. Mean demand is not the chosen capacity because the action loss is asymmetric. Changed fact: a report divides 40 by 6. Revised analysis: 6.6667 is the finite-population variance of these six days; calling it the conventional unbiased sample variance would be incorrect. The loss calculation still uses the specified six-state empirical distribution unless the modeling assumption itself changes.
Independent: a missing high-demand day
A clerk replaces the 10-request day with a missing value and then treats it as zero. Explain the error . Model: an unknown count is not zero demand; the mean, empirical probabilities and high-tail loss are all changed without evidence. Preserve the original record and investigate provenance. Changed fact: the original day was a confirmed closure with zero eligible requests. Revised analysis: the dataset must then be rebuilt around a defined target population; an open-day planning model may exclude closure days explicitly, whereas a calendar-day model includes valid zeros. Neither policy is justified by silently choosing the more favorable summary.
Transfer: capacity and a reversal
Compute the original expected loss at 7 and 8 slots and the value of a feasible extra slot. Model:520/6 and 440/6, an expected reduction 80/6=13.3333/day. Changed fact: surplus cost 80 and shortage cost 20. Revised model: the critical fractile is .2 and 3 slots minimize the isolated loss, with 60/day. Recheck hard service requirements and actual approval before proposing the action. A cost reversal is a new decision file, not a revision of Harbor's unrelated integer contribution model.
Integrated unit investigation and 20-point rubric
Prepare an auditable Cedar dispatch memo with a data contract, descriptive table, stated empirical distribution, action/loss derivation, feasible commitment and changed-fact response. Award four points each for observational grain/timing/missingness; reproducible summaries and distribution; explicit objective/constraints/assumptions; correct loss comparison and critical-fractile derivation; and limitations, ownership and revision plan.
Complete model: retain the six fictional open-day observations and state their equal empirical weights. Report mean/median 6, sample variance 8 and quartiles 3.5/7.75 under the stated convention. Show loss values 880/6, 520/6, 440/6 and 480/6 at capacities 5/7/8/10. The marginal increment 100 F(q)−80 selects 8 when feasible; a seven-slot ceiling instead selects 7. State that input evidence is insufficient to claim future empirical reliability, that independent days are not established and that hard service constraints could change the choice. Under reversed 20/80 costs the unconstrained choice becomes 3. Keep Cedar, Harbor and the included methods' fixtures distinct. No actual service commitments or learner records are affected by this optional exercise.
Apply the idea
A crew-allocation model distinguishes available staff from uncertain incoming demand.
Which is a decision variable? Explain your reasoning, then identify one changed fact that could alter the conclusion.
Read the worked reasoning
How crews are assigned. Decision variables are choices under the decision-maker's control. In an independent response, state the given facts, identify the governing relationship, work through the calculation or comparison, and distinguish the conclusion from assumptions that still need evidence.
Check understanding
Which is a decision variable?
- How crews are assigned
Feedback
Decision variables are choices under the decision-maker's control.
- Tomorrow's realized demand
Feedback
This alternative does not follow from the stated facts. Decision variables are choices under the decision-maker's control.
- Last week's weather
Feedback
This alternative overlooks the relevant mechanism. Decision variables are choices under the decision-maker's control.
Further reading
Required teaching and complete optional models are supplied on LawfareGroup.com. Publisher and primary links are optional provenance or further reading. Florida is the contemporary state-law default; federal rules and explicitly comparative material are distinguished. Independent subject review and observed human learner testing remain pending.
- Complete on-site teaching — From an operating decision to an explicit statistical loss
- Principles of Finance — 13.1 Measures of Center
- Principles of Finance — 13.2 Measures of Spread
- Principles of Finance — 13.3 Measures of Position
- Principles of Finance — 13.4 Statistical Distributions
- Principles of Finance — 13.5 Probability Distributions
- Principles of Finance — 13.6 Data Visualization and Graphical Displays
- Principles of Finance — 13.7 The R Statistical Analysis Tool
- Translate an operating decision into a model that can be checked