Back to trackLesson 4 of 25

Release Schedule 4: Correlation Changes the Answer

Uses Only Free-Tier SpiceGrinder

Problem statement

The last lesson’s model draws every task on its own, as if a bad Build had nothing to do with a bad Test. Real projects don’t work like that. A Build that overruns usually means the code is harder than expected, and harder code takes longer to test; a team that is behind rushes Build, and the rushed code needs more Test. Build and Test tend to overrun together.

Our estimates for each task are still right on their own, so nothing about the tasks’ individual distributions changes. What changes is how the tasks move together. The question: does that matter for when the release finishes, and for the chance of missing day 40?

The model

The Copula node from lesson 3 is where the dependence lives. A copula takes each task’s own distribution (here the four triangles) and ties the draws together: when Build comes out high, Test is more likely to come out high too, while each column keeps exactly its own distribution. The tie is set by a correlation matrix; in lesson 3 it was the identity matrix (no connection), and now one number in it changes. The 0.6 below links Build and Test; Design and Docs stay independent of everything.

<Copula name="Durations" correlation="1,0,0,0; 0,1,0.6,0; 0,0.6,1,0; 0,0,0,1">
  <input name="Design"/>
  <input name="Build"/>
  <input name="Test"/>
  <input name="Docs"/>
</Copula>

Everything else in the model is identical to lesson 3, the same tasks, the same Finish (with its dimension="6") and Late calculations and the same seed. The full file is samples/simulation/release-schedule-correlated.xml:

grind --count 1000000 release-schedule-correlated.xml

The first rows (leave the seed at 20261006 and you get exactly these values). Compare them with the first rows of lesson 3: Design, Build and Docs are the same numbers as before, and only Test has moved. The second row’s long Build (27.9 days) now brings a long Test with it, 10.4 days instead of 7.8, and the finish goes from day 41.9 to day 44.6:

8.161203733984781,13.736032741571153,4.239865135713899,4.723453179547734,26.13710161126983,0.0
6.2693411836817585,27.87695337314853,10.417965703163896,7.628323641167152,44.564260259994185,1.0
11.355910972099174,22.12498020037074,10.329600625498893,9.510534116377194,43.81049179796881,1.0
11.985232292300566,27.800697478800213,11.329352566135336,9.98166229678867,51.11528233723612,1.0

What changed and what didn’t

Three runs of a million trials each, all with seed 20261006: the independent model of lesson 3, the correlated one above, and a third that we come to below.

IndependentCorrelation 0.6Correlation 0.6, df="4"
Mean finish (days)34.3434.3434.33
Spread (standard deviation)5.125.995.98
P5034.033.833.7
P8038.839.739.4
P9041.342.742.6
Chance of finishing after day 400.1470.1870.179

The mean does not move at all: every task has the same distribution as before, so the average project takes just as long. What grows is the spread, from 5.1 to 6.0 days, and with it the bad end. The P90 is 1.4 days later and the chance of missing day 40 goes from 0.147 to 0.187, 27% more often. The median even dips a little, from 34.0 to 33.8.

Three histograms of the finish day, one-day bins, 1,000,000 trials each, for independent tasks, a Gaussian copula with correlation 0.6 and a Student-t copula with correlation 0.6; the correlated ones are lower in the middle and higher at both ends, with the independent outline dashed over them

Where correlation hurts, and where it helps

It sounds as if correlation should make every deadline riskier. It doesn’t. Here is the chance of finishing after day d for several d:

d3035404550
Independent0.7870.4260.1470.0240.001
Correlation 0.60.7390.4270.1870.0510.005
Correlation 0.6, df="4"0.7490.4220.1790.0500.008

(1,000,000 trials each, seed 20261006.) The curves cross near day 35, close to the middle of the distribution. Below it, correlation lowers the chance of being late: a team aiming at day 30 misses it 74% of the time with correlated tasks and 79% of the time with independent ones. Above it, correlation raises it: at day 40 by 0.039, at day 45 it doubles the chance (0.051 against 0.024), and at day 50 it is nearly five times as likely (0.005 against 0.001).

