Cross validation for some compositional regression models {Compositional}R Documentation

Cross validation for some compositional regression models

Description

Cross validation for some compositional regression models.

Usage

cv.comp.reg(y, x, type = "comp.reg", nfolds = 10, folds = NULL, seed = FALSE)

Arguments

y

A matrix with compositional data. Zero values are allowed for some regression models.

x

The predictor variable(s).

type

This can be one of the following: "comp.reg", "robust", "kl.compreg", "js.compreg", "diri.reg" or "zadr".

nfolds

The number of folds to be used. This is taken into consideration only if the folds argument is not supplied.

folds

If you have the list with the folds supply it here. You can also leave it NULL and it will create folds.

seed

If seed is TRUE the results will always be the same.

Details

A k-fold cross validation for a compositional regression model is performed.

Value

A list including:

runtime

The runtime of the cross-validation procedure.

kl

The Kullback-Leibler divergences for all runs.

js

The Jensen-Shannon divergences for all runs.

perf

The average Kullback-Leibler divergence and average Jensen-Shannon divergence.

Author(s)

Michail Tsagris

R implementation and documentation: Michail Tsagris mtsagris@uoc.gr.

See Also

comp.reg, kl.compreg, compppr.tune, aknnreg.tune

Examples

y <- as.matrix( iris[, 1:3] )
y <- y / rowSums(y)
x <- iris[, 4]
mod <- cv.comp.reg(y, x)

[Package Compositional version 5.2 Index]