SGBdistrib: Density and random generator for the SGB distribution

Description Usage Arguments Details Value See Also Examples

Description

dSGB computes the density for a given argument u (a composition) and given parameters.
rSGB generates n compositions for given parameters.

Usage

1
2
dSGB(u, shape1, scale, shape2) 
rSGB(n, shape1, scale, shape2)

Arguments

u

vector of length D containing the composition

shape1

overall shape parameter. shape1 = 1 for a Dirichlet composition.

scale

vector of the same length as u containing the scales of parts. If missing, scales are set to 1.

shape2

vector of length D containing the (Dirichlet) shapes for each part.

n

number of observations.

Details

The number of columns in u and the number of components in shape2 must match.

Value

dSGB gives the density, rSGB generates a (n \times D - matrix with random compositions on each row.

See Also

bval, zval

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
   u1 <- c(0.2,0.3,0.5)
   scale1 <- c(0.25,0.33,0.32)
   shape1 <- 1
   shape2 <- c(0.8,3,0.9)
   dSGB(u1,shape1,scale1,shape2)
   rSGB(10,shape1,scale1,shape2)
   

## with equal scales
   dSGB(u1,shape1,shape2=shape2)
   rSGB(10,shape1,shape2=shape2)
 

SGB documentation built on March 26, 2020, 8:02 p.m.