Quantum Monte Carlo study of the three-to one-dimensional crossover for a trapped Bose gas