logistic.RdEstimates the location and scale parameters of the logistic distribution by maximum likelihood estimation.
logistic1(llocation = "identitylink", scale.arg = 1, imethod = 1)
logistic(llocation = "identitylink", lscale = "loglink",
ilocation = NULL, iscale = NULL, imethod = 1, zero = "scale")Parameter link functions applied to the location parameter \(l\)
and scale parameter \(s\).
See Links for more choices, and
CommonVGAMffArguments for more information.
Known positive scale parameter (called \(s\) below).
See CommonVGAMffArguments for information.
See CommonVGAMffArguments for information.
The two-parameter logistic distribution has a density that can be written as $$f(y;l,s) = \frac{\exp[-(y-l)/s]}{ s\left( 1 + \exp[-(y-l)/s] \right)^2}$$ where \(s > 0\) is the scale parameter, and \(l\) is the location parameter. The response \(-\infty<y<\infty\). The mean of \(Y\) (which is the fitted value) is \(l\) and its variance is \(\pi^2 s^2 / 3\).
A logistic distribution with scale = 0.65
(see dlogis)
resembles
dt
with df = 7;
see logistic1 and studentt.
logistic1 estimates the location parameter only while
logistic estimates both parameters.
By default,
\(\eta_1 = l\)
and \(\eta_2 = \log(s)\)
for logistic.
logistic can handle multiple responses.
An object of class "vglmff"
(see vglmff-class).
The object is used by modelling functions
such as vglm,
rrvglm and vgam.
Johnson, N. L. and Kotz, S. and Balakrishnan, N. (1994). Continuous Univariate Distributions, 2nd edition, Volume 1, New York: Wiley. Chapter 15.
Forbes, C., Evans, M., Hastings, N. and Peacock, B. (2011). Statistical Distributions, Hoboken, NJ, USA: John Wiley and Sons, Fourth edition.
Castillo, E., Hadi, A. S., Balakrishnan, N. and Sarabia, J. S. (2005). Extreme Value and Related Models with Applications in Engineering and Science, Hoboken, NJ, USA: Wiley-Interscience, p.130.
deCani, J. S. and Stine, R. A. (1986). A Note on Deriving the Information Matrix for a Logistic Distribution, The American Statistician, 40, 220–222.
Fisher scoring is used, and the Fisher information matrix is diagonal.
# Location unknown, scale known
ldata <- data.frame(x2 = runif(nn <- 500))
ldata <- transform(ldata, y1 = rlogis(nn, loc = 1+5*x2, sc = exp(2)))
fit1 <- vglm(y1 ~ x2, logistic1(scale = exp(2)), ldata, trace = TRUE)
#> Iteration 1: loglikelihood = -1980.8368
#> Iteration 2: loglikelihood = -1980.7961
#> Iteration 3: loglikelihood = -1980.7961
coef(fit1, matrix = TRUE)
#> location
#> (Intercept) 1.165758
#> x2 6.095522
# Both location and scale unknown
ldata <- transform(ldata, y2 = rlogis(nn, loc = 1 + 5*x2, exp(x2)))
fit2 <- vglm(cbind(y1, y2) ~ x2, logistic, data = ldata, trace = TRUE)
#> Iteration 1: loglikelihood = -3885.2006
#> Iteration 2: loglikelihood = -3563.3616
#> Iteration 3: loglikelihood = -3349.9904
#> Iteration 4: loglikelihood = -3273.1111
#> Iteration 5: loglikelihood = -3266.0782
#> Iteration 6: loglikelihood = -3266.024
#> Iteration 7: loglikelihood = -3266.0238
#> Iteration 8: loglikelihood = -3266.0238
coef(fit2, matrix = TRUE)
#> location1 loglink(scale1) location2 loglink(scale2)
#> (Intercept) 1.174509 1.964806 1.052873 0.5701189
#> x2 6.080957 0.000000 4.336689 0.0000000
vcov(fit2)
#> (Intercept):1 (Intercept):2 (Intercept):3 (Intercept):4 x2:1
#> (Intercept):1 1.291529 0.000000000 0.00000000 0.000000000 -1.913697
#> (Intercept):2 0.000000 0.001398644 0.00000000 0.000000000 0.000000
#> (Intercept):3 0.000000 0.000000000 0.07937843 0.000000000 0.000000
#> (Intercept):4 0.000000 0.000000000 0.00000000 0.001398644 0.000000
#> x2:1 -1.913697 0.000000000 0.00000000 0.000000000 3.713461
#> x2:2 0.000000 0.000000000 -0.11761736 0.000000000 0.000000
#> x2:2
#> (Intercept):1 0.0000000
#> (Intercept):2 0.0000000
#> (Intercept):3 -0.1176174
#> (Intercept):4 0.0000000
#> x2:1 0.0000000
#> x2:2 0.2282323
summary(fit2)
#>
#> Call:
#> vglm(formula = cbind(y1, y2) ~ x2, family = logistic, data = ldata,
#> trace = TRUE)
#>
#> Coefficients:
#> Estimate Std. Error z value Pr(>|z|)
#> (Intercept):1 1.1745 1.1364 1.033 0.301377
#> (Intercept):2 1.9648 0.0374 52.537 < 2e-16 ***
#> (Intercept):3 1.0529 0.2817 3.737 0.000186 ***
#> (Intercept):4 0.5701 0.0374 15.244 < 2e-16 ***
#> x2:1 6.0810 1.9270 3.156 0.001602 **
#> x2:2 4.3367 0.4777 9.078 < 2e-16 ***
#> ---
#> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
#>
#> Names of linear predictors: location1, loglink(scale1), location2,
#> loglink(scale2)
#>
#> Log-likelihood: -3266.024 on 1994 degrees of freedom
#>
#> Number of Fisher scoring iterations: 8
#>
#> No Hauck-Donner effect found in any of the estimates
#>