internal function. It collects only the data necessary to execute a local prediction for the mbl function based on a list of neighbors. Not valid for local dissmilitary (e.g. for ortho_diss(...., .local = TRUE))
ith_mbl_neighbor(
Xr,
Xu = NULL,
Yr,
Yu = NULL,
diss_usage = "none",
neighbor_indices,
neighbor_diss = NULL,
diss_xr_xr = NULL,
group = NULL
)
an object of class
iterator giving the following list:
ith_xr: the Xr data of the neighbors for the ith observation (if
diss_usage = "predictors"
, this data is combined with the local
dissmilarity scores of the neighbors of Xu (or Xr if Xu was not provided))
ith_yr: the Yr data of the neighbors for the ith observation
ith_xu: the ith Xu observation (or Xr if Xu was not provided).
If diss_usage = "predictors"
, this data is combined with the local
dissmilarity scores to its Xr neighbors.
ith_yu: the ith Yu observation (or Yr observation if Xu was not provided).
ith_neigh_diss: the dissimilarity scores of the neighbors for the ith observation.
ith_group: the group labels for ith_xr.
n_k: the number of neighbors.
the Xr matrix in mbl.
the Xu matrix in mbl. Default NULL
. If not provided, the
function will iterate for each {Yr, Xr}
to get the respective neighbors.
the Yr matrix in mbl.
the Yu matrix in mbl. Default NULL
.
a character string indicating if the dissimilarity data will be used as predictors ("predictors") or not ("none").
a matrix with the indices of neighbors of every Xu found in Xr.
a matrix with the dissimilarity socres for the neighbors
of every Xu found in Xr. This matrix is organized in the same way as
neighbor_indices
.
a dissimilarity matrix between sampes in Xr.
a factor representing the group labels of Xr.
Leonardo Ramirez-Lopez
isubset will look at the order of knn in each col of D and re-organize the rows of x accordingly