Closed Mattriks closed 1 year ago
Example:
# This is Li et al. (2013) Nino3.4 series
# Here I rescale n34a5 = n34a*0.5
n34a = pyleo.Series(time=Dli.Year.values, value=Dli.N34a.values, time_name='Year (CE)', label='Nino3.4')
n34a5= pyleo.Series(time=Dli.Year.values, value=0.5*Dli.N34a.values, time_name='Year (CE)', label='Nino3.4')
# [n34a.value.std(), n34a5.value.std()]
wav1 = n34a.wavelet()
wav1_sig = wav1.signif_test(method='ar1asym', qs=[0.9])
wav1_sig.plot(title='σ ~ 1', ax=ax1, cbar_style={'label':''})
wav2 = n34a5.wavelet(settings={'standardize':True}) # the default
wav2_sig = wav2.signif_test(method='ar1asym', qs=[0.9])
wav2_sig.plot(title='σ ~ 0.5 ', ax=ax2, ylabel='')
Which version are you using?
Describe the bug
For
ar1asym
,wavelet
and waveletsignif_test
have different defaults wrt standardizing the time series i.e.wavelet()
standardizes the time series, butsignif_test(method='ar1asym')
assumes the time series is not standardized i.e. $\text{Var}(time\text{ }series)$ is taken into account in the test. Currently, formethod='ar1asym'
the default settings will only work if $\text{Var}(time\text{ }series) \sim 1$.To Reproduce
Example below
Expected behaviour
The white signficance contour on the right plot should "look" the same as on the left (irrespective of time series variance).
Solutions
Make
signif_test
respond towavelet(settings={'standardize':Bool})
Notes
I didn't see any instructions that say you have to set
{'standardize':False}
in wavelet for the waveletsignif_test
to plot properly. Otherwise it seems to easy to produce an incorrect plot using default settings.