SGBdistrib {SGB} | R Documentation |
Density and random generator for the SGB distribution
Description
dSGB
computes the density for a given argument u
(a composition) and given parameters.
rSGB
generates n
compositions for given parameters.
Usage
dSGB(u, shape1, scale, shape2)
rSGB(n, shape1, scale, shape2)
Arguments
u |
vector of length |
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 |
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
Examples
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)
[Package SGB version 1.0.1.1 Index]