created function to convert a generalised sparse grid to a polynomial chaos expansion