Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

aknn.reg

The α-k-NN regression for compositional response data


Description

The α-k-NN regression for compositional response data.

Usage

aknn.reg(xnew, y, x, a = seq(0.1, 1, by = 0.1), k = 2:10,
apostasi = "euclidean", rann = FALSE)

Arguments

xnew

A matrix with the new predictor variables whose compositions are to be predicted.

y

A matrix with the compositional response data. Zeros are allowed.

x

A matrix with the available predictor variables.

a

The value of α. As zero values in the compositional data are allowed, you must be careful to choose strictly positive vcalues of α. If negative values are passed, the positive ones are used only.

k

The number of nearest neighbours to consider. It can be a single number or a vector.

apostasi

The type of distance to use, either "euclidean" or "manhattan".

rann

If you have large scale datasets and want a faster k-NN search, you can use kd-trees implemented in the R package "RANN". In this case you must set this argument equal to TRUE. Note however, that in this case, the only available distance is by default "euclidean".

Details

The α-k-NN regression for compositional response variables is applied.

Value

A list with the estimated compositional response data for each value of α and k.

Author(s)

Michail Tsagris

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

References

Michail Tsagris, Abdulaziz Alenazi and Connie Stewart (2020). The alpha-k-NN- regression for compositional data. https://arxiv.org/pdf/2002.05137.pdf

See Also

Examples

y <- as.matrix( iris[, 1:3] )
y <- y / rowSums(y)
x <- iris[, 4]
mod <- aknn.reg(x, y, x, a = c(0.4, 0.5), k = 2:3, apostasi = "euclidean")

Compositional

Compositional Data Analysis

v4.6
GPL (>= 2)
Authors
Michail Tsagris [aut, cre], Giorgos Athineou [aut], Abdulaziz Alenazi [ctb]
Initial release
2021-04-27

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.