summaryA.SGB {SGB} | R Documentation |
Aitchison expectation and mode under the SGB distribution
Description
The expectation and mode in the log-ratio space, transformed back to the simplex.
Usage
MeanA.SGB(shape1, scale, shape2)
ModeA.SGB(shape1, scale, shape2)
MeanAobj.SGB(obj)
ModeAobj.SGB(obj)
Arguments
shape1 |
overall shape parameter. |
scale |
vector of length |
shape2 |
vector of length |
obj |
list, result of regSGB. See |
Details
MeanA
, ModeA
compute Aitchison expectation and mode in function of the SGB distribution parameters, whereas MeanAobj
, ModeAobj
compute Aitchison expectation and mode in function of the model variables in an SGB regression object.
Value
A matrix or vector of dimensions (n \times D)
.
Each row gives the Aitchison expectation for compositions having the corresponding set of auxiliary variables.
References
Aitchison, J. (1986). The Statistical Analysis of Compositional Data. Monographs on Statistics and Applied Probability. Chapman and Hall Ltd (reprinted 2003 with additional material by the Blackburn Press, London (UK).
See Also
oilr
.
Examples
set.seed(1234)
x <- c(2,rnorm(4,0,1),1.8,3.1,4.0)
d <- c(3.2,4.6)
V <- t(matrix(c(1/sqrt(2),-1/sqrt(2),0,
1/sqrt(6),1/sqrt(6),-2/sqrt(6)),
nrow=2,byrow=TRUE))
D <- 3
shape1 <- x[1]
scale <- bval(D,x,d,V)
shape2 <- x[(length(x)-D+1):length(x)]
# Expectation
MeanA.SGB(shape1,scale,shape2)
# Mode
ModeA.SGB(shape1, scale, shape2)
## Arctic lake data
# oilr is a SGB regression object
data(oilr)
MeanAobj.SGB(oilr) # is the same as oilr[["meanA"]]
ModeAobj.SGB(oilr)