Before revision:  Relevant R functions are provided in the Supplementary Materials .
After revision:  An R package Qapprox that implements related methods is available on CRAN .