Unit 13, lesson 97

Point in time financial data and sampling

How timestamps and an information set fix what a past decision could know, how point-in-time data handle data revisions, and how survivorship bias and corporate action adjustment change measured returns.

  • Video 97
  • Data, prediction and learning

A backtest of a signal built from quarterly earnings and daily prices looks profitable when it runs on the database as it stands today. Was each number in that database actually published by the date on which the backtest used it, does the sample still contain the companies that failed along the way, and do the returns follow a holder’s wealth through splits and dividends? This lesson makes the timing precise with timestamps and an information set, uses point-in-time records and as-of queries to handle data revisions, and works through small constructed examples of survivorship bias and corporate action adjustment.

Key terms

Timestamp

Definition A timestamp records when something happened, and one observation in a financial dataset usually carries several. The economic date, or reference period, says which period the number describes. The availability time aja_j of observation jj is the first time a user of the data could have read its value, including any publication and processing delay. A revision time is the availability time of a later replacement value. A trade in a backtest adds the decision time tt and the execution time ee, and it is consistent with the timestamps only if

aj≤t≤ea_j \le t \le e

for every observation jj that the decision uses, and if the fill price could actually have been traded at time ee. A sampling rule says when observations are taken. Clock-time sampling takes them at fixed calendar intervals, trade-time sampling at each trade and event-time sampling after each event of a specified kind.

In plain words Writing the quarter-end date beside a quarterly figure does not make the figure known at the quarter end. A decision may use a value only after it has arrived, and the order it produces can be filled only afterward, at a price someone could have traded at. The sampling rule decides which moments the data represent. A run of identical quotes may only mean that the quote is stale, not that the value was certain over that time.

Example Suppose the closing price of a day is set by a closing auction. An order filled at that close must be entered before the closing price exists, so a signal computed from the close cannot be the basis of an order filled at the same close. Putting both on the same calendar date hides the wrong order of events. In a constructed backtest that trades only at auctions, the earliest consistent fill is the next day’s open. For sampling, take a constructed hour with 5050 trades in the first ten minutes and 1010 trades in the remaining fifty. Sampling once a minute gives 6060 observations, of which 1010 fall in the busy period, while sampling at every trade gives 6060 observations, of which 5050 fall in it.

Information set

Definition Fix a probability space (Ω,F,P)(\Omega, \mathcal{F}, \mathbb{P}) and observations j=1,…,Jj = 1, \dots, J, each with a real value vjv_j and an availability time aja_j, both random variables, so that a fixed release date is a special case. The information set at decision time tt is the sigma algebra

Ft=σ(1{aj≤s}, vj1{aj≤s}for all j and s≤t),\begin{aligned} \mathcal{F}_t = \sigma\bigl(&\mathbf{1}_{\{a_j \le s\}},\ v_j \mathbf{1}_{\{a_j \le s\}} \\[0.4em] &\text{for all } j \text{ and } s \le t\bigr), \end{aligned}

generated by whether each observation has arrived by each time s≤ts \le t and by the value of each observation that has arrived. The indicator separates an observation that arrived with value 00 from one that has not arrived. If s≤ts \le t, then Fs⊆Ft\mathcal{F}_s \subseteq \mathcal{F}_t, so the information sets form a filtration. A feature XtX_t is admissible at tt when

σ(Xt)⊆Ft,\sigma(X_t) \subseteq \mathcal{F}_t ,

that is, when XtX_t is Ft\mathcal{F}_t-measurable. When Ft\mathcal{F}_t is generated by a finite partition of Ω\Omega, this means that XtX_t is constant on each cell of the partition. The sigma algebras and partitions used here are those of Probability spaces and conditional information.

In plain words The information set lists the yes or no questions about the world that can be answered with what had arrived by time tt. Two states of the world that look the same at tt must lead to the same admissible decision, however differently they turn out later. Release times are part of the information, so the same values released later give an information set at a given date that is no larger.

