I am using KPSS test to verify if my process has constant variance around the mean, but I am not sure if this is the correct test for my case. In KPSS the null hypothesis is that the process is stationary.
For example for two separate random variables, x, y:
from statsmodels.tsa.stattools import kpss x = np.random.randn(100) # variance 1 y = np.random.randn(100)*10 # variance 100 z = np.concatenate([x,y]) # make one big vector of size 200 statistic, pvalue, lags, crit = kpss(z,'c') print(pvalue) out: 0.1
P value is 0.1 (or greater), so I can not reject the null. But clearly, the variance of first 100 observations is 1 and for the other 100 obserations it is 100. What test should I use?