\appendix
\chapter[Statistics in HEP data analysis]{Statistics in HEP data analysis\footnote{By Yong-Sheng Zhu}}
\label{appen_a_stat}
This Appendix provides an overview of two aspects of statistical
methods used in High Energy Physics (HEP): parameter estimation and
hypothesis testing. For details, the reader is recommended to refer to
the relevant textbooks~\cite{Eadie,Frodesen,Zhuys},
literature~\cite{PDG}, and references cited herein. In an HEP
experiment, an observable $x$ is usually a random
variable, its probabiliy distribution function, $pdf$, is 
expressed as $f(x,\theta)$ for a parameter
$\theta$ that is to be determined, and the observables
$x$, where: $\overrightarrow{x}=(x_{1},...,x_{n})^{T}$.  
The task of
statistical inference is to use the sample of 
measured data to determine
the value and error, or a confidence interval at given confidence
level, for the parameter $\theta$. This means the determination
of $f(x,\theta)$, the observable's $pdf$,
%
\section{Parameter estimation}
%
The parameter $\theta$ is estimated by a function of the
observed data: $\hat{\vartheta}(x_{1},...,x_{n})$, which is called
an {\it estimator} of $\theta$. The sample of observed data
$\overrightarrow{x}=(x_{1},...,x_{n})^{T}$ is also a random
variable, the value of the estimator from a specific measurement of
$(x_{1},...,x_{n})^{T}$ is called an estimate. Throughout this
Appendix, we will use same notation to denote estimate and
estimator.  

A good estimator should have the properties of consistency,
unbiasedness and high efficiency.
\begin{description}
\item[{\it Consistency}]means that when the size of the data sample
$(x_{1},...,x_{n})$ goes to infinity, the estimator $\hat{\theta}$
converges to the true value of parameter $\theta$.
\item[{\it Bias}]is defined as the difference of the
expectation of the estimator and the true value $\theta$:
$E(\hat{\theta)}=\theta+b(\theta)$.  Unbiasedness is a property
of an estimator for a finite sample, namely it requires
$E(\hat\theta)=\theta$. If the parameter
has to be estimated with a biased
estimator,  the bias $b$ of the estimator should be known or
be obtainable in some way.
\item[{\it Efficiency}]is a measure of the variance of an estimator. Under
the regularity conditions, namely if the range of $\vec{x}$ is
independent of $\theta$ and the first and second derivatives of the
sample's joint $pdf$ - Likelihood function
$L(\vec{x}|\theta)=\prod_{i=1}^n{f(x_i,\theta)}$ - with respect to
$\theta$ exist, there exists a lower bound on the variance of the
estimates derived from an estimator, which is called the minimum
variance bound MVB, given by the Cramer-Rao inequality:
\begin{equation}
MVB=\frac{(1+\frac{\partial b}{\partial \theta})}{I(\theta)},
\label{E1}
\end{equation}
where $I(\theta)$ is the Fisher information:
\begin{equation}
I(\theta)=E[(\frac{\partial \ln L}{\partial \theta})^{2}]=\int
(\frac{\partial \ln L}{\partial \theta})^{2} \cdot L d\vec{x} \\
         =E[-\frac{\partial^{2} \ln L}{\partial \theta^{2}}]=\int
(-\frac{\partial^{2} \ln L}{\partial \theta^{2}}) \cdot L d\vec{x}.
\label{E2}
\end{equation}
 The efficiency of an estimator $\hat{\theta}$ is defined as
$e(\hat{\theta})=MVB/V(\hat{\theta})$. Apparently, it is desireabe
that the efficiency of the estimator that is used is close to
or equal to 1.
\end{description}
\noindent
The mean-square error (MSE) of an estimator is a convenient quantity
that combines the uncertainties in an estimator due to its bias and
its variance:
\begin{equation}
MSE=E[(\hat{\theta}-\theta)^{2}]=V(\hat{\theta})+b^{2}. \label{E3}
\end{equation}
%
\subsection{Estimators for the mean and variance}
%
Suppose we are interested in the expectation 
value $\mu$ of an observable
$x$ (random variable) and its variance, $\sigma^{2}$. We have a set
of $n$ independent measurements $x_i$ that all have the same unknown
expectation $\mu$ and common unknown variance $\sigma^{2}$. This
corresponds to, for instance, a set of $n$ measurements of an
observable $x$ in an experiment. In this case, the consistent and 
unbiased estimate are the sample mean $\bar{x}$ and sample variance 
$S^{2}$, respectively:
\begin{equation}
\hat{\mu}=\bar{x}=\frac{1}{n}\sum_{i=1}^{n} x_{i}, \label{E4}
\end{equation}
\begin{equation}
\hat{\sigma^{2}}=S^{2}=\frac{1}{n-1}\sum_{i=1}^{n}
(x_{i}-\bar{x})^{2}. \label{E5}
\end{equation}
The variance of $\hat{\mu}$ is $\sigma^{2}/n$, while the variance of
$\hat{\sigma^{2}}$ is
\begin{equation}
V(\hat{\sigma^{2}})=\frac{1}{n}(m_{4}-\frac{n-3}{n-1}\sigma^{4}),
\label{E6}
\end{equation}
where $m_{4}$ is the 4$^{\rm th}$ central moment of $x$.

For a known $\mu$, the consistent, unbiased estimator of the variance
is
\begin{equation}
\hat{\sigma^{2}}=\frac{1}{n}\sum_{i=1}^{n} (x_{i}-\mu)^{2},
\label{E7}
\end{equation}
which gives a somewhat better estimator of $\sigma^{2}$ in comparison
to the Eq.~\ref{E5} result for 
the case of an unknown value of $\mu$. For  binomial, 
Poisson and Gaussian variables $x_{i}$, which are often 
encountered in data analysis, 
the sample mean is an efficient estimator for $\mu$; For
normal variables, Eq.~\ref{E7} is an efficient estimator of
$\sigma^{2}$ in the case of known $\mu$, and 
the sample variance $S^{2}$
is an asymptotic efficient estimator for $\sigma^{2}$.

