logistic: Logistic Distribution Family Function

Description Usage Arguments Details Value Note Author(s) References See Also Examples

View source: R/family.univariate.R

Description

Estimates the location and scale parameters of the logistic distribution by maximum likelihood estimation.

Usage

1
2
3
logistic1(llocation = "identitylink", scale.arg = 1, imethod = 1)
logistic(llocation = "identitylink", lscale = "loglink",
         ilocation = NULL, iscale = NULL, imethod = 1, zero = "scale")

Arguments

llocation, lscale

Parameter link functions applied to the location parameter l and scale parameter s. See Links for more choices, and CommonVGAMffArguments for more information.

scale.arg

Known positive scale parameter (called s below).

ilocation, iscale

See CommonVGAMffArguments for information.

imethod, zero

See CommonVGAMffArguments for information.

Details

The two-parameter logistic distribution has a density that can be written as

f(y;l,s) = exp[-(y-l)/s] / [s * ( 1 + exp[-(y-l)/s] )^2]

where s > 0 is the scale parameter, and l is the location parameter. The response -Inf<y<Inf. 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, eta1 = l and eta2 = log(s) for logistic.

logistic can handle multiple responses.

Value

An object of class "vglmff" (see vglmff-class). The object is used by modelling functions such as vglm, rrvglm and vgam.

Note

Fisher scoring is used, and the Fisher information matrix is diagonal.

Author(s)

T. W. Yee

References

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. 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.

See Also

rlogis, CommonVGAMffArguments, logitlink, cumulative, bilogistic, simulate.vlm.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
# Location unknown, scale known
ldata <- data.frame(x2 = runif(nn <- 500))
ldata <- transform(ldata, y1 = rlogis(nn, loc = 1 + 5*x2, scale = exp(2)))
fit1 <- vglm(y1 ~ x2, logistic1(scale = exp(2)), data = ldata, trace = TRUE)
coef(fit1, matrix = TRUE)

# Both location and scale unknown
ldata <- transform(ldata, y2 = rlogis(nn, loc = 1 + 5*x2, scale = exp(0 + 1*x2)))
fit2 <- vglm(cbind(y1, y2) ~ x2, logistic, data = ldata, trace = TRUE)
coef(fit2, matrix = TRUE)
vcov(fit2)
summary(fit2)

Example output

Loading required package: stats4
Loading required package: splines
VGLM    linear loop  1 :  loglikelihood = -2004.4103
VGLM    linear loop  2 :  loglikelihood = -2004.2981
VGLM    linear loop  3 :  loglikelihood = -2004.2981
VGLM    linear loop  4 :  loglikelihood = -2004.2981
            location
(Intercept) 1.735079
x2          4.212231
VGLM    linear loop  1 :  loglikelihood = -3927.8491
VGLM    linear loop  2 :  loglikelihood = -3600.6354
VGLM    linear loop  3 :  loglikelihood = -3375.0965
VGLM    linear loop  4 :  loglikelihood = -3281.6324
VGLM    linear loop  5 :  loglikelihood = -3269.5984
VGLM    linear loop  6 :  loglikelihood = -3269.3901
VGLM    linear loop  7 :  loglikelihood = -3269.3897
VGLM    linear loop  8 :  loglikelihood = -3269.3897
            location1 loge(scale1) location2 loge(scale2)
(Intercept)  1.737006     2.006655 0.9644673    0.5145061
x2           4.207440     0.000000 4.8883204    0.0000000
              (Intercept):1 (Intercept):2 (Intercept):3 (Intercept):4      x2:1
(Intercept):1      1.295110   0.000000000    0.00000000   0.000000000 -1.968929
(Intercept):2      0.000000   0.001398644    0.00000000   0.000000000  0.000000
(Intercept):3      0.000000   0.000000000    0.06550303   0.000000000  0.000000
(Intercept):4      0.000000   0.000000000    0.00000000   0.001398644  0.000000
x2:1              -1.968929   0.000000000    0.00000000   0.000000000  4.025078
x2:2               0.000000   0.000000000   -0.09958290   0.000000000  0.000000
                    x2:2
(Intercept):1  0.0000000
(Intercept):2  0.0000000
(Intercept):3 -0.0995829
(Intercept):4  0.0000000
x2:1           0.0000000
x2:2           0.2035771

Call:
vglm(formula = cbind(y1, y2) ~ x2, family = logistic, data = ldata, 
    trace = TRUE)


Pearson residuals:
                 Min      1Q   Median     3Q   Max
location1    -1.7312 -0.8758  0.07952 0.8622 1.723
loge(scale1) -0.8363 -0.7191 -0.36342 0.2970 6.078
location2    -1.7316 -0.8008  0.02685 0.8203 1.732
loge(scale2) -0.8362 -0.7470 -0.43466 0.2663 8.362

Coefficients: 
              Estimate Std. Error z value Pr(>|z|)    
(Intercept):1   1.7370     1.1380   1.526 0.126928    
(Intercept):2   2.0067     0.0374  53.656  < 2e-16 ***
(Intercept):3   0.9645     0.2559   3.768 0.000164 ***
(Intercept):4   0.5145     0.0374  13.757  < 2e-16 ***
x2:1            4.2074     2.0063   2.097 0.035980 *  
x2:2            4.8883     0.4512  10.834  < 2e-16 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Number of linear predictors:  4 

Names of linear predictors: location1, loge(scale1), location2, loge(scale2)

Log-likelihood: -3269.39 on 1994 degrees of freedom

Number of iterations: 8 

VGAM documentation built on Jan. 16, 2021, 5:21 p.m.