The alpha-k-NN regression for compositional response data | R Documentation |
\alpha
-k-NN regression for compositional response data
The \alpha
-k-NN regression for compositional response data.
aknn.reg(xnew, y, x, a = seq(0.1, 1, by = 0.1), k = 2:10,
apostasi = "euclidean", rann = FALSE)
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(s) of |
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 "Rnanoflann". 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". |
The \alpha
-k-NN regression for compositional response variables is applied.
A list with the estimated compositional response data for each value of \alpha
and k.
Michail Tsagris.
R implementation and documentation: Michail Tsagris mtsagris@uoc.gr.
Tsagris M., Alenazi A. and Stewart C. (2023). Flexible non-parametric regression models for compositional response data with zeros. Statistics and Computing, 33(106).
https://link.springer.com/article/10.1007/s11222-023-10277-5
aknnreg.tune, akern.reg, alfa.reg, comp.ppr, comp.reg, kl.compreg
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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.