SGBLik {SGB} | R Documentation |
SGB log-likelihood and gradient
Description
fn.SGB
gives the log-likelihood and gr.SGB
the gradient vector of the log-likelihood.
Usage
fn.SGB(x, d, u, V, weight, ...)
gr.SGB(x, d, u, V, weight, ...)
Arguments
x |
vector of parameters ( |
d |
data matrix of explanatory variables (without constant vector) |
u |
data matrix of compositions (independent variables) |
V |
full rank transformation of log(parts) into log-ratios, matrix |
weight |
vector of length |
... |
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
Examples
## 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]))