You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
bm2 = detrend(bm1) cu2 = detrend(cu1) coh1,pha1,coi1,freq1,sig951 = wct(cu2,bm2,dt=1,s0=2,dj=1/8,J=-1,sig=True,significance_level=0.95,wavelet='morlet',cache=False)
For the wavelet coherence transform using above snippet, I get the following error:
File ~/.virenv/py12/lib/python3.12/site-packages/pycwt/helpers.py:100, in ar1(x)
98 g = (-B - D0.5) / (2 * A)
99 else:
--> 100 raise Warning(
101 "Cannot place an upperbound on the unbiased AR(1). "
102 "Series is too short or trend is to large."
103 )
105 # According to Allen & Smith (1996), footnote 4
106 mu2 = -1 / N + (2 / N2) * (
107 (N - g**N) / (1 - g) - g * (1 - g ** (N - 1)) / (1 - g) ** 2
108 )
Warning: Cannot place an upperbound on the unbiased AR(1). Series is too short or trend is to large.
What could be the reason, it is detrended properly and i even tried with detrending by polyfit.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Here is the code snippet:
bm2 = detrend(bm1) cu2 = detrend(cu1) coh1,pha1,coi1,freq1,sig951 = wct(cu2,bm2,dt=1,s0=2,dj=1/8,J=-1,sig=True,significance_level=0.95,wavelet='morlet',cache=False)
For the wavelet coherence transform using above snippet, I get the following error:
/home/scilab/.virenv/py12/lib/python3.12/site-packages/pycwt/helpers.py:49: SyntaxWarning: invalid escape sequence '\g'
"""
Warning Traceback (most recent call last)
Cell In[3], line 30
28 bm2 = detrend(bm1)
29 cu2 = detrend(cu1)
---> 30 coh1,pha1,coi1,freq1,sig951 = wct(cu2,bm2,dt=1,s0=2,dj=1/8,J=-1,sig=True,significance_level=0.95,wavelet='morlet',cache=False)
31 #udu = (bm1 - np.mean(bm1))/np.std(bm1)
32 #goa = (cu1 - np.mean(cu1))/np.std(cu1)
33
34 #print(len(udu))
File ~/.virenv/py12/lib/python3.12/site-packages/pycwt/wavelet.py:560, in wct(y1, y2, dt, dj, s0, J, sig, significance_level, wavelet, normalize, **kwargs)
558 if sig:
559 a1, b1, c1 = ar1(y1)
--> 560 a2, b2, c2 = ar1(y2)
562 sig = wct_significance(
563 a1,
564 a2,
(...)
571 **kwargs,
572 )
573 else:
File ~/.virenv/py12/lib/python3.12/site-packages/pycwt/helpers.py:100, in ar1(x)
98 g = (-B - D0.5) / (2 * A)
99 else:
--> 100 raise Warning(
101 "Cannot place an upperbound on the unbiased AR(1). "
102 "Series is too short or trend is to large."
103 )
105 # According to Allen & Smith (1996), footnote 4
106 mu2 = -1 / N + (2 / N2) * (
107 (N - g**N) / (1 - g) - g * (1 - g ** (N - 1)) / (1 - g) ** 2
108 )
Warning: Cannot place an upperbound on the unbiased AR(1). Series is too short or trend is to large.
What could be the reason, it is detrended properly and i even tried with detrending by polyfit.
Beta Was this translation helpful? Give feedback.
All reactions