alpha.compute: computes cumulative logistic coefficients using probabilities

Description Usage Arguments Details Value See Also Examples

View source: R/alpha.compute.R

Description

computes cumulative logistic coefficients using probabilities.

Usage

1

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:

\code{p[1]+...+p[i]=P(Y<=i)=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

1
2
3
4
5
# 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)))

abureau/LCAextend documentation built on May 3, 2019, 9:41 p.m.