# Re: confidence limits for wavelet cross-spectra

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Fri, 21 Sep 2007 07:56:34 -0600

All .... Chris Torrence responded to Bryan offline.
Gil Compo also responded offline but Chris'
is more detailed.
Here is the response.

Hi Bryan,

I think the problem is that the 3.999/2 *is* the 95% chi-square
confidence value, so you do not need to multiply twice by the chi-square
value.

However, what you do need to do is multiply by your background spectrum.
For white-noise this is just 1.0 (so no multiplication needed), but for
red noise you want to use say T&C Eqn 16, or some other pre-determined
background.

So the end of your code would look something like (I don't know ncl):

distrib_at_red = sqrt(abs(Px*Py)) ; *** Do not multiply by 3.999/2
distrib_at_red = distrib_at_red*redNoiseBackground ; *** Need to create
"redNoiseBackground"
xLow = chiinv (pLow, df)/df ; lower confidence
xHigh = chiinv (pHigh, df)/df ; upper confidence
distrib_at_ciHigh = distrib_at_red*xHigh
distrib_at_ciLow = distrib_at_red*xLow
return (distrib)

Bryan, can you post this answer back to the NCL forum?

Cheers,

Chris
Dr. Christopher Torrence

Bryan K Woods wrote:
> Hi all,
> I have been going over the Torrence and Compo 1998 BAMS article on
> wavelets and am slightly confused about how to calculate confidence
> limits for wavelet cross spectra. In their paper they say it can be done
> but give instructions that confuse me. I have constructed what seems to
> be work (qualitatively), but I think I could be off by some scaling
> factor. Below is my function which is past two returned objects from the
> wavelet function with a Morlet transform:
>
> function cowave_ci (wx[2][*][*]:numeric,wy[2][*][*]:numeric)
> local df, Px, Py, distrib, pLow, pHigh, xLow, xHigh
> begin
> df = wx_at_dof
> pLow = conform(df,0.05,-1) ; confidence levels
> pHigh = conform(df,0.95,-1)
> Px = wx_at_fft_theor
> Py = wy_at_fft_theor
> distrib = True distrib_at_red = 3.999/2*sqrt(abs(Px*Py)) ; 3.999/2
> = Zv(95%)/v from Torrence & Compo 1998 eq. 31
> xLow = chiinv (pLow, df)/df ; lower confidence
> xHigh = chiinv (pHigh, df)/df ; upper confidence
> distrib_at_ciHigh = distrib_at_red*xHigh
> distrib_at_ciLow = distrib_at_red*xLow
>
> return (distrib)
> end
>
> Do I need to normalize by the chi-square at the end and/or is the factor
> of 3.999/2 needed?
>
> Thanks
> Bryan
>

_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Fri Sep 21 2007 - 07:56:34 MDT

This archive was generated by hypermail 2.2.0 : Mon Sep 24 2007 - 11:44:39 MDT