Estimate the location and scale parameters of a logistic distribution, and optionally construct a confidence interval for the location parameter.
elogis(x, method = "mle", ci = FALSE, ci.type = "two-sided",
ci.method = "normal.approx", conf.level = 0.95)
numeric vector of observations.
character string specifying the method of estimation. Possible values are
"mle"
(maximum likelihood; the default), "mme"
(methods 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.
logical scalar indicating whether to compute a confidence interval for the
location or scale parameter. The default value is FALSE
.
character string indicating what kind of confidence interval to compute. The
possible values are "two-sided"
(the default), "lower"
, and
"upper"
. This argument is ignored if ci=FALSE
.
character string indicating what method to use to construct the confidence interval
for the location or scale parameter. Currently, the only possible value is
"normal.approx"
(the default). See the DETAILS section for more information.
This argument is ignored if ci=FALSE
.
a scalar between 0 and 1 indicating the confidence level of the confidence interval.
The default value is conf.level=0.95
. This argument is ignored if
ci=FALSE
.
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 location=
scale=
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 Estimators Based on the Unbiased Estimator of Variance (method="mmue"
)
These estimators are exactly the same as the method of moments estimators given in
equations (4-7) above, except that the method of moments estimator of variance in
equation (7) is replaced with the unbiased estimator of variance:
Confidence Intervals
When ci=TRUE
, an approximate
One-sided confidence intervals for
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 logistic distribution with
# parameters location=0 and scale=1, then estimate the parameters
# and construct a 90% confidence interval for the location parameter.
# (Note: the call to set.seed simply allows you to reproduce this example.)
set.seed(250)
dat <- rlogis(20)
elogis(dat, ci = TRUE, conf.level = 0.9)
#Results of Distribution Parameter Estimation
#--------------------------------------------
#
#Assumed Distribution: Logistic
#
#Estimated Parameter(s): location = -0.2181845
# scale = 0.8152793
#
#Estimation Method: mle
#
#Data: dat
#
#Sample Size: 20
#
#Confidence Interval for: location
#
#Confidence Interval Method: Normal Approximation
# (t Distribution)
#
#Confidence Interval Type: two-sided
#
#Confidence Level: 90%
#
#Confidence Interval: LCL = -0.7899382
# UCL = 0.3535693
#----------
# Clean up
#---------
rm(dat)
# }
Run the code above in your browser using DataLab