# What method to test if the mean is constant?

I have a time series with prices (around 800 prices). I need to test if the mean is constant during all the series.

I think I should subdivide the series in groups, but what method do I have to use to check if the mean is constant if the distribution is not normal?

• I think you need to clarify what you mean by the mean is constant. Presumably there is a model that you have in mind in the background and it sounds roughly like it involves a function $\mu(t)$ that defines a systematic change as a function of time, and presumably, also an error term $\varepsilon(t)$ encapsulating the fluctuations around the local mean. Then your question would seem to be: Is $\mu(t) \equiv \mu$? As currently stated, I fear your question is not quite well-posed. – cardinal Nov 12 '11 at 19:02
• @Cardinal: Perhaps Dail can clarify, but I took it to mean he wanted to test the mean requirement of weak stationarity, which claims that if $X(t)$ is our time series, then $E(X(t)) = \mu, \forall t$. Undergraduate courses typically test this condition by fitting a linear regression through the series and testing if the slope is zero, but this approach is not valid if the data are not normal. Could you clarify that if this is the case, Dail? – Christopher Aden Nov 12 '11 at 20:10
• Yes exactly Christopher. – Dail Nov 12 '11 at 21:04

## 1 Answer

You may want to look at a nonparametric approach to this problem, since you cannot rely on normality. Break your sample into two groups, $x_1, \dots, x_{400}$ and $x_{401}, \dots, x_{800}$ and compare them in pairs ($x_1, x_{401}$), $\dots$, ($x_{400}, x_{800}$).

You now have the framework of a two-sample test of equal means/medians. Under the null hypothesis of a constant mean, we should expect the mean/median of these two groups to be the same.

Since we expect the medians to be the same, some NP tests will assert that in the pair $(x_i, x_{i+400})$, the chance that $x_i$ is bigger is a random variable, Bernoulli distributed with probability $\frac{1}{2}$. Two hypothesis tests proceed from this. Tests to look into would be: Wilcoxon Signed Rank Test and the Signed Test.

• I think there is a typo in the indices at the end of the first paragraph. – cardinal Nov 12 '11 at 18:59
• @Cardinal. You were correct. Pairings should be $(x_i, x_{i+400})$, $i=1, 2, \dots, 400$. – Christopher Aden Nov 12 '11 at 20:04