Learn R Programming

LCAextend (version 1.3)

p.compute: computes the probability vector using logistic coefficients

Description

computes the probability vector using cumulative logistic coefficients

Usage

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

Value

p: a probability vector

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\leq i)=\frac{\exp(\alpha_1+...+\alpha_i)}{(1+\exp(\alpha_1+...+\alpha_i)} $$

for all i<=S-1.

See Also

p.compute is the inverse function of alpha.compute

Examples

Run this code
# NOT RUN {
# 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
# }

Run the code above in your browser using DataLab