Learn R Programming

SGB (version 1.0.1.1)

summaryA.SGB: 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)

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.

Arguments

shape1

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

scale

vector of length \(D\) or matrix with \(D\) columns containing the scales of parts.

shape2

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

obj

list, result of regSGB. See regSGB.

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.

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

Run this code
   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)

Run the code above in your browser using DataLab