A Statistical Study of Wavelet Coherence for Stationary and Nonstationary Processes