title: Khmaladze transformation
text: # Khmaladze transformation
  
  In statistics, the Khmaladze transformation is a mathematical tool used in constructing convenient goodness of fit tests for hypothetical distribution functions. More precisely, suppose $X_{1},\ldots ,X_{n}$ are i.i.d., possibly multi-dimensional, random observations generated from an unknown probability distribution. A classical problem in statistics is to decide how well a given hypothetical distribution function $F$, or a given hypothetical parametric family of distribution functions $\{F_{\theta }:\theta \in \Theta \}$, fits the set of observations. The Khmaladze transformation allows us to construct goodness of fit tests with desirable properties. It is named after Estate V. Khmaladze.
  
  Consider the sequence of empirical distribution functions $F_{n}$ based on a sequence of i.i.d random variables, $X_{1},\ldots ,X_{n}$, as n increases. Suppose $F$ is the hypothetical distribution function of each $X_{i}$. To test whether the choice of $F$ is correct or not, statisticians use the normalized difference,
  
      $v_{n}(x)={\sqrt {n}}[F_{n}(x)-F(x)].$
  
  This $v_{n}$, as a random process in $x$, is called the empirical process. Various functionals of $v_{n}$ are used as test statistics. The change of the variable $v_{n}(x)=u_{n}(t)$, $t=F(x)$ transforms to the so-called uniform empirical process $u_{n}$. The latter is an empirical processes based on independent random variables $U_{i}=F(X_{i})$, which are uniformly distributed on $[0,1]$ if the $X_{i}$s do indeed have distribution function $F$.
  
  This fact was discovered and first utilized by Kolmogorov (1933), Wald and Wolfowitz (1936) and Smirnov (1937) and, especially after Doob (1949) and Anderson and Darling (1952), it led to the standard rule to choose test statistics based on $v_{n}$. That is, test statistics $\psi (v_{n},F)$ are defined (which possibly depend on the $F$ being tested) in such a way that there exists another statistic $\varphi (u_{n})$ derived from the uniform empirical process, such that $\psi (v_{n},F)=\varphi (u_{n})$. Examples are
  
      $\sup _{x}|v_{n}(x)|=\sup _{t}|u_{n}(t)|,\quad \sup _{x}{\frac {|v_{n}(x)|}{a(F(x))}}=\sup _{t}{\frac {|u_{n}(t)|}{a(t)}}$
  
  and
  
      $\int _{-\infty }^{\infty }v_{n}^{2}(x)\,dF(x)=\int _{0}^{1}u_{n}^{2}(t)\,dt.$
  
  For all such functionals, their null distribution (under the hypothetical $F$) does not depend on $F$, and can be calculated once and then used to test any $F$.
  
  However, it is only rarely that one needs to test a simple hypothesis, when a fixed $F$ as a hypothesis is given. Much more often, one needs to verify parametric hypotheses where the hypothetical $F=F_{\theta _{n}}$, depends on some parameters $\theta _{n}$, which the hypothesis does not specify and which have to be estimated from the sample $X_{1},\ldots ,X_{n}$ itself.
  
  Although the estimators ${\hat {\theta }}_{n}$, most commonly converge to true value of $\theta$, it was discovered that the parametric, or estimated, empirical process
  
      ${\hat {v}}_{n}(x)={\sqrt {n}}[F_{n}(x)-F_{{\hat {\theta }}_{n}}(x)]$
  
  differs significantly from $v_{n}$ and that the transformed process ${\hat {u}}_{n}(t)={\hat {v}}_{n}(x)$, $t=F_{{\hat {\theta }}_{n}}(x)$ has a distribution for which the limit distribution, as $n\to \infty$, is dependent on the parametric form of $F_{\theta }$ and on the particular estimator ${\hat {\theta }}_{n}$ and, in general, within one parametric family, on the value of $\theta$.
  
  From mid-1950s to the late-1980s, much work was done to clarify the situation and understand the nature of the process ${\hat {v}}_{n}$.
  
  In 1981, and then 1987 and 1993, Khmaladze suggested to replace the parametric empirical process ${\hat {v}}_{n}$ by its martingale part $w_{n}$ only.
  
      ${\hat {v}}_{n}(x)-K_{n}(x)=w_{n}(x)$
  
  where $K_{n}(x)$ is the compensator of ${\hat {v}}_{n}(x)$. Then the following properties of $w_{n}$ were established:
  
         $\omega _{n}(t)=w_{n}(x),t=F_{{\hat {\theta }}_{n}}(x)$
      is that of standard Brownian motion on $[0,1]$, i.e., is again standard and independent of the choice of $F_{{\hat {\theta }}_{n}}$.
  * The relationship between ${\hat {v}}_{n}$ and $w_{n}$ and between their limits, is one to one, so that the statistical inference based on ${\hat {v}}_{n}$ or on $w_{n}$ are equivalent, and in $w_{n}$, nothing is lost compared to ${\hat {v}}_{n}$.
  * The construction of innovation martingale $w_{n}$ could be carried over to the case of vector-valued $X_{1},\ldots ,X_{n}$, giving rise to the definition of the so-called scanning martingales in $\mathbb {R} ^{d}$.
  
  For a long time the transformation was, although known, still not used. Later, the work of researchers like Koenker, Stute, Bai, Koul, Koening, and others made it popular in econometrics and other fields of statistics.
  
  