Copy of ks from http://www.mvstat.net/tduong/software/ kernel smoothing