p.compute: computes the probability vector using logistic coefficients

Description Usage Arguments Details Value See Also Examples

View source: R/p.compute.R

Description

computes the probability vector using cumulative logistic coefficients

Usage

1
p.compute(alpha,decal)

Arguments

alpha

a vector of cumulative logistic coefficients, the first value can be -Inf, followed by, eventually, only one negative value, then only positive values. It can end by Inf values.

decal

offset term to be applied to sums of logistic coefficients

Details

If alpha has S-1 values, p.compute returns p of length S. 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<=i)=exp(alpha[1]+...+alpha[i])/(1+exp(alpha[1]+...+alpha[i]))

for all i<=S-1.

Value

p: a probability vector

See Also

p.compute is the inverse function of alpha.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 <- alpha.compute(p)
#gives alpha= -Inf -1.38 0 0 1.38 0 2.19 Inf Inf
p.compute(alpha) #gives p

LCAextend documentation built on May 2, 2019, 2:02 a.m.