Description Usage Arguments Details Value References See Also Examples
fn.SGB
gives the log-likelihood and gr.SGB
the gradient vector of the log-likelihood.
1 2 |
x |
vector of 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. |
The analytical expression for fn.SGB
is found in the vignette "SGB regression", Section 3.2. More details in Graf(2017).
fn.SGB: value of the log-likelihood at parameter x
gr.SGB: gradient vector at parameter x
.
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.
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]))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.