SGBdistrib | R Documentation |
dSGB
computes the density for a given argument u
(a composition) and given parameters.
rSGB
generates n
compositions for given parameters.
dSGB(u, shape1, scale, shape2)
rSGB(n, shape1, scale, shape2)
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. |
The number of columns in u
and the number of components in shape2
must match.
dSGB gives the density, rSGB generates a (n \times D
- matrix with random compositions on each row.
bval, zval
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.