| SGButil | R Documentation |
bval computes the scale for each observed composition from the parameters and auxiliary variables for that observation.
zval computes the z-vector for each observed composition, i.e. the transform that is Dirichlet distributed under the SGB model for the observed composition.
bval(D, x, d, V) zval(u, x, d, V)
D |
number of parts |
x |
vector of parameters ( |
d |
(n \times m) - data matrix of explanatory variables (variables corresponding to |
u |
(n \times D) - data matrix of compositions (independent variables); D: number of parts |
V |
D \times (D-1) - matrix specifying the full rank transformation of log(parts) into log-ratios |
See Graf (2017), Equation (8), or the vignette "SGB regression", Equation (1).
transformed composition of length D.
Graf, M. (2017). A distribution on the simplex of the Generalized Beta type. In J. A. Martin-Fernandez (Ed.), Proceedings CoDaWork 2017, University of Girona (Spain), 71-90.
## Example with 2 compositions u <- matrix(c(0.2,0.4,0.5,0.5,0.3,0.2),nrow=2,byrow=TRUE) u D <- NCOL(u) # number of parts ## auxiliary variable d <- matrix(c(3.2,4.6),ncol=1) ## log-ratio transformation V <- matrix(c(c(1,-1,0)/sqrt(2),c(1,1,-2)/sqrt(6)),ncol=2) ## vector of parameters: shape1 <- 2.00 coefi <- c(-0.78, 0.06, 0.96, -0.11) shape2 <- c(1.80, 3.10, 4.00) x <-c(shape1, coefi, shape2) bval(D,x,d,V) zval(u,x,d,V)