In statistics,<unk>  is a<unk>  alternative to the more well-known ordinary least-squares<unk><unk> .
Consider standard<unk><unk>  problem, where we specify the conditional density of y given x predictor variables:
where the noise 
ϵ
{\displaystyle \epsilon }
 is i.i.d. and normally distributed
A common,<unk>  least squares solution, is to estimate the slope 
β
^
{\displaystyle {\hat {\beta }}}
 using the Moore-Penrose pseudoinverse:
where 
X
{\displaystyle X}
 is the vector of 
x
i
{\displaystyle x_{i}}
 (of length 
n
{\displaystyle n}
).
This is a frequentist's view, and assumes we have enough measurements of 
x
i
{\displaystyle x_{i}}
 to say something meaningful about y.  In the empirical Bayes approach, we will assume we have only a small sample of 
x
i
{\displaystyle x_{i}}
 for our individual measurement, and we seek to correct our estimate by "borrowing" information from a larger set of similar observations.
Let us write our conditional likelihood as
We seek a natural conjugate prior--a joint density 
ρ
(
β
,
σ
2
)
{\displaystyle \rho (\beta ,\sigma ^{2})}
  which is of the same functional form as the likelihood.  Since the likelihood is quadratic in 
β
{\displaystyle \beta }
, we re-write the likelihood so it is normal in 
(
β
−
β
^
)
{\displaystyle (\beta -{\hat {\beta }})}
.  Write
Now re-write the likelihood as
where
This suggests a form for the priors:
where 
ρ
(
σ
2
)
{\displaystyle \rho (\sigma ^{2})}
 is an inverse-gamma distribution
and 
ρ
(
β
|
σ
2
)
{\displaystyle \rho (\beta |\sigma ^{2})}
 is a normal distribution
With the prior now specified, we can express the posterior distribution as
With some re-arrangement, we can re-write the posterior so that the posterior mean 
β
~
{\displaystyle {\tilde {\beta }}}
 is weighted average of the least squares estimator and the prior mean:
where 
U
{\displaystyle U}
 comes from the LU decomposition of 
A
{\displaystyle A}
 (which is a positive-definite matrix by design)
This is the key result of the Empirical Bayes approach; it allows us to estimate the slope 
β
{\displaystyle \beta }
 for our original<unk><unk>  problem by combining estimates using the least squares estimate 
β
^
{\displaystyle {\hat {\beta }}}
 for a single set of measurements with the empirical prior estimate 
β
¯
{\displaystyle {\bar {\beta }}}
 from a large collection of similar measurements.  (Notice that the weighted average also depends on the empirical estimate of the prior covariance matrix 
A
{\displaystyle A}
.)
To justify this, collect the quadratic terms in the exponential and now express this as a quadratic form in 
β
−
β
~
{\displaystyle \beta -{\tilde {\beta }}}
:
where
The posterior can now be expressed as a Normal distribution 
N
(
β
~
,
σ
2
(
X
T
X
+
A
)
−
1
{\displaystyle N({\tilde {\beta }},\sigma ^{2}(X^{T}X+A)^{-1}}
 
times an inverse-gamma distribution:
A similar analysis can be performed for general case of multi-variate<unk>  for a<unk>  Estimation of covariance matrices.
Example:
Suppose the weights of a large population of 35-year-old men are normally distributed with expected value μ and standard deviation σ.  A crude measuring instrument measures a man's weight with a measurement error that is normally distributed with expected value 0 and standard deviation τ.  The man's true weight is not observable; his weight measured with error is observed.  The conditional probability distribution of  a randomly chosen man's true weight, given his weight-measured-with-error, can be found by using Bayes' theorem, and then the conditional expected value can be used as an estimate of his true weight, provided that the values of μ, σ, and τ are known.  But they are not.  One may use the data to estimate the standard deviation of the measurement errors by measuring each man multiple times.  One may similarly estimate the population average weight and the population standard deviation of weights by weighing multiple men.  These estimates of parameters based on the data are the occasion for the use of the word empirical.  Finally, one may then estimate the aforementioned conditional expected true weight by using Bayes' theorem.
Bayesian linear regression
Linear regression
Analysis of covariance
Analysis of rhythmic variance
Box plot
Likelihood-ratio test
Brown-Forsythe test
Non-parametric statistics