Example Take two constructed states ω1\omega_1 and ω2\omega_2, so Ω={ω1,ω2}\Omega = \{\omega_1, \omega_2\}. A first observation is released at time 11 with value 22 in both states, and a second is released at time 1010 with value 33 in ω1\omega_1 and 11 in ω2\omega_2. Every generator of F9\mathcal{F}_9 takes the same value in both states, so F9={∅,Ω}\mathcal{F}_9 = \{\varnothing, \Omega\}, and a feature equal to the second observation is not admissible at time 99, because it differs between two states that F9\mathcal{F}_9 cannot tell apart. At time 1111 the second value separates the states, F11\mathcal{F}_{11} is the power set of Ω\Omega, and the same feature is admissible.

Data revision

Definition A data revision is a later value for the same item, the same variable for the same entity and economic period, that replaces a value published earlier. Write the versions of one record as pairs (a(k),v(k))(a^{(k)}, v^{(k)}) for k=1,…,Kk = 1, \dots, K, with availability times a(1)<a(2)<⋯<a(K)a^{(1)} < a^{(2)} < \dots < a^{(K)}. For t≥a(1)t \ge a^{(1)} the as-of value is

vtas-of=v(κ(t)),κ(t)=max⁡{k:a(k)≤t},\begin{gathered} v_t^{\text{as-of}} = v^{(\kappa(t))}, \\[0.4em] \kappa(t) = \max\{k : a^{(k)} \le t\}, \end{gathered}

and for t<a(1)t < a^{(1)} the record is not yet available. When the versions and their availability times are among the observations that generate Ft\mathcal{F}_t, the as-of value is Ft\mathcal{F}_t-measurable. The final value v(K)v^{(K)} used at a time t<a(K)t < a^{(K)} is in general not, because it is information that arrived later.

In plain words An as-of query asks for the latest version that was available at the decision time, not the latest version available now. Replacing history with the final corrected numbers can leave every calculation correct and still feed the model numbers that had not been published yet, so the experiment describes a different information set from the one it claims.

Example A constructed record has the value 22 published at time 11, replaced by 33 at time 1010 and corrected to 2.52.5 at time 1515. A decision at time 99 uses 22. At time 1111 the value 33 is available but its correction is not, so the decision uses 33, and at time 1616 it uses 2.52.5. A table that keeps only the final value supplies 2.52.5 at all three times. At time 99 that is a number not yet released, and at time 1111 a correction not yet made.

Point-in-time data

Definition A dataset is point-in-time if, for every time tt in its range, it can reproduce exactly what a user could have known at tt. For that it stores each value with its economic period, its availability time and its version, keeps revisions as new rows instead of overwriting old ones, and records the membership of every security universe with dated entries and exits. The as-of view at tt, the latest version of every record whose availability time is at most tt, then generates the information set Ft\mathcal{F}_t of the recorded observations. A dataset that keeps only the latest revision, or lists only the securities that exist today, cannot reproduce Ft\mathcal{F}_t, so a study built on it uses a different information set from the one it describes.

In plain words A point-in-time database answers the question of what was known on a given date, and not only what is known now. Its extra columns are the record of when each number could first have entered a decision.

Example A constructed earnings figure for the quarter ending on day 00 is first released on day 3030 as 1.201.20 per share and revised on day 7575 to 1.101.10. A point-in-time table holds both versions with their availability times, so an as-of query returns no value for this quarter on day 2020, the value 1.201.20 on day 4040 and 1.101.10 on day 8080. A table keyed only by the quarter holds the single row 1.101.10, and joining it to prices on the quarter-end date hands that value to every decision from day 00 on, thirty days before any figure for the quarter was public and seventy-five days before this one was.

Survivorship bias

Definition Fix an initial universe U0U_0 of NN securities chosen at time 00 with information in F0\mathcal{F}_0, invest W0/NW_0/N in each, and hold to time TT without rebalancing. Let RiR_i be the total return of holding ii. It includes the cash or replacement securities a holder receives if the security is delisted, merged or liquidated, and it equals −1-1 if the holding becomes worthless. Terminal wealth is ∑i(W0/N)(1+Ri)\sum_i (W_0/N)(1 + R_i), so the portfolio return is exactly

RU0=1N∑i∈U0Ri.R_{U_0} = \frac{1}{N} \sum_{i \in U_0} R_i .

