Interval Estimation Under The Uniform Distribution U(a,b)
QIQING YU
Department of Mathematical Sciences
State University of New York
Binghamton, NY 13902
USA
Abstract: - In this short note, we consider interval estimation for the parameters under the uniform distribution
U(a, b). We study two approaches: (1) based on a Wald-type statistic, (2) based on a pivotal statistic. We show
that the first approach in its common form is not valid and we propose a modified version of the first approach. It
turns out it is equivalent to the confidence interval with the shortest length.
Key-Words: - Maximum likelihood estimator, Confidence Intervals, Pivotal Statistic, Wald-type Statistic
Received: April 20, 2021. Revised: January 7, 2022. Accepted: January 25, 2022. Published: February 24, 2022.
1 Introduction.
The uniform distribution U(a, b)is a common dis-
tribution and has been studied extensively (see, for
example, Kuipers and Niederreiter (2012), Stephens
(2017) and Claessen. et al. (2015), among others.
The maximum likelihood estimators (MLEs) of its pa-
rameters have explicit expressions. How to construct
a confidence interval (CI) under U(a, b)is a typical
content in a basic statistics course. For example, in
the textbook by Casella and Bergera (2002), it is ex-
plained that if the data are from U(0, b)then the exact
CI for bcan be constructed using a pivotal statistic. If
the random sample is from U(a, b)when both aand b
are parameters, then a,band θare parameters, where
θ=ba. Under this assumption, we shall show that
there does not exist an exact CI. We shall discuss how
to construct approximate CIs.
2 Theory.
Let W1, ..., Wnbe i.i.d. from WU(a, b), with
the cumulative distribution function (cdf) FW(·). Let
a, ˆ
b, ˆ
θ)be the MLE of (a, b, θ), where ˆa=W(1) =
miniWi,ˆ
b=W(n)=maxiWiand ˆ
θ=ˆ
bˆa. Recall
that P(ˆ
bt) = P(W(n)t) = P(Wit, i) =
(FW(t))nand P(W(1) > t) = P(Wi> t, i) =
(SW(t))n, where SW= 1 FW. Thus the distribu-
tion of the MLE of (a, b, θ)is well understood. It is
easy to verify that a, ˆ
b, ˆ
θ)is consistent.
There are two possible approaches in construct-
ing CI’s for γ {a, b, θ}: (1) base on the Wald-type
statistic ˆγγ
ˆσˆγ,e.g.,[ˆγ1.96ˆσˆγ, , ˆγ+1.96ˆσˆγ], (2) based
a pivotal statistic T=Wa
ba, where TU(0,1).
The first approach relies on the mean and variance.
Recall the cdfs and density functions:
FT(n)(t) = tn, fT(n)(t) = ntn1, FT(1) = 1 ST(1) ,
ST(1) (t) = (1 t)n, fT(1) (t) = n(1 t)n1,
for t[0,1]; and for t, s (0,1),
fT(1),T(n)(t, s) = n!fT(t)(FT(s)FT(t))n2fT(s)
1!(n2)!1! .
Based on W=θT +a, it is easy to derive
σ2
ˆ
b=θ2σ2
T(n)=σ2
ˆa=θ2n
(n+ 1)2(n+ 2)
and σ2
ˆ
θ=θ2σ2
T(n)T(1) =2(n1)θ2
(n+ 2)(n+ 1)2.(1)
The proofs are also given in Appendix.
3 The Main Results.
We shall consider constructing the CI for a,bor θun-
der the assumption that WU(a, b). For simplicity,
we only discuss the case of a 95% CI (or (1α)100%
CI’s, with α= 0.05). For general (1 α)100% CI’s,
just replace 0.05 by α.
3.1. CIs for b:First consider the pivotal method.
Since T=Wa
baU(0,1),Tis a pivotal statis-
tic. For t[0,0.05],FT(n)(t) = tn, letting (u, v) =
(t1/n,(0.95 + t)1/n)yields
0.95 = P(uT(n)v) = P(uW(n)a
bav)
=P(1
vba
W(n)a1
u)
=P(W(n)a
v+abW(n)a
u+a).
If ais given, a 95% CI for bis
[W(n)a
v+a, W(n)a
u+a],(2)
WSEAS TRANSACTIONS on MATHEMATICS
DOI: 10.37394/23206.2022.21.10
Qiqing Yu
E-ISSN: 2224-2880
68
Volume 21, 2022
where (u, v) = (t1/n,(0.95 + t)1/n). There
are 3 typical cases: (u, v) = (0,0.951/n), or
(0.0251/n,0.9751/n), or (0.051/n,1), with lengthes:
W(n)(1
00.95
1
n,0.025
1
n0.975
1
n,0.05
1
n1)
W(n)(,0.037,0.030) if n= 100.
Thus the best choice among these three 95% CIs for
bis (W(n),W(n)a
0.051/n+a)if ais known. Actually, it
is the shortest 95% CI, which is given by (u, v) =
(0.051/n,1), as the length of the CI in Eq. (2) is
(W(n)a)[(0.95 + t)1/nt1/n]and
((0.95 + t)1/nt1/n)
t
=1
n(0.95+t)
1
n11
nt
1
n1<0for t[0,0.05].
If ais unknown, estimating aby W(1) yields an ap-
proximate 95% CI
[W(n),W(n)W(1)
0.051/n+W(1)],(3)
as P(a < W(1) a+δ) = P(T(1) δ
θ)
= 1 (1 δ
θ)n1δ(0, θ/2), and thus
P(W(n)bW(n)W(1)
0.051/n+W(1))0.95 if nis
large. The length of the CI is (ˆ
bˆa)(201/n1).
Wald-type statistic may lead to another possible
95% CI ˆ
b±1.96ˆσˆ
b, with its length 4ˆσˆ
b. By Eq.
(1) and Eq. (3), if nis large then the ratio of these
two lengths is
(ˆ
ba)(0.051/n1)
4ˆσˆ
b
=(ˆ
ba)(0.051/n1)
4ˆ
θn
n+2 /(n+1)
0.051/n1
4/n<0.8,
thus ˆ
b±1.96ˆσˆ
bis not as good as the CI in Eq. (3).
Moreover, this approach is based on the belief that
P(W(n)b
ˆσW(n)t)Φ(t)t, where Φis the cdf of
N(0,1). However, if t > 0then
0.95 P(W(n)b
σW(n)t)
=P(W(n)W(n)+b)
= (P(TW(n)+ba
ba))n
= (P(TW(n)
ba+ 1))n
= (1)n, as TU(0,1).
It leads to a contradiction: 0.95 1. Thus ˆ
b±2ˆσˆ
b
is not a CI. But we can make use of the Wald-type
statistic as follows. Choose t < 0such that
0.05 = P(W(n)b
σW(n)t)
=P(W(n)W(n)+b)
= (P(WW(n)+b))n
= (P(TW(n)+ba
ba))n
= (t
θn
n+2
n+1
θ+1)n((t
n+1)net).
0.95 = P(W(n)b
σW(n)
> t) (tln0.05 = ln20)
=P(b < W(n)σW(n)t)
=P(W(n)< b < W(n)σW(n)t)
P(W(n)< b < W(n)+σW(n)ln20).
Thus an approximate 95% CI for bis
(W(n), W(n)+ ˆσW(n)ln20), with
length ˆ
bˆa
nln20 = (ˆ
bˆa)ln201/n,
as σ2
ˆ
b=(ba)2n
(n+1)2(n+2) by Eq. (1). It is of interest to
compare its length to the length of the CI in (3):
(ˆ
bˆa)(0.051/n1)
= (ˆ
bˆa)(201/n1)
(ˆ
bˆa)ln201/n, as
ln201/n
=lnx
=lnxln1
(lnx)|x=1(x1)
=x1(with x= 201/n).
Thus these two approximate CI’s have the same
length asymptotically.
Remark. In general, an approximate (1 α)100%
CI for bis
[W(n), W(n)ˆσW(n)lnα]Wald-type method
[W(n),ˆ
θ
α1/n+W(1)]pivotal method.
3.2. CI for a:W(1) a
θ=T(1) is a pivatol statistic and
P(T(1) > t) = (1t)nif t[0,1]. Let (u, v)satisfy
0.95 = P(uW(1)a
θv) (= (1u)n(1v)n)
0.95 = P(W(1) aW(1) vθ),then it leads
to an approximate 95% CI for a,e.g, let
((1 u)n,(1 v)n)
= (0.95,0),(0.975,0.025),(1,0.05), then (u, v) =
(1 0.95 1
n,1) or (1 0.975 1
n,10.025 1
n), or
(0,10.05 1
n).
Then their length
=θ(0.95 1
n,0.975 1
n0.025 1
n,10.05 1
n). It can be
shown that the shortest 95% CI for ais avθ, ˆa]
if θis given, where v= 1 0.051/n; otherwise, an
approximate 95% CI is [W(1) vˆ
θ, W(1)].
Moreover, a 95% CI based on Wald-type statistic
ˆaa
ˆσˆais [ˆatˆσˆa,ˆa], where tn(1 0.051/n)and
ˆσˆ
θˆ
θ/n. The reason is as follows.
0.95 = P(W(1)a
σW(1) t)
=P(W(1) W(1) a)
=P(W(1) W(1) aW(1))
=P(W(1) W(1) +a)
= 1 P(W(1) > W(1) +a)
= 1 P(T(1) >W(1) +aa
θ)
= 1 P(T(1) >W(1)
θ)
= 1 (1 W(1)
θ)n
WSEAS TRANSACTIONS on MATHEMATICS
DOI: 10.37394/23206.2022.21.10
Qiqing Yu
E-ISSN: 2224-2880
69
Volume 21, 2022
= 1 (1 n
n+2
θ(n+1) )n.=>
0.051/n= 1 tn
n+2
(n+1) =>
t= (1 0.051/n)n
n+2
(n+1) n(1 0.051/n).
Moreover, σW(1) =θn
n+2
(n+1) θ/n.
Remark. Both approaches lead to approximately the
same CI, as expected.
3.3. CI for θ:Let 0.95 = 1 P(T(n)v) = 1 vn,
i.e. v= 0.051/n. Then
P(T(n)=W(n)a
θ> v) = P(W(n)a
v> θ)
=P(W(n)a
v> θ > ˆ
bˆa).
Hence, an approximate 95% CI for θis (ˆ
θ, ˆ
θ
0.051/n],
where ˆ
θ=W(n)W(1), Or in general, (ˆ
θ, ˆ
θ
α1/n].
On the other hand, in order to study Wald-type
approach, we need to find the distribution of ˆ
θ
(=W(n)W(1)). Let fbe the density of (T(n), T(1)).
G(t)def
=P(T(n)T(1) t)
= 1(0 xyt)f(x, y)dxdy
=t
0x
0f(x, y)dydx +1
tx
xtf(x, y)dydx (t
[0,1]).
G(t) = t
0f(t, y)dyt
0f(t, y)dy+1
tf(x, xt)dx
=1
tn(n1)tn2dx =n(n1)tn2(1 t) =>
G(t) = t
0n(n1)xn2(1 x)dx
=n(n1)[xn1
n1xn
n]|t
0=>
G(t) = ntn1(n1)tn, t [0,1].(4)
Let vbe determined by 0.05 = P(ˆ
θθ
σˆ
θv). Then
0.05 = P(ˆ
θθ
σˆ
θv) = P(ˆ
θvσˆ
θθ)
=P(W(n)W(1) vσˆ
θ+θ)
=P(T(n)T(1) vσˆ
θ+θ
θ)
=P(T(n)T(1) vθ2(n1)
n+2
n+1 +θ
θ)
=P(T(n)T(1)
v2(n1)
n+2
n+1 + 1)
=G(v2(n1)
n+2
n+1 ) (= 0.05);
0.95 = P(ˆ
θvσˆ
θ> θ)
=P(ˆ
θvσˆ
θ> θ ˆ
θ)
(= 1 G(v2(n1)
n+2
n+1 )).
Thus [ˆ
θ, ˆ
θvˆσˆ
θ]is an approximate 95% CI for θ,
where vis specified by G(v2(n1)
n+2
n+1 )=0.05 and
G(t) = ntn1(n1)tnby Eq. (4).
4 Summary.
The confidence intervals for the parameters under
U(a, b)are not of the typical form of [ˆ
ψu, ˆ
ψ+u],
but are of the form either ˆ
ψ, ˆ
ψ+u], or ˆ
ψu, ˆ
ψ], where
ψ {a, b, θ}.
Appendix
E(T(1)) = 1
n+1 ,
V(T(1)) = n
(n+1)2(n+2) ,
E(T(n)) = n
n+1 .
V(T(n)) = n
(n+1)2(n+2) ,
E(W(1)) = b
n+1 +an
n+1 .
E(W(n)) = bn
n+1 +a
n+1 .
V(W(1)) = V(W(n)) = θ2n
(n+1)2(n+2) ,
Let Z=W(n)W(1),
then E(Z) = (ba)(n1)/(n+ 1).
σ2
Z=2n
(n+1)2(n+2) θ2
2[E(W(n)W(1))E(W(n))E(W(1))].
fW(i),W(j)(x, y) =
n!(FW(x))i1fW(x)(FW(y)FW(x))ji1fW(y)(SW(y))nj
(i1)!1!(ji1)!1!(nj)! ,
x < y,i < j,
fW(1),W(n)(x, y) = n!fW(x)(FW(y)FW(x))n2fW(y)
(n2)!
=n(n1)(yx)n2
θ2,a < x < y < b.
σ2
ˆ
θ=σ2
W(n)W(1)
=22
(n+1)2(n+2) 2θ2
(n+2)(n+1)2=2(n1)θ2
(n+2)(n+1)2.
References:
[1] Casella, G. and Bergera, R. L. (2002). Statistical
Inference (2nd ed.) Duxbury. U.S.
[2] Kuipers, L., & Niederreiter, H. (2012). Uniform
distribution of sequences. Courier Corporation.
[3] Stephens, M. A. (2017). Tests for the uniform dis-
tribution. In Goodness-of-fit techniques (pp. 331-
366). Routledge.
[4] Claessen, K., Duregard, J., & Palka, M. H.
(2015). Generating constrained random data with
uniform distribution. Journal of functional pro-
gramming, 25.
Creative Commons Attribution
License 4.0 (Attribution 4.0
International , CC BY 4.0)
This article is published under the terms of the
Creative Commons Attribution License 4.0
https://creativecommons.org/licenses/by/4.0/deed.en_US
WSEAS TRANSACTIONS on MATHEMATICS
DOI: 10.37394/23206.2022.21.10
Qiqing Yu
E-ISSN: 2224-2880
70
Volume 21, 2022