fixed bug in computing the dtransform for the eigenvalue threshold
moved perturbation code into HDStat as a generic function
quick update, code based is currently messy, but all codes necessary for Surya's Berkeley talk is here