SGBlik: SGB log-likelihood and gradient

Description Usage Arguments Details Value References See Also Examples

Description

fn.SGB gives the log-likelihood and gr.SGB the gradient vector of the log-likelihood.

Usage

1
2
fn.SGB(x, d, u, V,  weight, ...)
gr.SGB(x, d, u, V, weight, ...)

Arguments

x

vector of parameters (shape1, coefi, shape2) where shape1 is the overall shape, coefi is the vector of regression coefficients (see initpar.SGB) and shape2 the vector of D Dirichlet shape parameters.

d

data matrix of explanatory variables (without constant vector) (n x m); n: sample size, m: number of auxiliary variables

u

data matrix of compositions (independent variables) (n x D); D: number of parts

V

full rank transformation of log(parts) into log-ratios, matrix (D x (D-1))

weight

vector of length n; positive observation weights, default rep(1,n). Should be scaled to sum to n.

...

others parameters that might be introduced.

Details

The analytical expression for fn.SGB is found in the vignette "SGB regression", Section 3.2. More details in Graf(2017).

Value

fn.SGB: value of the log-likelihood at parameter x
gr.SGB: gradient vector at parameter x.

References

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.

See Also

regSGB

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
## Explanatory variable
da <- data.frame(l.depth=log(arc[["depth"]]))  
damat <- as.matrix(da)

## Compositions
ua <- as.matrix(arc[,1:3])

## alr transforms
Va <- matrix(c(1,0,-1,0,1,-1),nrow=3)   
colnames(Va) <- c("alr1","alr2")
Va

## Initial values
x <- initpar.SGB(damat,ua,Va)
fn.SGB(x, damat, ua, Va,weight=rep(1,dim(da)[1]))
gr.SGB(x, damat, ua, Va,weight=rep(1,dim(da)[1]))

SGB documentation built on March 26, 2020, 8:02 p.m.