For a Gaussian distributed variable $x_{i}$, Eq.~\ref{E6} becomes
$V(\hat{\sigma^{2}})=2\sigma^{4}/(n-1)$ for any $n\geq 2$, and for
large $n$ the standard deviation of $\hat{\sigma}$ 
(the ``error of the error") is $\sigma/\sqrt{2n}$.

In some cases,
the $x_{i}$ have different, known variances $\sigma_{i}^{2}$,
as in the situation that occurs when different experiments
measure the same quantity with different uncertainties. 
In this case, assuming that each
$x_{i}$ can be considered as a measurement of the Gaussian
distributed variable $N(\mu,\sigma_{i}^{2})$, then the unbiased
estimator of the physics quantity $\mu$ is the weighted average
\begin{equation}
\hat{\mu}=\frac{1}{\omega}\sum_{i=1}^{n} \omega_{i} x_{i},
\label{E8}
\end{equation}
where $\omega_{i}=1/\sigma_{i}^{2}$, $\omega=\sum_{i}\omega_{i}$,
and the standard deviation of $\hat{\mu}$ is $1/\sqrt{\omega}$.
%
\subsection{The method of maximum likelihood(ML)}
%
>From a statistical point of view, the method of maximum likelihood
(ML) is the most important general method of estimation, since the ML
estimator of parameter has many good properties.
%
\subsubsection{The ML estimators for parameter and its error}
%
Suppose $x_{i},i=1,...,n$ are  $n$ independent measurements of a
random variable $x$ with the  $pdf$  $f(x,\vec{\theta})$, where
$\vec{\theta}=(\theta_1,...,\theta_k)^T$ are $k$ parameters to be
determined.  Then the ML estimators $\hat{\vec{\theta}}(x_1,...,x_n)$
are the values of $\vec{\theta}$ that maximize the likelihood
function
\begin{equation}
L(\vec{x}|\hat{\vec{\theta}})=\prod_{i=1}^{n}f(x_{i};\vec{\theta}).
\label{E9}
\end{equation}
Since both $\ln L$ and $L$ are maximized for the same parameter
values $\vec{\theta}$, and it is usually easier to work with $\ln L$,
the ML estimators can be found by solving the likelihood
equations
\begin{equation}
\frac{\partial \ln L}{\partial \theta_{i}}=0, ~~~~~~i=1,...,k.
\label{E10}
\end{equation}

The ML estimator is invariant under change of a parameter, namely,
under a one-to-one change of parameters from $\vec{\theta}$ to
$\vec{\eta}$, the ML estimators $\hat{\vec{\theta}}$ transform to
$\vec{\eta}(\vec{\theta})$  :
$\hat{\vec{\eta}}(\vec{\theta})=\vec{\eta}(\hat{\vec{\theta}})$.
Moreover, the ML estimators are asymptotically unbiased. When the
likelihood function satisfies the regularity conditions,  ML
estimators are consistent estimators. If there are efficient
estimators for parameters or their functions, then these efficient
estimators must be the ML estimators, and the likelihood equations
give unique solutions; 
on the other hand, if efficient estimators do not
exist, the ML estimators give the minimum possible variance for
$\vec{\theta}$. For large $n$ and a likelihood function that
satisfies the regularity conditions, $\hat{\vec{\theta}}$ is
asymptotically distributed as a normal variable with a mean equal
to the true value of $\vec{\theta}$ and has a variance consistent with
the MVB.

ML estimators only give the values of the parameters. To extract
the errors of the parameters, one has to know their variances.
The expression of the covariance between the parameters
$\hat{\theta_{i}}$ and $\hat{\theta_{j}}$ for any sample size $n$
is
\begin{equation}
V_{ij}(\hat{\vec{\theta}})=\int
(\hat{\theta_{i}}-\theta_{i})(\hat{\theta_{j}}-\theta_{j})
L(\vec{x}|\vec{\theta})d\vec{x},~~~~~~~~ i,j=1,...,k. \label{E11}
\end{equation}
The calculation of this integral is sometimes troublesome; however,
it can always be calculated with numerical methods.

For the case that $\hat{\theta}$ is an efficient estimator of a single
parameter, the following equation is applicable for any sample size
$n$:
\begin{equation}
V(\hat{\theta})=\frac{(1+\frac{\partial b}{\partial
\theta})^{2}}{(-\frac{\partial^{2} \ln L}{\partial
\theta^{2}})_{\theta=\hat{\theta}}}. \label{E12}
\end{equation}
In particular, if $\hat{\theta}$ is an unbiased, efficient estimator,
\begin{equation}
V(\hat{\theta})=\frac{1}{(-\frac{\partial^{2} \ln L}{\partial
\theta^{2}})_{\theta=\hat{\theta}}}. \label{E13}
\end{equation}
\noindent
For multi-parameters and large $n$, if there exists a set of $k$
jointly sufficient statistics $t_1,...,t_k$ for the $k$ parameters
$\theta_1,...,\theta_k$, the inverse of the covariance matrix
$V_{ij}=cov(\hat{\theta_{i}},\hat{\theta_{j}})$ for a set of ML
estimators can be calculated from
\begin{equation}
V_{ij}^{-1}(\hat{\vec{\theta}})=(-\frac{\partial^{2}\ln L}{\partial
\theta_{i}\partial
\theta_{j}})_{\vec{\theta}=\hat{\vec{\theta}}}~,~~~~~ i,j=1,...,k.
\label{E14}
\end{equation}
For large $n$ and a likelihood function that satisfies the
regularity conditions, the ML estimators $\hat{\vec{\theta}}$ are
asymptotically distributed as a multi-dimensional normal variable,
and one has
\begin{equation}
V_{ij}^{-1}(\hat{\vec{\theta}})=
E(-\frac{\partial^{2}\ln L(\vec{x}|\vec{\theta})}
{\partial\theta_{i}\partial \theta_{j}})_{\vec{\theta}=
\hat{\vec{\theta}}} \\
=\int (-\frac{\partial^{2}\ln L(\vec{x}|\vec{\theta})}{\partial
\theta_{i}\partial
\theta_{j}})_{\vec{\theta}=\hat{\vec{\theta}}}\cdot Ld\vec{x},~~~~
i,j=1,...,k . \label{E15}
\end{equation}
Alternatively, one can use the  $pdf$ of the 
random variable $x$ to calculate the covariance matrix:
\begin{equation}
V_{ij}^{-1}(\hat{\vec{\theta}})=n\int \frac{1}{f}(\frac{\partial
f}{\partial \theta_{i}})(\frac{\partial f}{\partial \theta_{j}})dx,
~~~~~i,j=1,...,k. \label{E16}
\end{equation}
This last equation uses only the $pdf$ of the random
variable $x$ and the calculation does not 
need access to the measured data sample; this 
is particularly useful in the design stage of an experiment.

If the observable $x$ is a normal random variable, or the size of
the sample ($n$) is sufficiently large, the likelihood function is
asymptotically a normal distribution and $\ln L$ is a parabolic
function.  In this case, a numerically equivalent way of determining
the $s$-standard-deviation errors is from the contour given by 
$\vec{\theta}^{\prime}$ values satisfying
\begin{equation}
\ln L(\vec{\theta^{\prime}})=\ln L_{max}-\frac{s^{2}}{2}, \label{E17}
\end{equation}
where $L_{max}$ is the  value of $\ln L$ at the solution point. The
extreme limits of this contour on the $\theta_{i}$ axis give an
$s$-standard-deviation likelihood interval for $\theta_{i}$. In the
case $\ln L$ is not a parabolic function, the approximate
1-standard-deviation likelihood interval can also be estimated by
this equation, and it will give an asymmetric positive and negative
errors for each parameter, namely,
$\sigma^{+}(\theta_{i})\neq\sigma^{-}(\theta_{i}), i=1,...,k.$
%
\subsubsection{The ML method for binned data}
%
In the case that the size $n$ of the data sample
$\vec{x}=(x_{1},...,x_{n})^T$ is sufficiently large, the
measurements are often expressed in a histogram
with $m$ bins.  For
constant $n$, the likelihood function (joint $pdf$) of
$n_{j}(j=1,...,m)$ measurement values appearing in 
the $j^{\rm th}$ bin is
expressed as a multinomial distribution
\begin{equation}
L(n_{1},...,n_{m}|\vec{\theta})=n!\prod_{j=1}^{m}\frac{1}{n_{j}!}p_{j}^{n_{j}}.
\label{E18}
\end{equation}
The probability of one measurement value appearing in
the $j^{\rm th}$  bin (with width $\triangle x_{j}$)
is calculated from the $pdf$ $f(x|\vec{\theta})$
\begin{equation}
p_{j}=p_{j}(\vec{\theta})=\int_{\triangle x_{j}}f(x|\vec{\theta})dx.
\label{E19}
\end{equation}
The likelihood equation becomes
\begin{equation}
(\frac{\partial \ln L}{\partial
\theta_{}})_{\vec{\theta}=\hat{\vec{\theta}}}=\frac{\partial}{\partial
\theta_{j}}[\sum_{j=1}^{m}n_{j}\ln p_{j}(\vec{\theta})]_{\vec{\theta}
=\hat{\vec{\theta}}}=0, ~~~~~j=1,...,m, \label{E20}
\end{equation}
and solving this set of equations gives the ML estimators
$\hat{\vec{\theta}}$.
%
\subsubsection{The extended ML method}
%
If the size $n$ of the data sample is not a constant but a Poisson
random variable with the expectation $\nu$, then the likelihood
function is the product of the usual likelihood function and the Poisson
probability for observing $n$ events:
\begin{equation}
L(\nu,\vec{\theta})=\frac{\nu^{n}}{n!}e^{-\nu}\prod_{i=1}^{n}f(x_{i},\vec{\theta}),
\label{E21}
\end{equation}
which is called the extended likelihood function~\cite{Cowan}. In
this case the solutions of the likelihood equations
\begin{eqnarray}
\frac{\partial \ln L(\nu,\vec{\theta})}{\partial \theta_{j}}=0,~~~~~
j=1,...,k, \\ {\rm and}~~~~
\frac{\partial \ln L(\nu,\vec{\theta})}{\partial \nu}=0 ,\label{E22}
\end{eqnarray}
give the ML estimators $\hat{\vec{\theta}}$.

In the case that $\nu$ is irrelevant to $\vec{\theta}$, 
$\frac{\partial \ln L(\nu,\vec{\theta})}{\partial \nu}=0$ gives
$\hat{\nu}=n$, and the solutions of Eq. A.22 give the same
$\hat{\vec{\theta}}$ as those from Eqs.~\ref{E9}~and~\ref{E10}. If
$\nu$ is a function of $\vec{\theta}$, the likelihood function
becomes (dropping terms irrelevant to $\vec{\theta}$)
\begin{equation}
\ln L(\vec{\theta})=-\nu(\vec{\theta})+\sum_{i=1}^{n}
\ln[\nu(\vec{\theta})\cdot
f(x_{i},\vec{\theta})]. \label{E24}
\end{equation}
The variances of the ML estimators $\hat{\vec{\theta}}$ derived from
the extended likelihood function are usually smaller than those from
usual likelihood function because the former uses  the information
from both $n$ and $\vec{x}$.

For binned data, the extended likelihood function is
\begin{equation}
L(n_1,...,n_m|\vec{\theta})=\prod_{j=1}^{m}\frac{1}{n_{j}!}
\nu_{j}^{n_j}e^{-\nu_j}, \label{E25}
\end{equation}
where the expectations of $n_j$ and $\nu_j$, are
\begin{equation}
\nu_j=\nu\int_{\triangle x_j}f(x|\vec{\theta})dx,~~~~~
\nu=\sum_{j=1}^{m}\nu_j. \label{E26}
\end{equation}
In the case that $\nu$ is irrelevant to $\vec{\theta}$, the
likelihood equations become
\begin{equation}
\frac{\partial
\ln L}{\partial\theta_{j}}|_{\vec{\theta}=\hat{\vec{\theta}}}=
\frac{\partial}{\partial\theta_{j}}
[\sum_{j=1}^{m}n_{j}\ln\nu_{j}]_{\vec{\theta}=\hat{\vec{\theta}}}=0,
~~~~~j=1,...,m, \label{E27}
\end{equation}
which have the same form as Eq.~\ref{E20} with $p_{j}(\vec{\theta})$
replaced by $\nu_{j}(\vec{\theta})$, and $\hat{\nu}=n$. If $\nu$ is
a function of $\vec{\theta}$, then  the likelihood equations are
\begin{equation}
\frac{\partial
\ln L}{\partial\theta_{j}}|_{\vec{\theta}=\hat{\vec{\theta}}}=
\frac{\partial}{\partial\theta_{j}}
[\sum_{j=1}^{m}n_{j}\ln\nu_{j}-\nu]_{\vec{\theta}=\hat{\vec{\theta}}}=0,
~~~~~j=1,...,m. \label{E28}
\end{equation}
The variances of the ML estimators $\hat{\vec{\theta}}$ derived from
these equations are usually smaller than those from usual likelihood
function because the random property of $n$ has been taken into
account here.
%
\subsubsection{Combining measurements with ML method}
%
Suppose the observations frm two independent experiments are
$\vec{x}=(x_{1},...,x_{l})^T$ and $\vec{y}=(y_{1},...,y_{m})^T$, and
their $pdf$'s $f_{x}(x,\vec{\theta})$ and $f_{y}(y,\vec{\theta})$,
depend on the same parameters $\vec{\theta}$, which are the quantities
being measured in the experiments. The joint likelihood function of
these two experiments are
\begin{equation}
L(\vec{x},\vec{y};\vec{\theta})=L(\vec{x};\vec{\theta})\cdot
L(\vec{y};\vec{\theta})=\prod_{i=1}^{l}
f_{x}(x_{i},\vec{\theta})\prod_{j=1}^{m} f_{y}(y_{i},\vec{\theta}).
\label{E29}
\end{equation}
Solving the likelihood equations for this likelihood function with
respect to parameters $\vec{\theta}$ and obtaining the ML estimator
$\hat{\vec{\theta}}$ gives the combined measurement of these two
experiments for the parameters $\vec{\theta}$.

In the case when $f_{x}(x,\theta)$ and $f_{y}(y,\theta)$ are Gaussians
and the parameter $\theta$ is the mean, the combined
estimator of the parameter and its variance have the simple forms:
\begin{eqnarray}
\hat{\theta}=(\frac{\theta_{x}}{\sigma_{x}^{2}}+\frac{\theta_{y}}
{\sigma_{y}^{2}})/
(\frac{1}{\sigma_{x}^{2}}+\frac{1}{\sigma_{y}^{2}}), \\
V(\hat{\theta})=1/(\frac{1}{\sigma_{x}^{2}}+\frac{1}{\sigma_{y}^{2}}),
\label{E30}
\end{eqnarray}
where $\theta_{x}$ and $\sigma_{x}$ are the measured values of the
parameter $\theta$ and its error from experiment $x$, respectively.
The above expressions can be directly extended to the situation of
multiple experiments.

If the likelihood function is unknown, and only the results of
the parameter $\theta$ and its errors,
$\theta_{i},\sigma_{i}^{+},\sigma_{i}^{-}$, are reported in each
experiment, the combined results for the parameter $\theta$  and its
errors from multiple experiments can be deduced using a method suggested
by Barlow~\cite{Barlow}. The essence of the method is to use the
measured values $\theta_{i},\sigma_{i}^{+},\sigma_{i}^{-}$ to
construct an approximate parametric likelihood function for each
experiment. It is concluded that $variable$-$width$ Gaussians are the
best approximation for this purpose. The likelihood function can be
approximated as
\begin{equation}
\ln L(\theta_{i}|\theta)=-\frac{(\theta-\theta_{i})^{2}}{2V_{i}(\theta)},
\label{E32}
\end{equation}
where the true value of parameter is $\theta$, and the measured
value is $\theta_{i}$ from the $i^{\rm th}$ experiment. In the 
$linear~\sigma$~parametrization, we have
\begin{eqnarray}
V_{i}(\theta)=[\sigma_{i}(\theta)]^{2},~~~~~
\sigma_{i}(\theta)=\sigma_{i}+\sigma_{i}^{\prime}(\theta-\theta_{i}),\\
\sigma_{i}=\frac{2\sigma_{i}^{+}\sigma_{i}^{-}}{\sigma_{i}^{+}+\sigma_{i}^{-}},
~~~~~\sigma_{i}^{\prime}=\frac{\sigma_{i}^{+}-\sigma_{i}^{-}}
{\sigma_{i}^{+}+\sigma_{i}^{-}}, \label{E33}
\end{eqnarray}
where $\sigma_{i}^{+},\sigma_{i}^{-}$ are the measured positive and
negative errors of $\theta_{i}$ in the $i^{\rm th}$ experiment. In the
$linear~V$ parametrization,
\begin{eqnarray}
V_{i}(\theta)=V_{i}+V_{i}^{\prime}(\theta-\theta_{i}),\\
V_{i}=\sigma_{i}^{+}\sigma_{i}^{-},~~~~~
V_{i}^{\prime}=\sigma_{i}^{+}-\sigma_{i}^{-}. \label{E35}
\end{eqnarray}
 Thus, the joint likelihood function of
multiple experimental measurements of the parameter $\theta$ is 
approximately
\begin{equation}
\ln L(\theta)=-\frac{1}{2}\sum_{i}\frac{(\theta-\theta_{i})^{2}}{V_{i}(\theta)},
\label{E37}
\end{equation}
and the best estimate of $\theta$, $\hat{\theta}$, is determined by the
maximum of the above likelihood function. For the linear $\sigma$ form,
the solution is
\begin{eqnarray}
\hat{\theta}=\Sigma_{i}\omega_{i}\theta_{i}/\Sigma_{i}\omega_{i},\\
\omega_{i}=\frac{\sigma_{i}}{[\sigma_{i}+\sigma_{i}^{\prime}
(\hat{\theta}-\theta_{i})]^{3}}; \label{E38}
\end{eqnarray}
for the linear $V$ form, the solution is
\begin{eqnarray}
\hat{\theta}=\Sigma_{i}\omega_{i}[\theta_{i}-\frac{V_{i}^{\prime}}
{2V_{i}}(\hat{\theta}-\theta_{i})^{2}]/\Sigma_{i}\omega_{i},\\
\omega_{i}=\frac{V_{i}}{[V_{i}+V_{i}^{\prime}
(\hat{\theta}-\theta_{i})]^{2}}. \label{E40}
\end{eqnarray}
The two sets of 
equations shown above are non-linear in $\hat{\theta}$
and the solution must be found by iteration. The $\triangle \ln L$=0.5
points of the likelihood function in Eq.~\ref{E37} are used to
determine the positive and negative errors for $\hat{\theta}$, which
also need to be determined numerically.  A program for combining
results from multiple experiments using the parametrization of likelihood
functions can be obtained from
http://www.slac.stanford.edu/~barlow/statistics.html.
%
\subsection{The method of least squares (LS)}
%
%%%%%SLO%
%
\subsubsection{The LS estimator for a  parameter and its error}
%
Suppose that $n$ observations $\vec{y}=(y_{1},...,y_{n})^{T}$ 
are measured at $n$ points $\vec{x}=(x_{1},...,x_{n})^{T}$, the
covariance matrix of the observations $\vec{y}$ is given by
$V_{ij}=cov(y_{i},y_{j})$, and the true values of $\vec{y}$,
$\vec{\eta}$, are described by a model
$\eta_{i}=f(x_{i},\vec{\theta})$, $i=1,...,n$, where
$\vec{\theta}=(\theta_{1},...,\theta_{k})^{T}$ are the parameters to
be determined. The least squares (LS) estimators of $\vec{\theta}$,
$\hat{\vec{\theta}}$, can be found by minimizing the LS function
$Q^{2}(\vec{\theta})$ with respect to $\vec{\theta}$:
\begin{equation}
Q^{2}(\vec{\theta})=(\vec{y}-\vec{\eta}(\vec{\theta}))^{T}
V^{-1}(\vec{y}-\vec{\eta}(\vec{\theta}))
=\Sigma_{i=1}^{n}\Sigma_{j=1}^{n}
(y_{i}-\eta_{i})V_{ij}^{-1}(y_{j}-\eta_{j}). \label{E42}
\end{equation}
In the case where $y_{i},i=1,...,n$ are $n$ independent measurements,
the LS function has the simple form
\begin{equation}
Q^{2}(\vec{\theta})=\Sigma_{i=1}^{n}
\frac{(y_{i}-\eta_{i})^{2}}{\sigma_{i}^{2}}, \label{E43}
\end{equation}
where $\sigma_{i}$ is the error of $y_{i}$. In the common case where
$y_{i}$ is a Poisson variable, $\sigma_{i}^{2}$ can be 
approximated by $y_{i}$ or its predicted value $\eta_{i}$. 
If $y_{i},i=1,...,n$ are
$n$ independent Gaussians, $y_{i}\sim N(\eta_{i},\sigma_{i}^{2})$,
the likelihood function for $\vec{y}$ is $L(\vec{\theta})\propto
exp[-\frac{1}{2}\sum_{i=1}^{n}(\frac{y_{i}-\eta_{i}}{\sigma_{i}})^{2}]$.
In this case maximizing $L(\vec{\theta})$ with respect to parameters
$\vec{\theta}$ is equivalent to minimizing the LS function
$Q^{2}(\vec{\theta})=\Sigma_{i=1}^{n}
\frac{(y_{i}-\eta_{i})^{2}}{\sigma_{i}^{2}}$, namely, the estimators
of ML and LS methods for $\vec{\theta}$ are identical.

In the linear LS model, $i.e.$ when $f(x_{i},\vec{\theta})$ is a
linear function of $\vec{\theta}$:
\begin{equation}
f(x_{i},\vec{\theta})=\Sigma_{j=1}^{k} a_{ij}\theta_{j},
~~~~~i=1,...,n,~~ k<n, \label{E44}
\end{equation}
where $a_{ij}$ equals $x_{i}^{j-1}$ or is the $(j-1)^{\rm th}$ Legendre
polynomial of $x_{i}$, that minimizes the LS function
$Q^{2}(\vec{\theta})$ simplified to solve a set of $k$ linear
equations. Defining $a_{ij}$ as the elements of a $n\times k$
matrix $A$, the minimization of the LS function $Q^{2}(\vec{\theta})$ 
gives the LS estimator for the parameters $\vec{\theta}$:
\begin{equation}
\hat{\vec{\theta}}=(A^{T}V^{-1}A)^{-1}A^{T}V^{-1}\vec{y},
\label{E45}
\end{equation}
where the covariance matrix of $\hat{\vec{\theta}}$ is
\begin{equation}
V(\hat{\vec{\theta}})=(A^{T}V^{-1}A)^{-1}, \label{E46}
\end{equation}
or, equivalently,
\begin{equation}
(V^{-1}(\hat{\vec{\theta}}))_{ij}=\frac{1}{2}
\frac{\partial^{2}Q^{2}}{\partial\theta_{i}
\partial\theta_{j}}|_{\vec{\theta}=\hat{\vec{\theta}}}
=\Sigma_{l,m=1}^{n}a_{li}a_{mj}(V^{-1})_{lm},~~~~~i,j=1,...,k.
\label{E47}
\end{equation}
If $y_{i},i=1,...,n$ are independent each other, the non-diagonal
elements are equal to zero, and the above equation simplifies to
\begin{equation}
(V^{-1}(\hat{\vec{\theta}}))_{ij}
=\Sigma_{m=1}^{n}a_{mi}a_{mj}/\sigma_{m}^{2},~~~~~ i,j=1,...,k.
\label{E48}
\end{equation}
\noindent
The linear LS estimators provide  exact solutions for parameters
$\vec{\theta}$ that are unique and unbiased, and have minimum
variances.

Expanding $Q^{2}(\vec{\theta})$ about $\hat{\vec{\theta}}$, one
finds that the contour in parameter space defined by
\begin{equation}
Q^{2}(\vec{\theta})=Q^{2}(\hat{\vec{\theta}})+s^2=Q_{min}^{2}+s^2
\label{E49}
\end{equation}
has tangent planes located at $\pm s$~standard deviations
 from the LS estimates $\hat{\vec{\theta}}$.

For the linear LS model, if the observations $\vec{y}$ are
multi-normal variables, the minimum of the LS function
$Q^{2}(\vec{\theta})$,
\begin{equation}
Q_{min}^{2}(\vec{\theta})=\Sigma_{i=1}^{n}\Sigma_{j=1}^{n}
(y_{i}-\hat{\eta_{i}})V_{ij}^{-1}(y_{j}-\hat{\eta_{j}}), \label{E50}
\end{equation}
is a $\chi^{2}$ variable with $n-k$ degrees of freedom. This 
means that the $Q_{min}^{2}$ obtained by the LS method is a 
quantitative measure of
the consistency between the measured values $\vec{y}$ and their
fitted value $\hat{\vec{\eta}}$, $i.e.$, the $Q_{min}^{2}$
represents a measure of
the {\it goodness-of-fit} (see section A.3.1., goodness of fit
tests).

For the non-linear LS model,  $i.e.$ when $f(x_{i},\vec{\theta})$ is a
non-linear function of $\vec{\theta}$, the minimization of the
LS function $Q^{2}(\vec{\theta})$ is usually implemented via an
iterative procedure to obtain an approximate solution for 
$\hat{\vec{\theta}}$.
The non-linear LS estimator is a biased estimator, its variance does
not reach MVB, and the exact distribution of $Q_{min}^{2}$ is
unknown. However, if $n$ is sufficiently large, the LS estimator is
asymptotically unbiased, and its $Q_{min}^{2}$  is approximately a
$\chi^{2}$ variable.
%
\subsubsection{The LS method for binned data}
%
For a sufficiently large sample size of $n$ measurements,
$\vec{x}=(x_{1},...,x_{n})^T$, the results 
can be presented as a histogram with $m$ bins.
In the following, the observed number of 
measurements in the $j^{\rm th}$
bin is $n_{j}, j=1,...,m$ and its corresponding
expectation from the assumed model is
\begin{equation}
f_{j}(\vec{\theta})=np_{j},~~~~~ p_{j}(\vec{\theta})=\int_{\triangle
x_{j}}g(x|\vec{\theta})dx, \label{E51}
\end{equation}
where $g(x|\vec{\theta})$ is the $pdf$ of the observable $x$ and
$\vec{\theta}$ are the parameters to be determined. The
normalization $\Sigma_{j=1}^{m}p_{j}=1$ requires
\begin{equation}
\Sigma_{j=1}^{m}n_{j}=\Sigma_{j=1}^{m}f_{j}(\vec{\theta})=n.
\label{E52}
\end{equation}
It can be proved that for a given $n$, the LS function
$Q^{2}(\vec{\theta})$ has the form
\begin{equation}
Q^{2}(\vec{\theta})=\Sigma_{j=1}^{m}\frac{(n_{j}-np_{j})^{2}}{np_{j}}=
\Sigma_{j=1}^{m}\frac{(n_{j}-f_{j})^{2}}{f_{j}}. \label{E53}
\end{equation}
The $f_{j}$ in the denominator can be approximated by $n_{j}$.
The minimization of this LS function,
which usually has to be done by a numerical
iteration procedure,
leads to the LS estimates for the parameters
$\vec{\theta}$.
The $n_{j}$ are Poisson variables with the
expected values $np_{j}$. If $n$ is sufficiently large, $n_{j}$ can be
approximated by a Gaussian; then $(n_{j}-f_{j})/\sqrt{f_{j}}$ or
$(n_{j}-f_{j})/\sqrt{n_{j}}$ is approximately a standard normal
variable and, therefore, $Q_{min}^{2}(\vec{\theta})$ is distributed
approximately as a $\chi^{2}(m-1)$ variable, where the $m-1$ 
degrees of freedom are due to the existence of the constraint 
equation~\ref{E52}.

\subsubsection{General LS estimation with constraints}
%
Often in an estimation problem there exists a set of constraint
equations between the true values of observations $\eta_{i},
i=1,...,n$. A typical example is in the kinematic analysis of a
particle reaction or decay, where momentum and energy conservation
constitute a set of restrictions relating the various momenta
and angles for the particle combination defining the kinematic
hypothesis. Some of the quantities have been measured to a certain
accuracy (say, the momenta and angles of curved tracks), and some
are completely unknown (the variables for an undetected particle). The
purpose of the LS estimation is to investigate the kinematic
hypothesis: for a successful minimization, the constraint equations
will supply estimates for the unmeasured variables as well as
``improved measurements" for the input quantities.

Assume $\vec{y}=(y_{1},...,y_{n})^{T}$ are the measured values with
covariant matrix $V(\vec{y})$, let the true values of $\vec{y}$ be
$\vec{\eta}$. In addition, we have a set of $J$ unmeasured variables
$\vec{\xi}=(\xi_{1},...,\xi_{J})^{T}$. The $n$ measured and $J$
unmeasured variables are related by a set of $K$
constraint equations
\begin{displaymath}
f_k(\vec{\eta},\vec{\xi})=0,~~~~~    k=1,...,K.
\end{displaymath}
According to the LS principle, we should adopt as the best estimates
of the unknown $\vec{\eta}$ and $\vec{\xi}$, those values for which
\begin{eqnarray}
Q^{2}(\vec{\eta})=(\vec{y}-\vec{\eta})^{T}V^{-1}(\vec{y})(\vec{y}-\vec{\eta})
=minimum,\\
f(\vec{\eta},\vec{\xi})=\vec{0}. \label{E54}
\end{eqnarray}
Usually the method of the Lagrangian multipliers is used to solve
the above equations. We introduce $K$ additional unknowns
$\vec{\lambda}=(\lambda_{1},...,\lambda_{K})^T$ and rephrase the
problem by requiring
\begin{equation}
Q^{2}(\vec{\eta},\vec{\xi},\vec{\lambda})=
(\vec{y}-\vec{\eta})^{T}V^{-1}(\vec{y})(\vec{y}-\vec{\eta})
+2\vec{\lambda}^{T}\vec{f}(\vec{\eta},\vec{\xi})=minimum.
\label{E55}
\end{equation}
We have now a total of $n+J+K$ unknowns. When the derivatives of
$Q^{2}$ with respect to all unknowns are put equal to zero we get
following set of equations
\begin{eqnarray}
V^{-1}(\vec{y})(\vec{\eta}-\vec{y})+F_{\eta}^{T}\vec{\lambda}=\vec{0},\\
F_{\xi}^{T}\vec{\lambda}=\vec{0},\\
\vec{f}(\vec{\eta},\vec{\xi})=\vec{0}, \label{E56}
\end{eqnarray}
where the matrices $F_{\eta}$ (of dimension $K\times N$) and
$F_{\xi}$ (of dimension $K\times J$) are defined as
\begin{equation}
(F_{\eta})_{ki}\equiv\frac{\partial f_{k}}{\partial \eta_{i}},~~~~~
(F_{\xi})_{kj}\equiv\frac{\partial f_{k}}{\partial\xi_{j}}.
\label{E59}
\end{equation}
The solution to this set of equations for the $n+J+K$ unknowns and
their errors must usually be found by an an iterative process
that produces successively better approximations.


If in the linear LS estimation problem for the $n$ measured and $J$
unmeasured variables that are related by a  set
of $K$ constraint equations, the measured values
$\vec{y}=(y_{1},...,y_{n})^{T}$ is a multi-normal variable, then 
$Q^2_{min}$ is a $\chi^2$ variable with $K-J$ degrees of freedom.
For the case of a non-linear LS estimation problem, {\it i.e.} one 
with non-linear constraint equations and/or
where $\vec{y}$ are not multi-normal
variables, $Q^2_{min}$ can be approximated by $\chi^2(K-J)$.


The momentum-energy conservation laws constitute a set of four
constraint equations. If all the particles' parameters in a reaction
or a decay process have been measured ({\it i.e.} there
are no unmeasured variables)
and the momentum-energy conservation laws are applied to obtain
better particle parameter values (4C kinematic fit), the
$Q^2_{min}$ of the LS estimator is then an approximate $\chi^2(4)$
variable. If there exist $J$ unmeasured variables and $r$
intermediate states that promptly decay to observed final
state particles, and the invariant masses of 
the daughter particle combinations 
are constrained to their mother particles' masses,
then $Q^2_{min}$ is approximately a $\chi^2(4+r-J)$ variable.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 %\input{chap2}             %%% interval estimation
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
\section{Interval estimation, confidence interval and upper limit}
%
The task of the interval estimation is to locate a region that
contains the true value of the parameter $\theta$  with
a probability $\gamma$. This region is called the confidence
interval with coverage probability $\gamma$. When the goal of an
experiment is to determine a parameter $\theta$, the result is
usually expressed by quoting, in addition to the point estimate,
some sort of confidence interval that reflects the statistical
precision of the measurement. In the simplest case, this can be given
by the parameter's estimated value $\hat{\theta}$ plus/minus an
estimate of the standard deviation of $\hat{\theta}$,
$\sigma_{\hat{\theta}}$. If the value of the parameter $\theta$ has 
a boundary (throughout this Appendix, without losing generality we 
assume it is lower boundary with the
value zero),  and the estimated value of $\theta$
in an experiment is close to this boundary, then the determination
of the interval estimation is difficult and needs to be treated in
special way.
%
\subsection{Frequentist confidence interval}
%
\subsubsection{Neyman method for confidence interval}
%
Confidence interval refers to the frequentist interval obtained 
using a procedure due to Neyman~\cite{Neyman}. Consider the $pdf$
$f(x;\theta)$ where $x$ represents the measurement in an experiment
and $\theta$ the unknown parameter for which we want to construct a
confidence interval. The variable $x$ could (and often does)
represent an estimator of $\theta$. Using $f(x;\theta)$ we can find
for a pre-specified probability $\gamma=1-\alpha$ and for every
value of $\theta$ a set of values $x_{1}(\theta,\alpha)$ and
$x_{2}(\theta,\alpha)$ such that
\begin{equation}
P(x_{1}<x<x_{2};\theta)=1-\alpha\equiv
\gamma=\int_{x_{1}}^{x_{2}}f(x;\theta)dx. \label{E61}
\end{equation}
  This is illustrated in Fig.~\ref{F1}: a horizontal line
segment $[x_{1}(\theta,\alpha),x_{2}(\theta,\alpha)]$ is drawn for
representative values of $\theta$. The union of such intervals for
all values of $\theta$, designated in the figure as $D(\alpha)$, is
known as the confidence belt. Typically the curves
$x_{1}(\theta,\alpha)$ and $x_{2}(\theta,\alpha)$ are monotonic
functions of $\theta$, which we assume for this discussion.
%
\begin{figure}[hbt]
\centerline{\psfig{file=Appendix/PDGfig_01.ps,height=5 cm,width=5 
cm}}
\caption{\label{F1} Construction of the confidence belt}
\end{figure}

Upon performing an experiment to measure $x$ and obtaining a value
$x_{0}$, one draws a vertical line through $x_{0}$. The confidence
interval for $\theta$ is the set of all values of $\theta$ for which
the corresponding line segment
$[x_{1}(\theta,\alpha),x_{2}(\theta,\alpha)]$ is intercepted by this
vertical line. Such confidence intervals are said to have a
confidence level (CL) equal to $\gamma=1-\alpha$.

Now suppose that the true value of $\theta$ is $\theta_{0}$, as
indicated in the figure. We see from the figure that $\theta_{0}$
lies between $\theta_{1}(x)$ and $\theta_{2}(x)$ if and only if $x$
lies between $x_{1}(\theta_{0})$ and $x_{2}(\theta_{0})$. The two
events thus have the same probability and, since this is true for
any value $\theta_{0}$, we can drop the subscript 0 and obtain
\begin{equation}
\gamma=1-\alpha=P(x_{1}(\theta)<x<x_{2}(\theta))=
P(\theta_{2}(x)<\theta<\theta_{1}(x)). \label{E62}
\end{equation}
In this probability statement $\theta_{1}(x)$ and $\theta_{2}(x)$,
$i.e.$, the endpoints of the interval, are the random variables and
$\theta$ is an unknown constant. If the experiment were to be
repeated a large number of times, the interval
$[\theta_{1},\theta_{2}]$ would vary, covering the fixed value
$\theta$ in a fraction $\gamma=1-\alpha$ of the experiments.

The condition of coverage probability does not determine $x_{1}$ and
$x_{2}$ uniquely and additional criteria are needed. The most common
criterion is to choose central intervals such that the probabilities
below $x_{1}$ and above $x_{2}$ are each $\alpha/2$. In other cases
one may want to report only an upper or lower limit, then the
probability excluded below $x_{1}$ or above $x_{2}$ can be set to
zero.

When the observed random variable $x$ is continuous, the coverage
probability obtained with the Neyman construction is
$\gamma=1-\alpha$, regardless of the true value of the parameter. If
$x$ is discrete, however, it is not possible to find segments
$[x_{1}(\theta,\alpha),x_{2}(\theta,\alpha)]$ that satisfy
Eq.~\ref{E62} exactly for all values of $\theta$. By convention one
constructs the confidence belt requiring the probability
$P(x_{1}<x<x_{2})$ to be greater than or equal to $\gamma=1-\alpha$.
This gives confidence intervals that include the true parameter with
a probability greater than or equal to $\gamma=1-\alpha$.
%
\subsubsection{Gaussian distributed measurements}
%
An important example of confidence interval construction is when
the data consist of a single random variable $x$ that follows a
Gaussian distribution; this is often the case when $x$ represents an
estimator for a parameter and one has a sufficiently large data
sample. If there is more than one parameter being estimated, a
multivariate Gaussian is used. For the univariate case with known
$\sigma$,
\begin{equation}
\gamma=1-\alpha=\frac{1}{\sqrt{2\pi\sigma}}\int_{\mu-\delta}^{\mu+\delta}
e^{-(x-\mu)^2/2\sigma^2}dx=erf(\frac{\delta}{\sqrt{2}\sigma})
\label{E63}
\end{equation}
is the probability that the measured value $x$ will fall within
$\pm\delta$ of the true value $\mu$. From the symmetry of the
Gaussian with respect to $x$ and $\mu$, this is also the probability
for the interval $x\pm\delta$ to include $\mu$. The choice
$\delta=\sigma$ gives an interval called the standard error which
has $\gamma=1-\alpha=68.27\%$ if $\sigma$ is known. Values of
$\alpha$ for other frequently used choices of $\delta$ are given in
Table~\ref{T1}. The relation of $\alpha$ and  $\delta$ can be also
represented by the cumulated distribution function for the $\chi^2$
distribution for $\chi^2=(\delta/\sigma)^2$ and $n=1$
 degree of freedom:
\begin{equation}
\gamma= 1-\alpha=F(\chi^2;n=1). \label{E64}
\end{equation}
%
\begin{table}[htbp]
\caption{Area of the tails $\alpha$ outside $\pm\delta$ from the
mean of a Gaussian distribution.} \center
\begin{tabular}{|c|c|c|c|}\hline
$\alpha$             & $\delta$ & $\alpha$ &$\delta$      \\\hline
0.3173               & $1\sigma$ &0.2      & $1.28\sigma$ \\
0.0455               & $2\sigma$ &0.1      & $1.64\sigma$ \\
0.0027               & $3\sigma$ &0.05     & $1.96\sigma$ \\
$ 6.3\times 10^{-5}$ & $4\sigma$ &0.01     & $2.58\sigma$ \\
$ 5.7\times 10^{-7}$ & $5\sigma$ &0.001    & $3.29\sigma$ \\
$ 2.0\times 10^{-9}$ & $6\sigma$ &0.0001   & $3.89\sigma$ \\\hline
\end{tabular}
\label{T1}
\end{table}
%
For multivariate measurements of, say, $n$ parameter estimates
$\hat{\vec{\theta}}=(\hat{\theta_1},...,\hat{\theta_n})^T$, one
requires the full covariance matrix
$V_{ij}=cov(\hat{\theta_i},\hat{\theta_j})$, which can be estimated
by the ML or LS method.

If the parameters $\vec{\theta}$ are estimated with the ML method
using a sufficiently large data sample ($n$), and the 
likelihood function satisfies the regularity conditions, 
the likelihood function will be distributed
asymptotically as a multi-Gaussian and we have
\begin{equation}
\ln L(\vec{\theta})=\ln L_{max}-Q(\vec{\theta})/2, \label{E65}
\end{equation}
where $Q(\vec{\theta})=(\vec{\theta}-\hat{\vec{\theta}})^T
V^{-1}(\vec{\theta})(\vec{\theta}-\hat{\vec{\theta}})$ is
asymptotically a $\chi^2(k)$ variable, and $k$ is the dimension of
$\vec{\theta}$. The intersection contour of the super-plane
$\ln L=\ln L_{max}-Q_{\gamma}/2$ and super-surface 
$\ln L(\vec{\theta})$
forms the boundary of the confidence region of $\vec{\theta}$ with
coverage probability of $\gamma= 1-\alpha$, which is calculated by
the cumulated $\chi^2$ function
\begin{equation}
\gamma= 1-\alpha=P(Q\leq
Q_\gamma)=\int_{0}^{Q_\gamma}\chi^2(Q;\nu=k)dQ=F_\alpha(Q_\gamma;\nu=k).
\label{E66}
\end{equation}

In the case that the parameters $\vec{\theta}$ are estimated using the LS
method with a linear LS estimator and multi-Gaussian measurements, we
have
\begin{equation}
Q^2(\vec{\theta})=Q^2_{min}+Q^2_{LS}, \label{E67}
\end{equation}
where $Q^2_{LS}(\vec{\theta})=(\vec{\theta}-\hat{\vec{\theta}})^T
V^{-1}(\vec{\theta})(\vec{\theta}-\hat{\vec{\theta}})$ is a
$\chi^2(k)$ variable and $k$ is the dimension of $\vec{\theta}$ for
the no-constraint case, and the dimension of $\vec{\theta}$
minus the number of independent linear constraint equations for
the constraint case. The intersection contour of the super-plane
$Q^2(\vec{\theta})=Q^2_{min}+Q_{\gamma}$ and super-surface
$Q^2(\vec{\theta})$ forms the boundary of the confidence region of
$\vec{\theta}$ with coverage probability of $\gamma\equiv 1-\alpha$,
which is also calculated by Eq.~\ref{E66}. Values of $Q_\gamma$ for
$k=1,2,3$ are given in Table~\ref{T1p} for several values of the
coverage probability $\gamma=1-\alpha$.
%
\begin{table}[htbp]
\caption{$Q_\gamma$ for $k=1,2,3$ corresponding to a coverage
probability $\gamma=1-\alpha$ in the large data sample limit.}
\center
\begin{tabular}{|c|ccc|}\hline
$\gamma$(\%) & k=1  & k=2   & k=3    \\\hline
68.27        & 1.00 & 2.30  & 3.53 \\
90.          & 2.71 & 4.61  & 6.25 \\
95.          & 3.84 & 5.99  & 7.82 \\
95.45        & 4.00 & 6.18  & 8.03 \\
99.          & 6.63 & 9.21  &11.34 \\
99.73        & 9.00 &11.83  &14.16 \\\hline
\end{tabular}
\label{T1p}
\end{table}
%

If the above-mentioned conditions are not fully satisfied, the confidence
region determined from Eqs.~\ref{E65} and~\ref{E67} are only approximate.

The ML method has the advantage that it allows for an
easier calculation of the
confidence region for the
combination of several independent measurements of the
same parameters. Assume $N$ independent measurements give likelihood
functions $\ln L_i(\vec{\theta}),i=1,...,N$, then the combined
likelihood function is simply
\begin{equation}
\ln L(\vec{\theta})=\sum_{i}^{N}\ln L_i(\vec{\theta}). \label{E68}
\end{equation}
Then, by using this likelihood function in Eq.~\ref{E65}, one can get the
confidence region with coverage probability $\gamma$ for the combined
estimate $\hat{\vec{\theta}}$.
%
\subsubsection{Poisson distributed measurements}
%
If $n$ represents the number of events produced in a reaction with
cross section $\sigma$, say with a fixed integrated luminosity $L$,
then it follows a Poisson distribution with mean $s=\sigma L$ in the
case there is no background. Therefore, to determine the cross
section for a reaction or the branching ratio for a decay process in
terms of the number of observed events, the interval estimate for
Poisson distributed data must be used. The probability of observing
$n$ events in a Poisson distribution with  mean $s$ is
\begin{equation}
P(n,s)=\frac{s^{n}e^{-s}}{n!}. \label{E69}
\end{equation}
The upper and lower (one-sided) limits on the mean $s$  can be found
from the Neyman procedure to be
\begin{equation}
s_{lo}=\frac{1}{2}F^{-1}_{\chi^{2}}(\alpha_{lo};2n), \label{E70}
\end{equation}
\begin{equation}
s_{up}=\frac{1}{2}F^{-1}_{\chi^{2}}(1-\alpha_{up});2(n+1)),
\label{E71}
\end{equation}
where the upper and lower limits are at confidence levels of
$1-\alpha_{lo}$ and $1-\alpha_{up}$, respectively, and
$F^{-1}_{\chi^{2}}$ is the quantile of the $\chi^{2}$ distribution
(inverse of the cumulative distribution). The quantiles
$F^{-1}_{\chi^{2}}$ can be obtained from standard tables or from the
CERNLIB routine CHISIN. For central confidence intervals at CL
$1-\alpha$, set $\alpha_{lo}=\alpha_{up}=\alpha/2$. Values for
confidence levels of $90\%$ and $95\%$ are shown in Table~\ref{T2}.
%
\begin{table}[htbp]
\caption{Lower and upper (one-sided) limits for the mean $s$ of a
Poisson variable given $n$ observed events in the absence of
background, for CL of $90\%$ and $95\%$}. \center
\begin{tabular}{|c|cc|cc|}\hline
     &$1-\alpha=90\%$&     &$1-\alpha=95\%$ &     \\\hline
 $n$ &$s_{lo}$&$s_{up}$&$s_{lo}$&$s_{up}$ \\\hline
