pmm | R Documentation |
For each value in the prediction vector xtest
, one of the closest k
values in the prediction vector xtrain
is randomly chosen and its observed
value in ytrain
is returned. Note that xtrain
and xtest
must be both either
numeric, logical, or factor-valued. ytest
can be of any type.
pmm(xtrain, xtest, ytrain, k = 1L, seed = NULL)
xtrain |
Vector with predicted values in the training data. Must be numeric, logical, or factor-valued. |
xtest |
Vector as |
ytrain |
Vector of the observed values in the training data. Must be of same
length as |
k |
Number of nearest neighbours (donors) to sample from. |
seed |
Integer random seed. |
Vector of the same length as xtest
with values from xtrain
.
pmm(xtrain = c(0.2, 0.3, 0.8), xtest = c(0.7, 0.2), ytrain = 1:3, k = 1) # c(3, 1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.