| alpha.compute {LCAextend} | R Documentation |
computes cumulative logistic coefficients using probabilities
Description
computes cumulative logistic coefficients using probabilities.
Usage
alpha.compute(p)
Arguments
p |
a vector of probabilities (positive entries summing to 1). |
Details
If p has one value (equal to 1) alpha.compute returns NA, if it has S (S>=2) values, alpha.compute returns S-1 coefficients
alpha such that if Y is a random variable taking values in {1,...,S} with probabilities p, coefficients alpha[i] are given by:
p_1+...+p_i=P(Y\leq i)=\frac{\exp(\alpha_1+...+\alpha_i)}{1+\exp(\alpha_1+...+\alpha_i)},
for all i<=S-1.
Value
The function returns alpha: a vector of S-1 cumulative logistic coefficients.
See Also
alpha.compute is the inverse function of p.compute
Examples
# a vector of probability
p <- c(0,0.2,0,0,0.3,0.4,0.1,0,0)
alpha.compute(p)
#gives -Inf -1.38 0 0 1.38 0 2.19 Inf Inf
p.compute(alpha.compute(rep(1/5,5)))
[Package LCAextend version 1.3 Index]