
Estimate the minimum and maximum parameters of a uniform distribution.
eunif(x, method = "mle")
numeric vector of observations. Missing (NA
), undefined (NaN
), and
infinite (Inf
, -Inf
) values are allowed but will be removed.
character string specifying the method of estimation. The possible values are
"mle"
(maximum likelihood; the default), "mme"
(method of moments),
and "mmue"
(method of moments based on the unbiased estimator of variance).
See the DETAILS section for more information on these estimation methods.
a list of class "estimate"
containing the estimated parameters and other
information. See
estimate.object
for details.
If x
contains any missing (NA
), undefined (NaN
) or
infinite (Inf
, -Inf
) values, they will be removed prior to
performing the estimation.
Let min=
max=
Estimation
Maximum Likelihood Estimation (method="mle"
)
The maximum likelihood estimators (mle's) of
Method of Moments Estimation (method="mme"
)
The method of moments estimators (mme's) of
Method of Moments Estimation Based on the Unbiased Estimator of Variance (method="mmue"
)
The method of moments estimators based on the unbiased estimator of variance are
exactly the same as the method of moments estimators given in equations (3-6) above,
except that the method of moments estimator of variance in equation (6) is replaced
with the unbiased estimator of variance:
Forbes, C., M. Evans, N. Hastings, and B. Peacock. (2011). Statistical Distributions. Fourth Edition. John Wiley and Sons, Hoboken, NJ.
Johnson, N. L., S. Kotz, and N. Balakrishnan. (1995). Continuous Univariate Distributions, Volume 2. Second Edition. John Wiley and Sons, New York.
# NOT RUN {
# Generate 20 observations from a uniform distribution with parameters
# min=-2 and max=3, then estimate the parameters via maximum likelihood.
# (Note: the call to set.seed simply allows you to reproduce this example.)
set.seed(250)
dat <- runif(20, min = -2, max = 3)
eunif(dat)
#Results of Distribution Parameter Estimation
#--------------------------------------------
#
#Assumed Distribution: Uniform
#
#Estimated Parameter(s): min = -1.574529
# max = 2.837006
#
#Estimation Method: mle
#
#Data: dat
#
#Sample Size: 20
#----------
# Compare the three methods of estimation:
eunif(dat, method = "mle")$parameters
# min max
#-1.574529 2.837006
eunif(dat, method = "mme")$parameters
# min max
#-1.988462 2.650737
eunif(dat, method = "mmue")$parameters
# min max
#-2.048721 2.710996
#----------
# Clean up
#---------
rm(dat)
# }
Run the code above in your browser using DataLab