0    &          & 2.30     &          &  3.00 \\
1    &   0.105  & 3.89     &  0.051   &  4.74 \\
2    &   0.532  & 5.32     &  0.355   &  6.30 \\
3    &   1.10   & 6.68     &  0.818   &  7.75 \\
4    &   1.74   & 7.99     &  1.37    &  9.15 \\
5    &   2.43   & 9.27     &  1.97    & 10.51 \\
6    &   3.15   &10.53     &  2.61    & 11.84 \\
7    &   3.89   &11.77     &  3.29    & 13.15 \\
8    &   4.66   &12.99     &  3.98    & 14.43 \\
9    &   5.43   &14.21     &  4.70    & 15.71 \\
10   &   6.22   &15.41     &  5.43    & 16.96 \\\hline
\end{tabular}
\label{T2}
\end{table}
%

If the number of observed events $n$ contains both signal and
background events, which are both Poisson variables with means $s$ and
$b$, respectively, then we have
\begin{equation}
P(n,s)=\frac{(s+b)^{n}e^{-(s+b)}}{n!}. \label{E72}
\end{equation}
For a specific value of $s$, the upper and lower limit of the
central confidence region, $[n_{l},n_{u}]$, and the lower limit of
the upper confidence belt, $n_{l_{0}}$, at given confidence level
$\gamma=1-\alpha$ can be determined from
\begin{equation}
\sum_{n=0}^{n_{l}}P(n,s)\leq\frac{\alpha}{2},~~~~~
\sum_{n=n_{u}+1}^{\infty}P(n,s)\leq\frac{\alpha}{2}, \label{E73}
\end{equation}
\begin{equation}
\sum_{n=0}^{n_{lo}} P(n,s)\leq\alpha, \label{E74}
\end{equation}
respectively.  For all $s$ values, such calculations can give either 
a confidence belt for the central region and/or an upper confidence 
belt.  The inequality sign is to ensure that the actual coverage is 
greater or equal to the given coverage in the discrete variable case.
%