Survivorship bias is the error from computing a return or another statistic only over the subset of securities that still exist at TT. Survival is a future event that can depend on the return itself. In a probability model for the return RR of one security and the event SS that it survives to TT, with E[∣R∣]<∞\mathbb{E}[\lvert R \rvert] < \infty and P(S)>0\mathbb{P}(S) > 0,

E[R∣S]−E[R]=Cov⁡(R,1S)P(S),\begin{aligned} &\mathbb{E}[R \mid S] - \mathbb{E}[R] \\[0.4em] &\quad = \frac{\operatorname{Cov}(R, \mathbf{1}_{S})}{\mathbb{P}(S)}, \end{aligned}

because E[R∣S]=E[R1S]/P(S)\mathbb{E}[R \mid S] = \mathbb{E}[R \mathbf{1}_{S}]/\mathbb{P}(S). So the bias has the sign of the covariance between return and survival, and it can be positive, negative or zero. When P\mathbb{P} is the uniform draw of one name from U0U_0, the mean E[R]\mathbb{E}[R] is RU0R_{U_0} and E[R∣S]\mathbb{E}[R \mid S] is the survivor average. A strategy that trades a changing universe is a different and equally legitimate object, but it needs a dated membership rule UtU_t and an account of the trades made when membership changes.

In plain words A list of securities downloaded today often contains only those that still trade. Averaging over that list answers how the survivors did, which is not how the portfolio chosen at the start did. Deleting a failed security’s row does not return its holders’ money. A missing delisting return is something to look up, not a gap to fill with zero or to drop.

Example A constructed universe has three securities with total returns 0.100.10, −0.05-0.05 and −1-1, the last one worthless at TT. Investing 100100 currency units in each turns 300300 into 110+95+0=205110 + 95 + 0 = 205, so the portfolio return is −95/300≈−0.316667-95/300 \approx -0.316667, the simple average of the three returns. The two survivors average (0.10−0.05)/2=0.025(0.10 - 0.05)/2 = 0.025, about 34.166734.1667 percentage points higher, and the whole difference comes from the choice of sample. Under the uniform draw P(S)=2/3\mathbb{P}(S) = 2/3 and Cov⁡(R,1S)=41/180\operatorname{Cov}(R, \mathbf{1}_S) = 41/180, and the identity gives 41/120≈0.34166741/120 \approx 0.341667, the same gap.

Corporate action adjustment

Definition A corporate action changes the shares or the cash attached to a holding, for example a split, a reverse split, a cash dividend, a spin-off or a merger, and a corporate action adjustment makes a return measure the change in the holder’s wealth through it. Consider n0n_0 shares bought at the ex-dividend price P0P_0 and held without trading to time 11, with n1n_1 shares after the corporate actions, the price P1P_1 per share at time 11, and cash distributions C1C_1 held as cash without interest. The total return is

R=n1P1+C1−n0P0n0P0.R = \frac{n_1 P_1 + C_1 - n_0 P_0}{n_0 P_0} .

For a kk-for-11 split, n1=kn0n_1 = k n_0, where k<1k < 1 describes a reverse split. With a dividend dd per post-split share paid after the split, C1=kn0dC_1 = k n_0 d and

R=P1+dP0/k−1,R = \frac{P_1 + d}{P_0 / k} - 1 ,

which compares post-split amounts with the adjusted starting price P0/kP_0/k. The split-adjusted price return kP1/P0−1k P_1 / P_0 - 1 leaves out the dividend, and the raw price return P1/P0−1P_1/P_0 - 1 compares shares that represent different fractions of the company. Reinvesting the dividends instead of holding the cash would need their reinvestment dates and prices as further data.

In plain words Count what the holder owns at the end, the shares at their price plus the cash received, and compare it with what was paid. A split changes the price per share but not the value of the holding, so a raw comparison of per-share prices across a split mistakes a change of unit for a gain or a loss.

