my.knn: K-nearest neighbors smoother

Description Usage Arguments Examples

View source: R/my.knn.R

Description

For multiple metrics - Euclidean and Mahalanobis Written for data.table arguments.

Usage

1
2
3
4
5
6
7
8
9
my.knn(
  Yvar,
  Xvars,
  read_data,
  predict_data,
  metric = "mahalanobis",
  tolerance = 1e-16,
  K = 1L
)

Arguments

Yvar

Dependent variable

Xvars

Character vector of control variables

read_data

Of type data.table - source of data

predict_data

Of type data.table - points for prediction

metric

Metric for comparison

tolerance

Tolerance level for matrix inversion

K

number of neighbors

Examples

1

joshuadhigbee/myAppliedMetrics documentation built on March 19, 2021, 3:45 p.m.