\subsubsection{Confidence interval near a physical boundary}
%
A number of issues arise in the construction and interpretation of
confidence intervals when the parameter can only take on values in a
restricted range. An important case is where the mean of a
Gaussian variable is constrained on physical grounds to be
non-negative. This arises, for example, when the square of the
neutrino mass is estimated from $\hat{m}^2=\hat{E}^2-\hat{p}^2$,
where $\hat{E}$ and $\hat{p}$ are independent, Gaussian-distributed
estimates of the energy and momentum. Although the true $m^2$ is
constrained to be positive, random errors in $\hat{E}$ and $\hat{p}$
can easily lead to negative values for the estimate  $\hat{m}^2$.

If one uses the prescription given above for Gaussian-distributed
measurements, which says to construct the interval by taking the
estimate plus/minus one standard deviation, one can find
intervals that are partially or entirely in the unphysical region.
In fact, by following strictly the Neyman construction for the
central confidence interval, one finds that the interval is
truncated below zero; nevertheless an extremely small or even a
zero-length interval can result.

An additional important example is when the experiment consists of
counting a certain number of events, $n$, which is assumed to be
Poisson distributed. Suppose the expectation value $E(n)=\mu$ is
equal to $s+b$, where $s$ and $b$ are the means for signal and
background processes, and assume further that $b$ is a known
constant. Then $\hat{s}=n-b$ is an unbiased estimator for $s$.
Depending on true magnitudes of $s$ and $b$, the estimate $\hat{s}$
can easily fall in the negative region. Similar to the Gaussian case
with a positive mean, the central confidence interval or even the
upper limit for $s$ may be of zero length.

