TODO: farm out to C++ and test, at least when there are no NAs
Arguments
- x
Input data matrix: samples are columns, regions/loci are rows
- k
Number of windows to use (default k=1, i.e., 3 windows)
- iter
Number of iterations to smooth (default is 2)
- na.rm
Whether to remove NAs prior to smoothing (TRUE)
- delta
Convergence threshhold (overrides iter if > 0; default is 0)
- w
Weights, if using any (NULL)