# kl.compreg2: Helper functions for the Kullback-Leibler regression In Compositional: Compositional Data Analysis

## Description

Helper functions for the Kullback-Leibler regression.

## Usage

 ```1 2``` ```kl.compreg2(y, x, xnew = NULL, tol = 1e-07, maxiters = 50) klcompreg.boot(y, x, der, der2, id, b1, n, p, d, tol = 1e-07, maxiters = 50) ```

## Arguments

 `y` A matrix with the compositional data (dependent variable). Zero values are allowed. For the klcompreg.boot the first column is removed. `x` The predictor variable(s), they can be either continuous or categorical or both. In the klcompreg.boot this is the design matrix, with the ones in the first column. `xnew` If you have new data use it, otherwise leave it NULL. `tol` The tolerance value to terminate the Newton-Raphson procedure. `maxiters` The maximum number of Newton-Raphson iterations. `der` An vector to put the first derivative there. `der2` An empty matrix to put the second derivatives there, the Hessian matrix will be put here. `id` A help vector with indices. `b1` The matrix with the initial estimated coefficients. `n` The sample size `p` The number of columns of the design matrix. `d` The dimensionality of the simplex, that is the number of columns of the compositional data minus 1.

## Details

These are help functions for the `kl.compreg` function. They are not to be called directly by the user.

## Value

For kl.compreg2 a list including:

 `runtime` The time required by the regression. `be` 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).

For the klcompreg.boot a matrix with the estimated coefficients.

## Author(s)

Michail Tsagris

R implementation and documentation: Michail Tsagris <[email protected]>

## References

Murteira, Jose MR, and Joaquim JS Ramalho 2016. Regression analysis of multivariate fractional data. Econometric Reviews 35(4): 515-552.

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

## Examples

 ```1 2 3 4 5 6``` ``` library(MASS) x <- as.vector(fgl[, 1]) y <- as.matrix(fgl[, 2:9]) y <- y / rowSums(y) mod1<- kl.compreg(y, x, B = 1, ncores = 1) mod2 <- js.compreg(y, x, B = 1, ncores = 1) ```

### Example output

```
```

Compositional documentation built on June 4, 2018, 5:04 p.m.