That is not a contradiction. Correlation keeps the mean and widens the spread. With independent tasks a long Build is often cancelled by a short Test, so the total stays near its average. With correlated tasks they tend to be long together or short together, so more projects finish early and more finish very late. A widened distribution with the same middle has more mass at both ends. Whether that is good or bad depends on where your deadline sits: if it is above the middle, as deadlines usually are, correlation is the bad news; if you are asking about an early date it is, oddly, the good news.

Two charts of the chance of finishing after day d for independent tasks, a Gaussian copula and a Student-t copula, one on a linear scale from day 25 to 45 and one on a logarithmic scale from day 35 to 55; the curves cross near day 35 and the correlated ones lie above the independent one after it

The companion page lets you pick the variant and the correlation (0, 0.3, 0.6 or 0.9), slide the deadline, and read the chance of missing it, the P80 and the spread from real runs at each setting.

A heavier tail: the Student-t copula

A Gaussian copula links Build and Test in the middle of their ranges, but its extremes are nearly independent: an extremely long Build is not much more likely to meet an extremely long Test than chance would give. Real projects can have the opposite pattern, in which a disaster in Build and a disaster in Test happen together. A Student-t copula has that property (called tail dependence), and the df parameter sets how strongly: a small df means heavy tails. Adding df="4" to the Copula node is the only change (samples/simulation/release-schedule-student-t.xml):

<Copula name="Durations" correlation="1,0,0,0; 0,1,0.6,0; 0,0.6,1,0; 0,0,0,1" df="4">

You might expect this to be the worse case. At day 40 it isn’t: the chance of being late is 0.179, a little lower than the Gaussian copula’s 0.187, and the P80 and P90 are a little earlier too. The reason is that at the same 0.6 the t copula ties Build and Test less tightly in the middle (below, the measured rank correlation is 0.567 against 0.584), and most of the finish-day distribution lives in the middle. The extra tail dependence only shows up where the tail does. At day 50 the t copula gives 0.0080 against the Gaussian’s 0.0046 and the independent model’s 0.0010: roughly one project in 125, one in 217 and one in 1,000. If the question is about an everyday deadline, the choice between these two copulas hardly matters; if it is about a catastrophe, it matters a lot, and no amount of simulating the wrong copula will tell you which is right. That has to come from the history of your own projects.

One trap to know about: with df set, a correlation of 0 does not mean independent. A Student-t copula gets its tail dependence from a random scale that all the columns share, so even uncorrelated tasks tend to be extreme together. In the companion page’s run with df="4" and a correlation of 0, the chance of being late at day 40 is 0.139, a little under the independent model’s 0.147, for the same reason as above: weight moves out of the middle and into the far tail. If you want tasks that are genuinely independent, leave df out and use a correlation of 0 (or drop the Copula).

Check: do the numbers match the math?

The correlation we set is 0.6, but that is the correlation of the underlying normal scores, not of the finished columns. For a Gaussian copula the rank (Spearman) correlation of the two columns is (6/π) × asin(r/2), which for r = 0.6 is (6/π) × asin(0.3) = 0.582. We can measure it: rank the Build and Test columns and correlate the ranks.

Rank correlation, 1,000,000 rowsBuild and TestThe other five pairs (largest)
Independent0.0020.002
Correlation 0.60.5840.002
Correlation 0.6, df="4"0.5670.001

The Gaussian copula’s 0.584 is within 0.002 of the theoretical 0.582, only Build and Test are tied together (every other pair is near zero, as the matrix says), and the independent model’s finish-day figures still match the numerical theory of lesson 3 (for example 0.787, 0.426, 0.147 and 0.024 at days 30, 35, 40 and 45, against theory 0.787, 0.426, 0.147 and 0.024).

What this gives you: the knowledge that how tasks move together can change the answer even when each task’s own distribution is untouched; a feel for the direction (correlation keeps the mean, widens the spread, and raises the risk for any deadline above the middle); and a clear picture of what the Student-t copula adds, which is the far tail and little else.

Every number in this lesson came from a million trials, and every one of them has some noise in it. The next lesson asks how many trials we really need, and how to know.