cub_dist: cub distribution

Description Usage Arguments Examples

Description

Density, distribution function, quantile function and random generation for the cub distribution given parameters pi and xi.

Usage

1
2
3
4
5
6
7
dcub(x, pi, xi, m, log = FALSE)

pcub(q, pi, xi, m, lower.tail = TRUE, log = FALSE)

qcub(p, pi, xi, m, lower.tail = TRUE, log = FALSE)

rcub(n, pi, xi, m = 5)

Arguments

x, q

vector of quantiles.

pi

uncertainty parameter belongs to (0, 1].

xi

feeling parameter belongs to [0, 1].

m

the maximum value.

log

logical; if TRUE, densities are given as log.

lower.tail

logical; if TRUE (default), probabilities are P[X <= x] otherwise, P[X > x].

p

vector of probabilities.

n

number of observations

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# Examples with dcub

dcub(x=4, pi=0.3, xi=0.7, m=5)
dcub(x=1, pi=0.5, xi=0.4, m=8)
dcub(x=c(4, 1), pi=c(0.3, 0.5), xi=c(0.7, 0.4), m=c(5, 8))

# Examples with pcub

# low xi is associated with high ratings
pcub(q=5, pi=0.5, xi=0.2, m=10, lower.tail=FALSE)

# high pi is associated with indecision in choosing
pcub(q=3, pi=0.9, xi=0.5, m=4) 

# probability for several quantiles
pcub(q=c(1,3,5), pi=0.3, xi=0.6, m=5)

# Examples with qcub

# low xi is associated with high ratings
qcub(p=0.1, pi=0.5, xi=0.1, m=7, lower.tail=TRUE)

# high pi is associated with indecision in choosing
qcub(p=0.86, pi=0.9, xi=0.5, m=4)

#quantiles for several probabilities 
qcub(p=c(1,0.5,0.9), pi=0.3, xi=0.6, m=5)

# Examples with rcub
# Random sample, low xi is associated with high ratings
x <- rcub(n=1000, pi=0.9, xi=0.1, m=5)
barplot(prop.table(table(x)))

# Random sample, low pi is associated with random choices
y <- rcub(n=1000, pi=0.1, xi=0.1, m=5)
barplot(prop.table(table(y)))

fhernanb/cubm documentation built on Dec. 10, 2020, 1:24 p.m.