Example One share is bought at 120120 currency units, and the company then splits 22-for-11, so just after the split there are two shares worth 6060 each if nothing else changes. Later each share is worth 6363 and pays a dividend of 0.50.5, held as cash. Terminal wealth is 2⋅63+2⋅0.5=1272 \cdot 63 + 2 \cdot 0.5 = 127, so the total return is 7/120≈0.0583337/120 \approx 0.058333. In adjusted per-share units the same return is (63+0.5)/60−1=3.5/60(63 + 0.5)/60 - 1 = 3.5/60. The split-adjusted price return is 63/60−1=0.0563/60 - 1 = 0.05, and the raw price return 63/120−1=−0.47563/120 - 1 = -0.475 reports a loss of almost half the investment for a holder who gained.

Check yourself

  1. A constructed record of one quarter’s sales is first released as 4.04.0 at time 22, revised to 4.44.4 at time 77 and revised again to 4.24.2 at time 1212. Which value may a decision use at times 11, 66, 88 and 1313, and what would a table that keeps only the latest revision supply at those times?
Show the answer

At time 11 no version has arrived, so the record is not available and the decision cannot use it. At time 66 the latest version with availability time at most 66 is 4.04.0, at time 88 it is 4.44.4 and at time 1313 it is 4.24.2. The latest-revision table supplies 4.24.2 at all four times. At time 11 that is a figure that had not been released at all, and at times 66 and 88 it is a revision that did not exist yet. Only at time 1313 does it agree with the as-of value.

  1. You buy 1010 shares at 9090 currency units each. The company then splits 33-for-11, and later each new share is worth 31.5031.50 and pays a dividend of 0.200.20, which you hold as cash. Find the terminal wealth and the total return, and compare them with the raw price return and the split-adjusted price return.
Show the answer

After the split you hold 3030 shares, worth 30⋅31.50=94530 \cdot 31.50 = 945, and the dividends add 30⋅0.20=630 \cdot 0.20 = 6 in cash, so terminal wealth is 951951 against the 900900 paid. The total return is

R=951−900900=17300≈0.056667.\begin{aligned} R &= \frac{951 - 900}{900} \\[0.4em] &= \frac{17}{300} \approx 0.056667 . \end{aligned}

In adjusted per-share units the starting price is 90/3=3090/3 = 30, and (31.50+0.20)/30−1=1.70/30(31.50 + 0.20)/30 - 1 = 1.70/30 gives the same value. The split-adjusted price return 31.50/30−1=0.0531.50/30 - 1 = 0.05 leaves out the dividend. The raw price return 31.50/90−1=−0.6531.50/90 - 1 = -0.65 compares one new share with one old share, although each old share became three, so it reports a large loss for a holder who gained about 5.675.67 percent.

  1. A constructed equal-weighted buy-and-hold portfolio puts 250250 currency units into each of four securities chosen at time 00. Over the period A returns 0.120.12 and B returns −0.04-0.04. C is delisted after a bankruptcy and its holders recover 1010 percent of their investment, and D is acquired for cash at a price that gives a return of 0.350.35. A database downloaded at TT lists only A and B. Compute the portfolio return, the survivor mean and the mean a colleague gets by filling the two missing returns with zero. Is survivorship bias always upward?
Show the answer

The return of C is −0.90-0.90. Terminal wealth is 280+240+25+337.50=882.50280 + 240 + 25 + 337.50 = 882.50 from 10001000, so the portfolio return is −0.1175-0.1175, the average of the four returns. The survivor mean is (0.12−0.04)/2=0.04(0.12 - 0.04)/2 = 0.04, which is 15.7515.75 percentage points too high. Filling the missing returns with zero gives (0.12−0.04+0+0)/4=0.02(0.12 - 0.04 + 0 + 0)/4 = 0.02, also wrong, because it records a 9090 percent loss and a 3535 percent gain as no change. The bias is not always upward. If the database had instead dropped only the acquired name D, the average of A, B and C would be (0.12−0.04−0.90)/3≈−0.273333(0.12 - 0.04 - 0.90)/3 \approx -0.273333, about 15.5815.58 percentage points too low, because the missing name had the highest return. The sign follows the covariance between return and remaining in the data, so the actual terminal outcomes of C and D have to be found.

How this lesson connects