An additional difficulty arises when a parameter estimate is not
significantly far away from the boundary, in which case it is
natural to report a one-sided confidence interval (often an upper
limit). It is straightforward to force the Neyman prescription to
produce only an upper limit by setting $x_2=\infty$ in Eq.~\ref{E61}.
Then $x_1$ is uniquely determined and the upper limit can be
obtained. If, however, the data indicate a parameter
estimate that is not too close to the boundary, one might wish to report a
central ($i.e.$, two-sided) confidence interval. However, as 
pointed out by
Feldman and Cousins~\cite{FC}, if the decision to report an
upper limit or two-sided interval is made by looking at the data
(``flip-flopping"), the resulting intervals will not in general
cover the parameter with the probability $1-\alpha$.

The confidence interval prescription suggested by Feldman and
Cousins~\cite{FC}, determines whether the interval
is one- or two-sided in a way that preserves the coverage
probability. Intervals with this property are said to be unified.
Furthermore, their prescription is such that null intervals do not
occur. For a given choice of $1-\alpha$, if the parameter estimate
is sufficiently close to the boundary, then the method gives a
one-sided limit. In the case of a Poisson variable in the presence
of background, for example, this would occur if the number of
observed events is compatible with the expected background. For
parameter estimates increasingly far away from the boundary, $i.e.$,
for increasing signal significance, the interval makes a smooth
transition from one- to two-sided; far away from the boundary
one obtains a central interval. The intervals according to this
method for the mean of a Poisson variable in the absence of background
are given in Table~\ref{T3}.
\begin{table}[htbp]
\caption{Unified confidence interval $[s_1,s_2]$ for a mean $s$ of a
Poisson variable given $n$ observed events in the absence of
background, for CL of $90\%$ and $95\%$}. \center
\begin{tabular}{|c|cc|cc|}\hline
     &$1-\alpha=90\%$&     &$1-\alpha=95\%$ &     \\\hline
 $n$ &$s_{1 }$&$s_{2}$ &$s_{1}$ &$s_{2}$  \\\hline
0    &   0.00   & 2.44     &  0.00    &  3.09 \\
1    &   0.11   & 4.36     &  0.05    &  5.14 \\
2    &   0.53   & 5.91     &  0.36    &  6.72 \\
3    &   1.10   & 7.42     &  0.82    &  8.25 \\
4    &   1.47   & 8.60     &  1.37    &  9.76 \\
5    &   1.84   & 9.99     &  1.84    & 11.26 \\
6    &   2.21   &11.47     &  2.21    & 12.75 \\
7    &   3.56   &12.53     &  2.58    & 13.81 \\
8    &   3.96   &13.90     &  2.94    & 15.29 \\
9    &   4.36   &15.30     &  4.36    & 16.77 \\
10   &   5.50   &16.50     &  4.75    & 17.82 \\\hline
\end{tabular}
\label{T3}
\end{table}
%

The intervals constructed according to the unified procedure of
Ref.~\cite{FC} for a Poisson variable $n$ consisting of signal and
background have the property that for $n=0$ observed events, the
upper limit decreases for increasing expected background. This is
counter-intuitive, since it is known that if $n=0$ for the
experiment in question, then no background was observed, and
therefore one may argue that the expected background should not be
relevant. Roe and Woodroofe~\cite{RW} proposed a solution to this
problem based on the fact that, given an observation $n$, the
background $b$ cannot be larger than $n$ in any case. Therefore,
the usual Poisson $pdf$ should be replaced by a conditional $pdf$,
and this conditional $pdf$ is used to construct the  confidence
intervals following the Feldman and Cousins' procedure.
%
\subsubsection{Confidence interval incorporating
systematic uncertainties}
%
A modification of the Neyman method that incorporates systematic
uncertainties of the signal detection efficiency has been proposed by
Highland and Cousins~\cite{HC}. For this, a ``semi-Bayesian" approach
is adopted, where an average over the probability of the detection
efficiency is performed. This method is of limited accuracy in the
limit of high relative systematic uncertainties. On the other hand,
an entirely frequentist approach has been proposed for treating the
uncertainty in the background rate prediction~\cite{RL}. This
approach is based on a two-dimensional confidence belt construction
and likelihood-ratio hypothesis testing and treats the uncertainty
in the background as a statistical uncertainty rather than as a
systematic one. Recently, Conrad $et~al.$ extended the method of
confidence belt construction proposed in~\cite{Conrad} to include
systematic uncertainties  in both the signal and background
efficiencies as well as systematic uncertainties in the background
expectation prediction. Their prescription takes into account the 
systematic uncertainties by assuming a $pdf$ that parameterizes 
one's knowledge of the uncertainties and then integrating over 
this $pdf$.  This method, which
combines classical and Bayesian elements, is referred to as a
semi-Bayesian approach. A FORTRAN program, POLE, has been coded to
calculate the confidence intervals for a maximum of observed events
of 100 and a maximum signal expectation of 50~\cite{POLE}.
%
\subsection{Bayesian confidence intervals}
%
In the Bayesian approach one has to assume a prior $pdf$ for an unknown
parameter and then perform an experiment that updates this prior
distribution. The prior $pdf$ reflects the experimenter's subjective
degree of belief about an unknown parameter before the measurement was
carried out. The updated prior, called the posterior $pdf$, is used to
draw inferences on the unknown parameter. This updating is done using the
Bayes theorem~\cite{Bayes}. Assuming that $n$  represents the
number of observed events, $s$  is the expectation of the number of
signal events which is unknown and to be inferred, $p(s|n)$  is the
conditional $pdf$ of observing $n$ events with given signal $s$,
$\pi(s)$  is the prior $pdf$, the Bayes theorem gives the posterior
$pdf$:
\begin{equation}
h(s|n)=\frac{p(s|n)\pi(s)}{\int_{0}^{\infty}p(s|n)\pi(s)ds}.
\label{E75}
\end{equation}
Here the lower limit of the integral is zero, which is the possible
minimum of the signal expectation. Using this posterior $pdf$, one
can calculate a Bayesian confidence interval for the signal
expectation $s$ at a given confidence level $CL=1-\alpha$:
\begin{equation}
1-\alpha=\int_{s_L}^{s_U}h(s|n)ds . \label{E76}
\end{equation}
However, such intervals are not uniquely determined. Often, the
highest posterior density (HPD) confidence interval $I$  is chosen,
which is determined from:
\begin{equation}
1-\alpha=\int_{I}h(s|n)ds,~~~  h(s_1|n)\geq h(s_2|n)~~~for ~any~
s_1\in I~ and~  s_2\notin I. \label{E77}
\end{equation}
The upper limit of the signal expectation $s$ at a given confidence
level $CL=1-\alpha$, $s_{UP}$, is naturally given by:
\begin{equation}
1-\alpha=\int_{0}^{s_{UP}} h(s|n)ds. \label{E78}
\end{equation}
A nice feature of the Bayesian approach is that the zero value of
an upper limit $s_{UP}$  always corresponds to the zero value of
confidence level $CL=1-\alpha$, which is not necessarily true for
the classical approach. The most important issue is the determination 
the prior $pdf$ for the parameter. This is the issue that causes most of
the controversies regarding Bayesian methods. An important question is 
whether one should use an $informative$ prior, $i.e.$, a prior that
incorporates results from previous experiments, or a $non$-$informative$
 prior, $i.e.$, a prior that reflects total ignorance.  The major
objection against an informative prior is based on 
the following argument: if we
assume a prior that incorporates the results of previous experiments,
then our measurement will not be independent, hence, we will not be
able to combine our results with previous results by taking a
weighted average.

Thus, we only discuss the Bayesian inference that assumes a
non-informative prior $pdf$ for a non-negative parameter of a
Poisson distribution. For the case where, in the ``signal region" 
--where the signal events have to reside -- the 
number of signal events is a Poisson
variable with unknown expectation $s$, and the number of background
events is a Poisson variable with expectation $b$, the conditional
$pdf$ for observing a total number of events $n$, $p(s|n)$, can be 
represented by
\begin{equation}
P(s|n)=\frac{(s+b)^{n}e^{-(s+b)}}{n!}. \label{E72p}
\end{equation}
 To deduce the posterior $pdf$, one has to assume a
prior $pdf$. Bayes stated that the non-informative prior for any
parameter must be flat~\cite{Bayes}. This statement was not based
on any strict mathematical argument, but merely his intuition. The
obvious weakness of the Bayes prior $pdf$ is that if one can assume a
flat distribution for an unknown parameter, then one can also assume
a flat distribution for any function of this parameter, and the
resulting two prior functions are apparently not identical.
Jeffreys~\cite{Jeffreys} resolves this problem by introducing an
invariate non-informative prior $pdf$ that can be deduced from
Fisher information. For the $pdf$ of Eq.~\ref{E72p}, the
Jeffreys prior $pdf$ is proportional to $1/\sqrt{s+b}$ . In general,
we can use a prior $pdf$ of the form
\begin{equation}
\pi(s)\propto \frac{1}{(s+b)^m},~~~~~s\geq 0,~~ 0\leq m\leq 1,
\label{E79}
\end{equation}
where $m=0$ corresponds to the Bayes prior, and $m=0.5$ to 
the Jeffreys prior.  One can choose the $m$ value 
as he/she thinks appropriate, however, it
should always be kept in mind that different $m$ values will give
different answers for the confidence interval or the upper limit.
Substituting $p(n|s)$ from Eq.~\ref{E72p} and $\pi(s)$ from
Eq.~\ref{E79} into Eq.~\ref{E75}, gives a posterior $pdf$ of
\begin{equation}
h(s|n)=\frac{(s+b)^{n-m}e^{-(s+b)}}{\Gamma(n-m+1,b)}, \label{E80}
\end{equation}
where
\begin{equation}
\Gamma(x,b)=\int_{0}^{\infty}s^{x-1}e^{-x}ds,~~~~~x>0,b>0
\label{E81}
\end{equation}
is an incomplete gamma function.

    In cases where systematic uncertainties of the signal efficiency
and the background expectation can be neglected, the signal expectation
$s$ is an unknown constant and the background expectation $b$ is a
known value. Substituting the posterior $pdf$ from Eq.~\ref{E80} into
Eq.~\ref{E78}, we obtain
\begin{equation}
\alpha=\frac{\Gamma(n-m+1,s_{UP}+b)}{\Gamma(n-m+1,b)}. \label{E82}
\end{equation}
If the flat prior ($m=0$) is used, Eq.~\ref{E82} becomes
\begin{equation}
\alpha=e^{-s_{UP}}\cdot\frac{\sum_{k=0}^{n}\frac{(s_{UP}+b)^k}{k!}
}{\sum_{k=0}^{n}\frac{b^k}{k!}}. \label{E83}
\end{equation}
The upper limit $s_{UP}$ for a given confidence level $1-\alpha$ can
be obtained by solving Eq.~\ref{E82} or~\ref{E83} numerically
from the measured values of $n$ and $b$. Equation~\ref{E83} has been
recommended by the PDG~\cite{PDG} and is, therefore, widely used in 
particle physics experiments. 
However, from a statistics point of view, the
Jeffreys prior seems to be a more appropriate non-informative prior
as mentioned above.   Therefore, using Eq.~\ref{E82} with $m=0.5$ to
determine $s_{UP}$ seems a reasonable choice.

 Now we address the inclusion of systematic uncertainties. First we
consider the case when
only an uncertainty in the background expectation is present,
and the distribution of the background expectation is represented by
a pdf $f_{b^{\prime}}(b,\sigma_{b})$ with the mean $b$ and standard
deviation $\sigma_{b}$. The conditional pdf expressed in
Eq.~\ref{E72p} is then modified to
\begin{equation}
q(n|s)_{b}=\int_{0}^{\infty}p(n|s)_{b^{\prime}}\cdot
f_{b^{\prime}}(b,\sigma_{b})db^{\prime}, \label{E84}
\end{equation}
where $p(n|s)_{b^{\prime}}$ has the same expression as given in
Eq.~\ref{E72p} with $b$ replaced by $b^{\prime}$.

    Next we take into account  uncertainties in the signal detection
efficiency and the background expectation simultaneously, and consider
them to be independent of each other. The distribution of the 
relative signal detection
efficiency $\varepsilon$ (with respect to the nominal
signal detection efficiency) is described by a $pdf$
$f_{\varepsilon}(1,\sigma_{\varepsilon})$   with the mean 1 and
standard deviation $\sigma_{\varepsilon}$. The conditional $pdf$
given in Eq.~\ref{E72p} is modified to
\begin{equation}
q(n|s)_{b}=\int_{0}^{\infty}\int_{0}^{\infty}p(n|s\varepsilon)_{b^{\prime}}
f_{b^{\prime}}(b,\sigma_{b})f_{\varepsilon}(1,\sigma_{\varepsilon})
db^{\prime}d\varepsilon, \label{E85}
\end{equation}
where  $p(n|s\varepsilon)_{b^{\prime}}$ is the expression in
Eq.~\ref{E72p} with $b$ is replaced by $b^{\prime}$, and $s$ by
$s\varepsilon$.  Notice that the lower limits of integration in
Eqs.~\ref{E84} and~\ref{E85} are both zero, which are the minimum
values possible for any efficiency or number of background events.

Using $q(s|n)_{b}$ from Eq.~\ref{E84} or~\ref{E85} to construct
a posterior $pdf$
\begin{equation}
h(s|n)=\frac{q(n|s)_{b}\pi(s)}{\int_{0}^{\infty}q(n|s)_{b}\pi(s)ds},
\label{E86}
\end{equation}
one can calculate the confidence interval or upper limit $s_{UP}$ for
$s$ at any given confidence level with the inclusion of systematic
uncertainties in terms of Eq.~\ref{E76} or~\ref{E78}.

An algorithm for calculating the upper limit at a given confidence
level with or without inclusion of systematic uncertainties in pure
Bayesian approach has been coded. It has been implemented as a
FORTRAN program, BPULE (Bayesian Poissonian Upper Limit
Estimator)~\cite{BPULE}, where an iterative procedure is carried out
that minimizes the difference between the given confidence level and
the calculated value in terms of Eq.~\ref{E78} until a convergence
is reached.
 %\input{chap3}              %%% hypothesis test
 %
\section{Tests of hypotheses}
%
In addition to estimating parameters, one often wants to assess the
validity of certain statements concerning the data's underlying
distribution. Hypothesis tests provide a rule for accepting or
rejecting hypotheses depending on the outcome of a measurement. We
restrict ourselves here to discuss Goodness-of-fit tests -- one
of the non-parametric tests -- which deals with questions of the
functional form for the distribution of the data and gives the
probability to obtain a level of incompatibility with a certain
hypothesis that is greater than or equal to the level observed with
the actual data. Two methods will be covered: Pearson's $\chi^2$ test
and the Kolmogorov-Smirnov test, which are applicable to large- and
small-sized data samples, respectively. Finally, we
discuss an important concept in particle physics
experiments: the statistical significance of an observed signal.
%
\subsection{Goodness-of-fit tests}
%
\subsubsection{Pearson's $\chi^2$ test}
%
We assume there are $n$ observations of a variable $x$ belonging
to $N$ mutually exclusive classes, such as successive intervals in a
histogram, non-overlapping regions in a two-dimensional plot, etc. The
number of events $n_1,n_2,...,n_N$ in the different classes will
then be multi-nominally distributed, with probabilities $p_i$ for the
individual classes as determined by the underlying distribution
$f(x)$ for the continuous variable $x$:
$$p_i=\int_{\triangle x_i} f(x)dx,~~~~~~i=1,2,...,N,$$
or $q_j=P(x=x_j),j=1,2,\cdots$ for a discrete variable $x$:
$$p_i=\sum_{j,x_j\in\triangle x_i}q_j,~~~~~~i=1,2,...,N,$$
where $\triangle x_i$ represents the $i^{\rm th}$ interval. The hypothesis
that we wish to test specifies the class probabilities according to a
certain prescription,
\begin{equation}
H_0:p_i=p_{0i},~~~~~~i=1,2,...,N, \label{E87}
\end{equation}
where
\begin{equation}
\sum_{i=1}^N p_{0i}=1,\label{E88}
\end{equation}
is the overall normalization and
$$p_{0i}=\int_{\triangle x_i} f_0(x)dx,~~~ {\rm or}~~~
p_{0i}=\sum_{j,x_j\in\triangle x_i}q_{0j}.$$ Therefore, what we wish
to test is if the distribution of the observation $f(x)$ or $q_j$ is
consistent with the assigned distribution $f_0(x)$ or $q_{0j}$, or
equivalently, if the hypothesis $H_0$ is accepted by the observed
data, given that the total number in all classes is $n$? To test
whether the set of predicted numbers $np_{0i}$ is compatible with
the set of observed numbers $n_i$ we take as our test statistic the
quantity
\begin{equation}
X^2=\sum_{i=1}^N \frac{(n_i-np_{0i})^2}{np_{0i}}=
\frac{1}{n}\sum_{i=1}^N\frac{n_i^2}{p_{0i}}-n.\label{E89}
\end{equation}
When $H_0$ is true, this statistic is approximately $\chi^2(N-1)$
distributed.  This is called the Pearson theorem.

If $H_0$ is true and the experiment is repeated many times under the
same conditions with $n$ observations, the actual values obtained
for $X^2$, $X^2_{obs}$, will therefore be distributed nearly like
$\chi^2(N-1)$; in particular, the mean value for $X^2_{obs}$ will be
$\simeq N-1$ and the variance $\simeq 2(N-1)$. If, on the other
hand, $H_0$ is not true, the expectation for each $n_i$ is not
$np_{0i}$, and the sum of terms $(n_i-np_{0i})^2/np_{0i}$ will tend
to become on the average larger than if $H_0$ were true. Hence it
seems reasonable to reject $H_0$ if  $X^2_{obs}$ becomes too large.
The criteria to reject $H_0$ at $significance ~level~ \alpha$ is
\begin{equation}
X^2_{obs}>\chi^2_{\alpha}(N-1), \label{E90}
\end{equation}
where $\chi^2_{\alpha}(N-1)$ is determined by the
$\chi^2(N-1)~~pdf~~f(y;N-1)$ such that
$$\alpha=\int^\infty_{\chi^2_{\alpha}(N-1)} f(y;N-1)dy.$$

Often, the model used to describe the distribution of the measured
data includes $L$ unknown parameters. For a Least-Square estimation
we know that the comparison between data and a fitted model is made
using the $\chi^2$ distribution with a number of degrees of freedom
equal to the number of independent observations minus the number of
independent parameters 
that are being estimated. This procedure is exact only in
the limit of infinitely many observations and for a linear
parameter dependence; otherwise it is an approximation. Thus, if
there are $L$ parameters in $H_0$ that are estimated by the $LS$
method and $N$ classes subject to an overall normalization
condition, Pearson's $\chi^2$ test for goodness-of-fit consists of
comparing the fitted (minimum) value $X^2_{min}$ to the $\chi^2$
distribution with $(N-1-L)$ degrees of freedom.
%
\subsubsection{Kolmogorov-Smirnov test}
%
The Kolmogorov-Smirnov (KS) test avoids the binning of individual
observations and may be more sensitive to the data, and is superior
to the $\chi^2$ test in particular for small samples. In
addition, it has many
nice properties when applied to problems in which no parameters are
estimated.

Given $n$ independent observations of the variable $x$ we form an
$ordered ~sample$ by arranging the observations in ascending order
of magnitude, $x_1,x_2,\cdots,x_n$. The cumulative distribution for
this sample of size $n$ is now defined by
\begin{equation}
S_n(x)=\left\{\begin{array}{cc} 0,         & x<x_i,\\
                               \frac{i}{n},& x_i\leq x\leq x_{i+1},\\
                               1,          & x\geq x_n. \end{array}
                               \right.
\label{E91}
\end{equation}
Thus $S_n(x)$ is an increasing step function with a step of height
$1/n$ at each of the observational points $x_1,x_2,\cdots,x_n$.

The KS test involves a comparison between the observed cumulative
distribution function $S_n(x)$ for the data sample and the
cumulative distribution function $F_0(x)$ that is determined from
some theoretical model. We state the null hypothesis as
\begin{equation}
H_0:~~~S_n(x)= F_0(x).  \label{E92}
\end{equation}
If $H_0$ is true, one expects that the difference between $S_n(x)$ and
$F_0(x)$ at any point should be reasonably small. The KS test looks
at the difference $S_n(x)-F_0(x)$ at all observed points and takes
the maximum of the absolute value of this quantity, $D_n$, as a test
statistic
\begin{equation}
D_n=max|S_n(x)-F_0(x)|.  \label{E93}
\end{equation}
It can be shown that provided no parameter in $F_0(x)$ has been
determined from the data, and assuming $H_0$ to be true, the variable
$D_n$ has a distribution that is independent of $F_0(x)$, $i.e.$
$D_n$ is $distribution$~$free$. This holds irrespective of the sample
size.

For a continuous variable $x$ and finite $n$, $D_n$ is
distributed as~\cite{Rohatgi}
\begin{equation}
P(D_n<z+\frac{1}{2n})=\left\{\begin{array}{cc} 0,         & z\leq 0,\\
 \int_{\frac{1}{2n}-z}^{\frac{1}{2n}+z}\int_{\frac{3}{2n}-z}^{\frac{3}{2n}+z}
 \cdots\int_{\frac{2n-1}{2n}-z}^{\frac{2n-1}{2n}+z}
 f(y_1,\cdots,y_n)dy_1\cdots dy_n,     & 0<z<1-\frac{1}{2n}\\
                               1,          & z\geq 1-\frac{1}{2n}, \end{array}
                               \right.
\label{E94}
\end{equation}
where
\begin{equation}
f(y_1,\cdots,y_n)=\left\{\begin{array}{cc} n!,  & 
{\rm when}~0<y_1<\cdots<y_n<1,\\
  0,          & {\rm otherwise}. \end{array}
                               \right.
\label{E95}
\end{equation}
For large $n$  $D_n$ has the cumulative distribution 
\begin{equation}
\lim_{n\rightarrow\infty}P(D_n\leq\frac{z}{\sqrt n})=
1-2\sum_{r=1}^{\infty} (-1)^{r-1}e^{-2r^2 z^2},~~~(z>0).
\label{E96}
\end{equation}
This relation is approximately valid at $n\simeq 80$.

If $H_0$ is true, $D_n$ tends to be small, while if $H_0$ is not
true, $D_n$ tends to be larger than it would be if $H_0$ were true. 
Hence it
seems reasonable to reject $H_0$ if $D_n$ becomes too large. The
criteria to reject $H_0$ at significance level $\alpha$ is
\begin{equation}
P(D_n>D_{n,\alpha}). \label{E97}
\end{equation}
Tables in the Appendix of Ref.~\cite{Frodesen} or~\cite{Zhuys}
give the critical values $D_{n,\alpha}$ for 5 different significance
levels $\alpha$ and for $n\leq 100$, and an approximate expression for
$n>100$.
%
\subsection{Statistical significance of signal}
%
The statistical significance of a signal in an experiment of
particle physics quantifies the degree of confidence that the
observation in the experiment either confirms or disproves a null
hypothesis $H_0$, in favor of an alternative hypothesis $H_1$.
Usually $H_0$ stands for known or background processes, while
the alternative hypothesis $H_1$ includes a new ``signal''
process in addtion to
background processes with respective production cross
sections.   This concept is very useful for evaluating measurements 
and giving an intuitive estimate of the extent to which one can 
believe that an observed phenomenon is due to background or 
a genuine signal.   It is
crucial for measurements that claim a new discovery or a
new signal.  A convention in particle physics experiments is the
``$5\sigma$" standard, namely a statistical significance $S\geq 5$
is required  for claiming a discovery; while for the
cases  of $S\geq 3$ ($S\geq 2$), one may claim that the 
observed signal is strong (weak) evidence.

However, as pointed out in Ref.~\cite{Sinervo}, the concept of the
statistical significance has not been employed consistently for the
most important discoveries made during the last quarter century. Also,
the definitions of the statistical significance for different
measurements differ from each other. Listed below are various
definitions for the statistical significance in counting experiment
(see, for example, Refs. ~\cite{Bity1,Bity2,Narsky}):
\begin{equation}
S_1=(n-b)/\sqrt{b}, \label{E98}\end{equation}
\begin{equation}
S_2=(n-b)/\sqrt{n},\label{E99}
\end{equation}
\begin{equation}
S_{12}=\sqrt{n}/\sqrt{b},\label{E100}
\end{equation}
\begin{equation}
S_{B1}=S_1-k(\alpha)\sqrt{n/b},\label{E101}
\end{equation}
\begin{equation}
S_{B12}=2S_{12}-k(\alpha),\label{E102}
\end{equation}
\begin{equation}
\int_{-\infty}^{S_N}N(0,1)dx=\sum_{i=0}^{n-1}e^{-b}\frac{b^i}{i!},
\label{E103}
\end{equation}
where $n$ is the total number of the observed events, which is a
Poisson variable with the expectation $s+b$, $s$ is the expected
number of signal events, while $b$ is the known
expected number of Poisson distributed background events. All
numbers are counted in the ``signal region" where the signal
events are supposed to appear. In Eqs~\ref{E101} and~\ref{E102},
$k(\alpha)$ is a factor related to the $\alpha$ for which
the corresponding statistical significance assumes a $1-\alpha$
acceptance for a positive decision about signal observation:
$k(0.5)=0,k(0.25)=0.66,k(0.1)=1.28,k(0.05)=1.64$ etc.~\cite{Bity2}.
In Eq~\ref{E103}, $N(0,1)$ denotes  the standard
normal function. However, measurements in particle physics 
experiments
often examine statistical variables that are continuous in
nature.  Actually, to identify a sample of events enriched in the
signal process, it is often important to take into account the
entire distribution of a given variable for a set of events, rather
than just to count the events within a given signal region of
values.  In this situation, Narsky~\cite{Narsky} gives a
definition of the statistical significance 
in terms of the likelihood function,
\begin{equation}
S_{L}=\sqrt{-2\ln L(b)/L(s+b)} , \label{E104}
\end{equation}
which assumes that $-2\ln L(b)/L(s+b)$ distributes as
as a $\chi^2$ function with one degree of freedom.

   Considering the above-mentioned situation, it is 
apparent that a
self-consistent definition for the statistical significance
is needed; one that can
avoid the ambiguity where the same $S$ value from different
measurements may imply, in fact, different statistical significances.
The definition should be suitable for both counting experiment and 
continuous test statistics.
%
\subsubsection{ Definition of the statistical significance }
%
  In the PDG~\cite{PDG}, the $p$-value is defined to quantify the level
of agreement between the experimental data and a hypothesis. Assume
an experiment makes a measurement of a test statistic $t$ that is equal
to $t_{obs}$, and $t$ has a probability density function $g(t|H_0)$
if a null hypothesis $H_0$ is true. We further assume that large $t$
values correspond to poor agreement between the null hypothesis
$H_0$ and data.  Then the $p$-value of an experimental result
is given by
\begin{equation}
p(t_{obs})=P(t>t_{obs}|H_0)=\int_{t_{obs}}^{\infty}g(t|H_0)dt.
\label{E105}\end{equation} A very small $p$-value tends to reject
the null hypothesis $H_0$.

   Since the $p$-value of an experiment provides a measure of the
consistency between the $H_0$ hypothesis and the measurement,
Zhu~\cite{YS} defines the statistical significance $S$ in terms of
the $p$-value as
\begin{equation}    %\beq
         \int_{-S}^{S}N(0,1)dx=1-p(t_{obs})
\label{E106}\end{equation}   %\eeq
where the null hypothesis $H_0$ represents the case that
the observed events can be described solely by background processes.
Because a small $p$-value means a small probability of $H_0$ being
true, this corresponds to a large probability for $H_1$ being true, and 
one gets a large signal significance $S$ from this expression. The
left side of equation~\ref{E106} represents the integrated probability
of the normal distribution in the region within $S$ standard
deviations ($S\sigma$).  For such a definition, some correlated $S$
and $p$-values are listed in Table~\ref{pS}.
\begin{table}[htbp]
\caption{\it Statistical significance $S$ and its correlated $p$-value.}
\begin{center}
\begin{tabular}{|c|c|}\hline
$S$  &  $p-$value \\\hline
1 & 0.3173  \\
2 & 0.0455  \\
3 & 0.0027  \\
4 & $ 6.3\times 10^{-5} $ \\
5 & $ 5.7\times 10^{-7} $ \\
6 & $ 2.0\times 10^{-9} $ \\\hline
\end{tabular}
\end{center}
\label{pS}
\end{table}

\subsubsection{Statistical significance in counting experiment}
A subset of particle physics experiments involves searches for new
phenomena or signals by observing a unique class of events that 
cannot be described by background processes. One can designate this
problem to that of a ``counting experiment," where one identifies a
class of events using well defined criteria, counts up the number of
observed events, and estimates the average rate of events
contributed by various backgrounds in the signal region where the
signal events (if they exist) will be clustered. Assume 
that in an experiment,
the number of signal events in the signal region is a Poisson
variable with the expectation $s$, while the number of events from
backgrounds is a Poisson variable with a known expectation $b$, then
the observed number of events distributes as the Poisson variable
with the expectation $s+b$. If the experiment observes $n_{obs}$
events in the signal region, then the $p$-value is
\begin{eqnarray}
p(n_{obs}) &=&P(n>n_{obs}|H_0)=\sum_{n=n_{obs}}^{\infty}\frac{b^n}{n!}e^{-b} \\
\nonumber
 &=&  1-\sum_{n=0}^{n_{obs}-1}\frac{b^n}{n!}e^{-b} .
\end{eqnarray}
Substituting this relation to Eq.~\ref{E106}, one
gets
\begin{equation}   %\beq
  \int_{-S}^{S}N(0,1)dx=\sum_{n=0}^{n_{obs}-1}\frac{b^n}{n!}e^{-b}
\label{E107}\end{equation}   %\eeq
From this expression, the signal significance $S$ can be easily 
determined.
Comparing this equation with Eq.~\ref{E103} (from
Ref.~\cite{Narsky}), we find a different lower limit of integration.
%
\subsubsection{Statistical significance in continuous test
statistics}
%
The general problem in this situation can be addressed as follows.
Suppose we identify a class of events using well defined criteria
that are characterized by a set of $n$ observations
$x_1,\cdots,x_n$ for a random variable $x$. In addition, one wishes to
test a hypothesis that predicts the probability density function of
$x$, say $f(x|\vec{\theta})$, where
$\vec{\theta}=(\theta_1,\theta_2,...,\theta_k)$ is a set of
parameters that have to be estimated from the data. Then the
problem is to define a statistic that gives a measure of the
consistency of the distribution of data with the distribution given
by the hypothesis.

To be concrete, we consider the random variable $x$ is, say, an
invariant mass, and the $n$ observations $x_1,\cdots,x_n$ give an
experimental distribution of $x$. Assuming parameters $\vec{\theta}=
(\theta_1,\cdots,\theta_k)\equiv(\vec{\theta_s};\vec{\theta_b)}$,
where $\vec{\theta_s}$ and $\vec{\theta_b}$ represent the parameters
related to the signal (say, a resonance) and the background contributions,
respectively.  We assume that the null hypothesis $H_0$ stands for 
an experimental distribution of $x$ that can be described solely by
background processes; namely, the null hypothesis $H_0$ specifies
fixed values for a subset of parameters $\vec{\theta_s}$. Therefore,
the parameters $\vec{\theta}$ are restricted to lie in a subspace
$\omega$ of its total space $\Omega$. On the basis of a data sample
of size $n$ from  $f(x|\vec{\theta})$ we want to test 
whether or not the hypothesis
$H_0:\vec{\theta}$ belongs to $\omega$. Given the observations
$x_1,\cdots,x_n$, the likelihood function is $L=\prod_{i=1}^{n}
f(x_i|\vec{\theta})$. The maximum of this function over the total
space $\Omega$ is denoted by $L(\hat{\Omega})$; while within the
subspace $\omega$ the maximum of the likelihood function is denoted
by  $L(\hat{\omega})$, then we define the likelihood-ratio
$\lambda\equiv L(\hat{\omega})/L(\hat{\Omega})$. It can be shown
that when the sample size $n$ is large, 
%for $H_0$ true, 
the statistic
\begin{equation}   %\beq
 t \equiv -2\ln \lambda \equiv 2(\ln L_{max}(s+b)-\ln L_{max}(b))
\label{E108}
\end{equation}    %\eeq
is distributed as $\chi^2(r)$, where $r$ is the 
%number of parameters specified by
difference in the
number of degrees of freedom between the $H_1$ and
$H_0$ hypotheses~\cite{Eadie}.
In Eq.~\ref{E108},  we use $\ln L_{max}(s+b)$ and $\ln
L_{max}(b)$ to denote $L(\hat{\Omega})$ and $L(\hat{\omega})$,
respectively.  If $\lambda$ turns out to be in the neighborhood of
1, the null hypothesis $H_0$ is such that it renders
$L(\hat{\omega})$ close to the maximum $L(\hat{\Omega})$ and, hence,
$H_0$ will have a large probability of being true. On the other
hand, a small value of $\lambda$ will indicates that $H_0$ is
unlikely. Therefore, the critical region of $\lambda$ is in the
neighborhood of 0, corresponding to large value of statistic $t$. If
the measured value of $t$ in an experiment is $t_{obs}$, from
Eq.~\ref{E105} we have the $p$-value
\begin{equation}   %\beq
 p(t_{obs})=\int_{t_{obs}}^{\infty}\chi^2(t;r)dt.
\label{E109}
\end{equation}   %\eeq
Therefore, in terms of equation~\ref{E106}, one can calculate the
signal
 significance according to the expression:
\begin{equation}    %\beq
 \int_{-S}^{S}N(0,1)dx=1-p(t_{obs})=\int_{0}^{t_{obs}}\chi^2(t;r)dt.
\label{E110}
\end{equation}    %\eeq
For the case of $r=1$, we have
\begin{eqnarray}
 \int_{-S}^{S}N(0,1)dx &=& \int_{0}^{t_{obs}}\chi^2(t;1)dt \\ \nonumber
  &=& 2\int_{0}^{\sqrt{t_{obs}}}N(0,1)dx,
\end{eqnarray}
and obtain
\begin{eqnarray}
 S &=&\sqrt{t_{obs}} \\ \nonumber
   &=&  [2(\ln L_{max}(s+b)- \ln L_{max}(b))]^{1/2},
\end{eqnarray}
which is identical to Eq.~\ref{E104} (from
Ref.~\cite{Narsky}).
%\input{ref}                %%% Reference
%
%\section*{References}
%
\begin{thebibliography}{99}
\bibitem{Eadie} W.T.~Eadie {\it et al}, Statistical methods in
 experimental physics, North-Holland publishing Co., Amsterdam, 1971.
\bibitem{Frodesen} A.~Frodesen {\it et al}, Probability and
 Statistics  in particle physics, Universitetsforlaget,
 Bergen-Oslo-Troms{\o}, 1979.
\bibitem{Zhuys} Yongsheng Zhu, Probability and statistics  in experimental
 physics, 2nd edition, Academic Press, Beijing, 2006.
\bibitem{PDG} Particle Data Group, W.-M.~Yao {\it et al}, Journal of
 Physics G, {\bf 33}, 1 (2006).
\bibitem{Cowan}  G.~Cowan, Statistical data analysis, Oxford Univ.
 Press Inc., New York, 1998.
\bibitem{Barlow} R.~Barlow, arXiv Physics/0406120, 2004.
\bibitem{Neyman} J.~Neyman, Phil. Trans. Royal Soc. London, Series
  A, {\bf 236}, 333 (1937)
\bibitem{FC} G.~Feldman and R.D.~Cousins, Phys. Rev. {\bf D57}, 3873 (1998).
\bibitem{RW} B.P.~Roe and M.B.~Woodroofe, Phys. Rev. {\bf D63}, 013009 (2001).
\bibitem{HC} R.D.~Cousins and V.L.~Highland, Nucl. Instr. Meth. in
     Phys. Res. {\bf A320}, 331 (1992).
\bibitem{RL} W.A.~Rolke and A.M.~Lopez,  Nucl. Instr. Meth. in
     Phys. Res. {\bf A458}, 745 (2001).
\bibitem{Conrad} J.~Conrad {\it et al},  Phys. Rev. {\bf D67}, 012002 (2003).
\bibitem{POLE} http://www3.tsl.uu.se/\~{ }conrad/pole.html.
\bibitem{Bayes} T.~Bayes, Phil. Trans. Roy. Soc., {\bf 53},370(1763).
\bibitem{Jeffreys} H.~Jeffreys, Theory of probability, 3rd edition,
Clarendon, Oxford, 1961.
\bibitem{BPULE} http://psip.ihep.ac.cn/\~{ }dusx/zhuys/Bayes/
\bibitem{Rohatgi} V.~Rohatgi, An introduction to probability theory
 and mathematical statistics, John Wiley \& Sons, New York, 1976.
\bibitem{Sinervo} P.K.~Sinervo, Proc of Conf. "Advanced statistical
techniques in particle physics", Durham, UK, 18-22 March, 2002, p64.
\bibitem{Bity1} S.I.~Bityukov  {\it et al},   Nucl.Intr.Meth. {\bf A452}, 518 (2000)
\bibitem{Bity2} S.I.~Bityukov {\it et al}, Proc of Conf. "Advanced
statistical techniques in particle physics", Durham, UK, 18-22
March, 2002, p77.
\bibitem{Narsky} I.~Narsky,  Nucl.Intr.Meth. {\bf A450}, 444 (2000)
\bibitem{YS} Yongsheng Zhu, HEP\&NP, {\bf 30}, 331 (2006)
\end{thebibliography}
%%**********************************

