Description Usage Arguments Value References Examples
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.
1 | mlelogistic(x, eps = 1e-04)
|
x |
A numeric vector. |
eps |
This quantity validates that the initial guess is a consistent estimator of theta based on the inputted precision. |
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.
Hogg, R., McKean, J., Craig, A. (2018) Introduction to Mathematical Statistics, 8th Ed. Boston: Pearson.
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.