{'fraction_non_alphanumeric': 0.04801428524189015, 'fraction_numerical': 0.014913527991799213, 'mean_word_length': 3.9118076985544907, 'pattern_counts': {'":': 0, '<': 18, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 21, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
On the derivation of the Khmaladze transforms

Some 40 years ago Khmaladze introduced a transform which greatly facilitated the distribution free goodness of fit testing of statistical hypotheses. In the last decade, he has published a related transform, broadly offering an alternative means to the same end. The aim of this paper is to derive these transforms using relatively elementary means, making some simplifications, but losing little in the way of generality. In this way it is hoped to make these transforms more accessible and more widely used in statistical practice. We also propose a change of name of the second transform to the Khmaladze rotation, in order to better reflect its nature.


Introduction
The generic goodness of fit problem lies in separating possible outcomes of a statistical experiment into a finite number of cells, noting expected and observed frequencies for each cell, and testing for smallness of differences between them. The classic test for this is the chi squared test, which is distribution free, in the sense that the distribution of the chi squared statistic does not depend on the distribution generating the data, provided only that the hypothetical distribution be fully specified.
The vital contribution made by Khmaladze some 40 years ago was to allow distribution free goodness of fit tests for compound hypotheses (Khmaladze, 1979(Khmaladze, , 1981. Using the Khmaladze Transform (hereafter KT, or occasionally the 'first' transform, or 'KT1'), one could test for whether the data could plausibly arise from a given distributional family. This more or less corresponds to what is done in practice: only rarely would a statistician wish to test for a specific parametric value within the distributional family of interest, which was the only possibility available before the introduction of the KT.
Papers utilising the KT are cited in Li (2009), Koul & Swordson (2011) and Kim (2016), i.a. It is however clear that the uptake by the statistical community of such an important conceptual advance in goodness of fit testing has been slow.
Within the last decade, Khmaladze has published another, and ostensibly simpler, transform to test goodness of fit in a distribution free manner (Khmaladze, 2013a(Khmaladze, , 2016. The new transform has tentatively been labelled as the second Khmaladze transform, generally referred to below as the second transform or 'KT2'. We suggest that this second transform be relabelled as the 'Khmaladze rotation'. Adoption of the second transform also appears to be slow. Of the papers Dumitrescu & Khmaladze (2019), Kennedy (2018), Khmaladze (2017), Nguyen (2017a,b) and Roberts (2019), only Kennedy applies the KT2 to real data. He is also the only one of these authors to suggest a wider use of the second KT to choose an optimal model amongst competing models.
Both transforms involve projections of the empirical process. The first transform projects onto a Brownian motion (BM), obtained essentially by regressing the incremental empirical distribution function (EDF) on the 'future'; what this cryptic description really means is that the goodness of fit test assumes that all the data is to hand, viz. that the statistical experiment is complete, when the goodness of fit test is carried out. The second transform utilises the same types of projections to change from one empirical process to another, without losing any statistical information. The test of goodness of fit can then be carried out in one statistical framework or the other, whichever is more convenient.
The purpose of this paper is not to apply these transforms to data analysis, but to spread the word about these elegant and potentially very useful transforms, by explaining their genesis more simply and intuitively. The idea is to discretise the empirical processes being tested, so that operators and operands in functional space become matrices and vectors. We then develop the ideas underlying the transforms in N−dimensional space, hoping that the straightforward linear algebraic approach will make the underlying reasoning transparent. The loss of generality is in fact slight, and such discretisation of the underlying spaces, operators and operands is no more than one would impose for computing purposes.
Our starting point is to decompose the chi squared statistic. Mimicking the approach taken in Khmaladze (2013a), we project a standard normal vector onto a vector having the covariance structure of the chi squared components; then we consider rotation or reflection from one chi squared statistic to another. This already gives the two elements underlying the second transform, viz. projection and rotation/reflection. The idea of projection was not new: the fitting of linear regression underpinning the first transform is a projection of asymptotically normal regressors to model the increment of the empirical process. It is the rotation, or more properly reflection, from one chi squared statistic to another which defines the underlying rationale of the second transform, and differentiates it from the first transform. Our basic task is to find the projection and rotation operators of the second transform, moving from one (discretised) empirical process to another.
Following the definitions of the projection and reflection operators applied to the chi squared statistic, we then make the ostensibly slight adjustment to operate on the empirical process, essentially the numerator of the chi squared statistic. Starting with Brownian Motion (BM) in a discrete time P , we recast operators as matrices and functional operands as vectors, possibly semi-infinite in length. We project the BM to a Brownian bridge (BB) in time P , and rotate from one BB to another, in time R say. Allowing for parameters to be estimated is allowed for by further projections, most easily seen by changing from point parametrisation to functional parametrisation of the empirical process.
The resulting q−projected BMs may be rotated from one empirical process to another, say from time P to time R. We are still working with discrete distributions; but within that limitation, we have proved the validity of the KT2, whereby a goodness of fit test may be effected either in the P space or the R space as convenient, and no statistical information is lost in rotation from one to the other.
A further short section extends the second transform to higher dimensional distributions P , and illustrates the outworking for the colour blind problem, for which we largely follow the first part of Dumitrescu & Khmaladze (2019).
Khmaladze has largely adopted this discretised approach to elucidate and prove the original transform in the framework of a simple mortality investigation (Khmaladze, 2013b, ch. 7). In the final section of this paper we flesh out his development and provide additional comments.

The statistical setup
Given a random variable X with distribution function F (x), it is not essential but notationally convenient to suppose that the support of X is bounded away from minus infinity: suppose there exists a finite number M F such that X > M F with probability one. Then we define a grid of points M F = x 1 < x 2 < . . . < x N < x N +1 = ∞, and let the jth cell be defined by X ∈ [x j , x j+1 ) for 1 ≤ j ≤ N, with associated probabilities [x j ,x j+1 ) dF (x) = p j . Should there be an atom of X at the grid point x j , then the saltus at x j will be included in p j but not in p j−1 . Noting that N j=1 p j = 1, we further define the approximating discrete distribution function P (x), with atoms at {x j } N j=1 . In simpler terms, the non-decreasing step function P : R → [0, 1], is piecewise constant apart from steps occurring at points x 1 , x 2 , . . . , x N . The step or saltus at x j is to be p j > 0; the function P is to be continuous from the right; P (x) = 0 when x < x 1 ; and P (x) = 1 when x ≥ x N . The point of supposing the existence of such a lower bound as M F is merely for the convenience of not regarding −∞ as a possible value for the corresponding putative random variable: it is not an essential step.
In like vein, suppose a random variable Y with distribution function G(y), similarly bounded away from minus infinity, with a grid M G = y 1 < y 2 < . . . < y N < y N +1 = ∞, and let the jth cell be defined by Y ∈ [y j , y j+1 ) for 1 ≤ j ≤ N, with probabilities [y j ,y j+1 ) dG(y) = r j .
The aim of the second Khmaladze transform or Khmaladze rotation is to rotate the stochastic process with distribution function F to that with distribution function G. Our simplified approach is to approximate F and G by the discrete distributions P and R respectively, and rotate from P to R.
This latter is more easily visualised than the full rotation from F to G, because all operations may be effected by standard linear algebraic procedures. Resulting vectors and matrices are approximations to the integral operators and functional vectors occurring in the full rotation. The outworkings below will be set out for finite dimension N, but would be essentially unchanged if N were countably infinite, with vectors of semi-infinite length.

Rotating from one χ 2 test to another 2.2.1. Projection of chi square statistics
More or less following Khmaladze (2013a), we normalise the observed frequencies and sum to obtain the conventional chi-squared statistic. For a sample size n and a total number N of cells, define with ν j the observed frequency in the jth cell, and p j the probability of a data point falling in the jth cell.
Summing the squares of the statistics in (1) produces the Chibisov (1971), for example, discusses the distribution of the chi-squared statistic when cell boundaries are determined in light of the data; but we assume boundaries to be fixed independently of the data. The frequencies ν j have a multinomial distribution, with covariance structure given by Var( Define π a (b) to be a projection from b perpendicular to a, as illustrated in Figure 1. First note that It is well known that the chi-squared statistic in (2) has the χ 2 n−1 limiting distribution, with mean n − 1. For completeness, and for comparison with later work, we note that the asymptotic limiting statistic has the same mean: (5) We are however more concerned with the covariance of Y : , the (cumulative) distribution function of Y ′ tends to that of Y , at all points of continuity of the latter. In simpler terms, we may asymptotically approximate Y ′ by the normally distributed Y . This is certainly so if the infimum of {p j : 1 ≤ j ≤ N} is bounded away from zero.

From a projection operator to a reflection operator
Given vectors of unit length √ p and √ r, the reflection operator U √ p, √ r = U 0 is defined as in which the constant c 0 is given by and in turn the norm is given by s 2 = < s, s > = s T s and the inner product as < s, t > = s T t. The reflection operator swaps √ p and √ r around, while leaving unchanged all vectors orthogonal to both of them. We note that Consider a second stochastic vector of length N defined by T = π √ r Z 1 where Z 1 ∼ N (0, I) and Z, Z 1 are independent.
We may consider T ′ to be defined from a normalised multinomial variate as in (1), with p j replaced by r j ; again we may asymptotically approximate T ′ by the normally distributed T . Thus T and U 0 Y have the same distribution, since they are Gaussian with identical means and covariance.
So given two stochastic processes and a common number N of cells with cell probabilities p and r, we have a means of rotating from one process to another, or at least from one chi-squared test to another. The projections of Z and Z 1 to give Y and T respectively are not reversible, and so lose information. In contrast, the transform from Y to T (we are working asymptotically, and assume normality) is reversible. The goodness of fit test may be more conveniently carried out for one process than the other, and there is no loss of statistical information in rotating from one stochastic process to another.

From the chi-squared statistic to the empirical process
We have normalised the multinomial numerator in (1) in order to define the rotation U 0 between the stochastic processes Y ′ and T ′ , or rather between their asyptotic limits Y and T . Empirical processes in practice assume the form of observed minus expected frequencies, and our first task is to remove the standard deviation in the denominator from (1), although we retain the factor of √ n needed for sensible scaling of the empirical process. Accordingly we define N × N diagonal matrices D p containing {p j } N 1 , in the given order, along the diagonal: that is, D p = diag(p). The square root of D p is unambiguously defined, with elements √ p j down the diagonal, denoted either by D √ p or D 1/2 p . Thus the vector D 1/2 p Y ′ contains elements (ν j − np j )/ √ n, for j = 1, . . . , n, although we generally work instead with the limiting Gaussian vector D 1/2 p Y . The diagonal N × N matrix D r is defined analogously for probabilities r.
Define a lower triangular N × N matrix J by setting all elements on and below the diagonal to unity, and the elements above the diagonal to zero. This 'accumulating' matrix has the effect of cumulating a column vector: the jth element of Y , for instance, is Y j , while the jth element of JY is j k=1 Y k . Further, let j T k denote the kth row of the accumulation matrix J, so that the column vector j k consists of k unities followed by N − k zeroes.
A caution is in order here. A common convention is to denote random variables by capital letters, with possible or realised (sample) values denoted by the corresponding small letter. We do not necessarily keep to this convention here.

Brownian Motion in time P (x)
Consider again the vector Z ∼ N (0, I). The covariance matrix of D The elements of the vector D 1/2 p Z are increments of Brownian motion (BM) in the time P (x). Integrating or summing that process yields BM in time P (x). The stochastic vector JD 1/2 p Z has the distribution of a BM with respect to the time P (x), or in the time P (x); and its covariance matrix is J D p J T .
We define ∆w P = D 1/2 p Z, the vectorised increments of BM in time P ; we further set w P = JD The conventional expression of BM in time P , evaluated at time x, would then be which is normally distributed, with mean zero and variance (−∞,x] dP (y) = j≤k p j . Further assume that x ′ ∈ [x l , x l+1 ), where k ≤ l. The covariance of w P (x) and w P (x ′ ) is given by which is the standard expression for the covariance of BM in time P (x) for any distribution function P (x). Now suppose that x ∈ [x k , x k+1 ) and x + ∆x ∈ [x m , x m+1 ), where k ≤ m. Conventional increments of w P (x) are given by where ∆w P (x) is again normally distributed, with mean zero and variance x+∆x x dP (y) = k<j≤m p j .

The Brownian Bridge in time P (x)
In the last section, we rescaled the standard normal column vector Z and interpreted the elements of D 1/2 p Z as increments of BM in time P (x). In like manner, the column vector D 1/2 p Y contains increments of the Brownian Bridge (BB) process v P (x) in time P (x), so that the BB process in time P (x) is JD 1/2 p Y . As previously, we define ∆v P = D 1/2 p Y , the vectorised increments of the BB in time P ; and v P = JD 1/2 p Y , the vectorised BB in time P . By analogy with (7) above, and still assuming that which is normally distributed, with mean zero; but the covariance structure of the P BB is now more complicated. Again supposing that x ′ ∈ [x l , x l+1 ), with k ≤ l, the covariance of v P (x) and v P (x ′ ) is given by which is the standard expression for the covariance of a BB in time P (x), or a P BB for short, for any distribution function P (x). When x + ∆x ∈ [x m , x m+1 ) the increments of v P (x) are given by where ∆v P (x) is again normally distributed, with mean zero. The variance of ∆v P (x) is

Projection from BM to BB in time P (x)
Let q 0 be a column vector of length N in which every element is unity.
in the primal space with v P and w P , the projection operator Π q 0 P projects P BM w P onto q 0 −projected P BM, which is just the P BB v P (Khmaladze, 2016). Abbreviating for the moment by setting Π q 0 P = Π (to be generalised later in (25) on p. 16), we have 10) Noting that q T 0 D p q 0 = 1, proofs are as follows

From point parametric to function parametric form for the stochastic processes
Now we change to function parametric form for the BM and BB. Let Φ = {φ} be a family of functions φ(x) ∈ L 2 P , i.e. functions φ such that φ(x) 2 dP (x) < ∞. We set φ = φ 1 φ 2 . . . φ N T , where φ j = φ(x j ).
In an abuse of notation we shall often write φ for φ, since there seems little likelihood of confusing the function φ(x) and the vector of its non-zero values at the atoms of P . The finiteness condition for the norm of members of Φ reduces to φ 2 P = φ(x) 2 dP (x) = φ T D p φ = φ T D p φ < ∞, which ceases to be vacuous if N is allowed to be countably infinite, given that the values φ j are finite.
Similarly we define a family Ψ of functions ψ(y) ∈ L 2 R , with vector of values ψ = ψ 1 ψ 2 . . . ψ N T , where ψ j = ψ(y j ). Again writing ψ for ψ, we are imposing the analogous constraint on the norm, viz.

Projection operators in the primal and dual spaces
Writing φ T ∆v P = φ T ∆v P then, we have so that Π = I − D p q 0 q T 0 is the projection operator in the primal space, acting on ∆w P to produce ∆v P ; and Π T = I − q 0 q T 0 D p is the projection operator in the dual space, acting on the functions φ ∈ Φ. Equation (11) may be rewritten in more conventional fashion as To retrieve the point parametric version v P (x), set φ(s) = φ t (s) = 1 {s<t} = the Heaviside function, starting at 1 and dropping to zero at t. From (12) More conventionally perhaps, this would be expressed as Analogously for the BM with functional parametrisation

Rotation from one stochastic process to another when parameters are known
We set s 0 = q 0 , intending q 0 to be associated with the source P distribution, and s 0 to be associated with the target R distribution. When we allow parameters to be estimated, the vectors q j and s j for 0 < j ≤ K will become the (normalised) score functions (N−vectors) for the K dimensional parameter θ in the respective spaces. For the moment the parameter θ is assumed known, requiring the use of q 0 and s 0 alone to define the rotation/reflection. In the more general case, we shall require a sequence of reflections to define the desired rotation, as set out in §2.7.1 on p. 18.
Define L = D 1/2 r D −1/2 p , so that LD p L = D r . Note that for ψ ∈ L 2 R , L ψ ∈ L 2 P : i.e., writing Lψ for L ψ, Ls 0 , so that q 0 = ULs 0 . Then the rotation from one stochastic process to another is given by Proof is by showing commonality of covariances. From (13), 2.6. Estimating parameters 2.6.1. The score function Recalling the definition of Y ′ from (1) on p. 5, we define an analogous statistic Y ′ j when the parameter is estimated: Estimating K unknown parameters by minimising chi squared (Cramer, 1946, §30.
in which Q k is the column N−vector with elements { ∂p j /∂θ k p j } N j=1 for k = 1, . . . , K; in other words, Q 1 Q 2 . . . Q K is the (non-normalised) score function. To normalise this function, we note that where Γ is the information matrix. We may now define normalised score functions as So, with δ jk denoting the Kronecker delta, but in fact more is true: letting the heavy dot denote ∂ ∂θ k , and noting that p j = 1, yields This is true for every k, so Finally then we may write

Reassembling the jigsaw
Fleshing out (16) we find From (16) we define the Gaussian N−vector Applying (20) and (21), and disregarding the residual in (23), Again, in analogy with (4) and (6) on pp. 6 and 7, and utilising (19), From (24) we have that Eschewing the clumsy notation ∆ v P in favour of the simpler ∆ v P , we rewrite the last equation as q k q T k ∆w P = Π q P ∆w P in which Π q P is defined as shown, extending the previously defined Π q 0 P in (10) on p. 11, and where q = (q 0 , q 1 , . . . , q K ).
Now we use the abbreviation Π for Π q P rather than Π q 0 P . Proofs of the relations in (25) are similar to those in (10) on p. 11; and again utilising (19): Thus Changing to function parametric form yields Once again, as in (11) on p. 12, when operating on functions in the dual space, the projection operator becomes the transpose of the operator Π q P in the primal space. The which becomes, in more conventional form, The point parametric version is 2.6.4. For consistency with chi squared when df = n − K − 1 For comparison with the mean of the chi-squared distribution when parameters were assumed known, as in (5) on p. 7, we have

Rotation operators in the general case 2.7.1. The rotation operator as a succession of reflections
We require a matrix V K with the properties that V K Ls k = q k for 0 ≤ k ≤ K, and V T K D p V K = D p ; i.e., the linear map sends score functions to score functions, with an adjustment to allow for the different functional spaces L 2 P and L 2 R ; and the transform also preserves the P -norm. Khmaladze's method for finding a suitable V K is adumbrated in Khmaladze (2013a), Nguyen (2017a) and Kennedy (2018), i.a.; but the methodology is set out more fully in Roberts (2019), which we follow.
and so on. More formally we have the recursion Then Roberts (2019) shows that V K Ls k = q k for 0 ≤ k ≤ K; and it is straightforward to show that V T K D p V K = D p .

Rotation from one empirical process to another
The rotation from one stochastic process to another is given by Proof proceeds as in (15) on p. 13, again utilising (19).

Higher dimensional Khmadadze rotations, and the colour-blind problem
We consider firstly how to fit the two-dimensional Khmaladze rotation into the linear algebraic framework detailed above, and comment briefly on its three-dimensional cousin. Largely taking our cue from Dumitrescu & Khmaladze (2019), we then symmetrise the underlying Borel sets to look at the 'colourblind' problem.

The Khmadadze rotation in two dimensions
Consider a sample of n realisations of independent and identically distributed pairs (X j , Y j ), with distribution function H(x, y), and marginal distribution functions F (x), G(y). We approximate F and G by discrete distributions P and R respectively, along the lines of §2.1 on p. 4. This time however, we are not rotating from F to G; rather both distributions are necessary to build the framework for our analysis.
The EDF is given by and the basic empirical process as v n (x, y) = H n (x, y) − H(x, y) Rather than mapping the one dimensional BM onto a BB, we now use the 2 dimensional BM w H (x, y) in 'time' H(x, y), projecting it (or rather tying it down at the edges) to obtain a Brownian 'pillow' (Dumitrescu & Khmaladze, 2019, §2.1). Writing w for w H we have: v(x, y) = w(x, y) − x w(∞, y) − y w(x, ∞) + x y w(∞, ∞) in which we may 'anchor' the BM at the origin; or more generally at the lower end of the supports (M F , M G ) as in §2.1. The analysis of the preceding sections involving the Khmaladze rotation proceeds via v n (φ) = φ(x, y)dv n (x, y) and v(φ) = φ(x, y)dv(x, y) Now define the rectangle R(a, b) in the plane as Then we set φ a,b (x, y) = 1 {(x,y)∈R(a,b)} ; and the family Φ is generated by all such functions, for M F < a, M G < b.
The central result (26) on p. 18 remains valid, even if the vectors of length N in the previous development are now vectors of length N 2 as we vectorise functions and variables over the plane.
Moving to higher dimensions is straightforward, conceptually at least. The Brownian pillow, or its equivalent, in three dimensions assumes the form Changing notation in anticipation of our work in the next section, set and again the family Φ is generated by all functions of the form φ a 1 ,a 2 ,a 3 (x, y, z) = 1 {(x,y,z)∈R(a 1 ,a 2 ,a 3 )} . The extension to higher dimensions is feasible in principle, but how useful the Khmaladze rotation will be in higher dimensions remains to be seen.

The colour-blind problem
In a recent article Dumitrescu & Khmaladze (2019) have reconsidered the colour blind problem, in which pairs of observed coloured items are unable to be distinguished by a colour blind observer. Further background is available in Parsadanishvili (1982) and Parsadanishvili & Khmaladze (1982).
To be precise, suppose that weights X r and X g of red and green balls have distribution functions P r (x) and P g (x) respectively, and the ith data point consists of a pair X (i) r , X (i) g , where the random variables are independent from data point to data point, although the weights of the red and green balls need not be independent. Then Dumitrescu & Khmaladze (2019), projecting the empirical process and utilising the properties of the Brownian pillow, consider the possibilities for statistical inference available to a colour blind person, able to measure the maximum and minimum weights of each pair, but without any means of knowing whether that maximum or minimum comes from the red or the green ball.
We symmetrise the rectangles R(a, b) by defining Now we set φ a,b (x, y) = 1 {(x,y)∈S(a,b)} ; the function φ is symmetric in x and y, necessarily so by virtue of the fact that the colour blind person cannot distinguish between the colours.
The derivation of (26) proceeds as previously, but the vectors now have length N(N + 1)/2.
In three dimensions, and retaining the notation in (27), we have where S 3 is the symmetric group on 3 symbols. Again extension to higher dimensions, and more than two colours, is feasible conceptually; but its utility in practice, and especially in the context of the Khmaladze rotation, remains to be seen.

The Khmadadze transform
Khmaladze (2013b, ch. 7) has derived the KT in the simple setting of a mortality investigation of n independent and identically distributed lives. After a short recapitulation of least squares regression, we shall follow his treatment closely, clarifying some points as we go.

The linear regression model
The model is Centre this to obtain Assuming the covariates and the residual are uncorrelated, taking expectations yields in which Covar(x, y) stands for the covariance matrix, while Cov(x, y) stands for the covariance of x and y, the off diagonal elements of the covariance matrix. We have now Finally the predicted value of the regressand is In econometrics, the linear predictor from regression models can seem unrelated to the last equation, although the difference is more of form than of substance. When the parameters are not time varying, it is usual to stack the regressand and regressors, with the model expressed as Y = Xβ + ǫ, with Y a column vector and X a matrix, whence the predicted value of Y is Y = X(X T X) −1 X T Y , with the moments being estimated from the sample. The projection from Y to Y in (16) on p. 14, for instance, is of this form. The regression sought in the case of KT1 is not amenable to the stacking of variables in this way because the distributions of the random variables x 1t and x 2t depend on t, as do the coefficients.
Instead of (28), the formula for the predicted value of y t is often taken to be which is the formula used, for example in Koul & Swordson (2011).

Choice of regressand and regressors
Following (Khmaladze, 2013b, ch. 7), we place the derivation of KT1 in the context of a mortality investigation. There are n people in the sample, and we are investigating the duration of life, so that the variable x in §2.2 is time. The intention is to predict ν l , the number of deaths in the lth cell, from a linear regression model.
The empirical distribution function (EDF) is defined as F n (x) = 1 n 1 {x j ≤x} , with increment ∆ F n (x) = F n (x+∆x)− F n (x), which becomes in our previous notation ∆ F n (x j ) = ν j /n. Then F (x l ) is the actual proportion of the sample dead by time x l , and F θ (x l ) = E F (x l ) the expected proportion.
Recalling the definition of the score function Q 1 in (17) on p. 14, and assuming there is but one unknown parameter, so that K = 1, we have Q 1 = Q 11 Q 12 . . . Q 1N T To predict ν l we would think of using its expected value p l , as well as its derivative • p l = ( • p l /p l ) × p l . We recast these as their sample counterparts ν l and Q 1l ν l , and sum over the future cells to produce Khmaladze's regressors 1 n N j=l ν j and 1 n N j=l Q 1j (θ)ν j . The MLEθ used in the second regressor is calculated from the entire sample -see (33) on p. 25 below. The scaling arises because the regressand is to be the increment in the EDF, and 1 n ν l = ∆ F n (x l ). The first regressor is an obvious enough choice, in that 1 n N j=l ν j = 1 − F (x l ) is the proportion of survivors at time x k ; and the more surviving at time x l , i.e. the higher the exposed to risk at time x l , the greater the expected number of deaths within the period [x l , x l+1 ).

KT1 through linear regression
Once all the data is available, i.e. everyone in the sample has died, we are testing the goodness of fit of a particular distribution of duration of life, or rather a given family of distributions F θ (x) depending on an unknown parameter θ. We assume F θ (x) to be continuous, with corresponding nonnormalised score function denoted by h(x, θ) = ∂ ∂θ f θ (x) f θ (x). We pretend to be partway through the cohort dying off, and try to predict the number dying in the next short interval, given firstly the number surviving at the moment, secondly the future times of death of the current survivors, and thirdly parameter estimates obtained from the entire sample. The 'present' time is t = x l , and we wish to predict ν l , the number dying before time x l+1 .
The key result we need is the following, taken from Khmaladze (2013b, p. 79) Cov g 1 (x) d F n (x), g 2 (x) d F n (x) This result should be compared with (8), (9) and (14) on pp. 10, 10 and 12 respectively; and see also Khmaladze (2013b, p. 46). In the present context, The vanishing of Cov(x 1t , x * 2t ) simplifies calculations substantially, since the covariance matrix to be inverted in (28) reduces to a diagonal matrix.
Along the same lines we have and Cov(y t , x 2t ) = Cov and Cov(y t , x 1t ) = Cov t+∆t t d F n (x), ∞ t d F n (x)