mlelogistic: MLE Estimation of Location Based on a Logistic Distribution

Description Usage Arguments Value References Examples

Description

The following code obtains the mle for the location parameter theta, assuming that the sample is drawn from a logistic distribution with mean (or median) theta and scale parameter 1. The pdf is given in the expression (6.1.8), page 357. The algorithm is a Newton-type procedure discussed in Examples 6.1.2 and 6.2.7. To use it to estimate location for a given sample, standardize the sample first; for example, divide the sample items by the sample standard deviation or the interquartile range.

Usage

1
mlelogistic(x, eps = 1e-04)

Arguments

x

A numeric vector.

eps

This quantity validates that the initial guess is a consistent estimator of theta based on the inputted precision.

Value

theta1 is the asymptotically efficient estimate of theta. check is the difference between the initial guess of theta (i.e. theta0) and the calculated estimate (i.e. theta1). realnumstps is the number of iterations which was involved in obtaining theta1.

References

Hogg, R., McKean, J., Craig, A. (2018) Introduction to Mathematical Statistics, 8th Ed. Boston: Pearson.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
# The following function generates a sample of size n from the logistic
# distribution with location theta and scale 1.

rlogisticd <- function(n, theta) {
    u <- runif(n)
    rlogisticd <- log(u/(1 - u)) + theta
    return(rlogisticd)
    }

# The following code generates a sample and fits it using mlelogistic

n <- 50
theta <- 10
x <- rlogisticd(n, theta)

mlelogistic(x)

austinragotzy/mathstat documentation built on May 13, 2019, 11:30 a.m.