Learn R Programming

Compositional (version 1.4)

Divergence based regression for compositional data: Divergence based regression for compositional data

Description

Regression for compositional data based on the Kullback-Leibler and the Jensen-Shannon divergence.

Usage

kl.compreg(y, x, B = 1, ncores = 1, xnew = NULL) js.compreg(y, x, B = 1, ncores = 1, xnew = NULL)

Arguments

y
A matrix with the compositional data (dependent variable). Zero values are allowed.
x
The predictor variable(s), they can be either continnuous or categorical or both.
B
If B is greater than 1 bootstrap estimates of the standard error are returned. If B=1, no standard errors are returned.
ncores
If ncores is 2 or more parallel computing is performed. This is to be used for the case of bootstrap. If B=1, this is not taken into consideration.
xnew
If you have new data use it, otherwise leave it NULL.

Value

A list including:
runtime
The time required by the regression.
beta
The beta coefficients.
seb
The standard error of the beta coefficients, if bootstrap is chosen, i.e. if B > 1.
est
The fitted or the predicted values (if xnew is not NULL).

Details

The Kullback-Leibler divergence is adopted as the objective function. This involves numerical optimisation. There is no log-likelihood.

References

Murteira, Jose MR, and Joaquim JS Ramalho. Regression analysis of multivariate fractional data. Econometric Reviews (To appear).

See Also

diri.reg, js.compreg, ols.compreg, comp.reg

Examples

Run this code
library(MASS)
x <- fgl[, 1]
y <- fgl[, 2:9]
mod1<- kl.compreg(y, x, B = 1, ncores = 1)
mod2 <- js.compreg(y, x, B = 1, ncores = 1)

Run the code above in your browser using DataLab