# Stationary time series but the mean is not constant

I am trying to do time series analysis in R (I am new to the concepts). So first I tried t generate my own synthetic data and check if I am well using the functions in R.

I generated a time series data by only taking white Gaussian noise, I took about 100 points. This time series should be stationary, however when I computed the mean and the variance for the first 50 points it is not equal the mean of the second 50 points, doesn't that contradicts the fact that our series is stationary ?

• Try taking 10,000 points and the sample means will probably be much closer. Apr 9, 2019 at 14:39
• Thank you for your comment @MattP ,so in genenral I cannot rely on the computation of teh mean to check whether my series is stationary or not ? Apr 9, 2019 at 14:42
• You can, but you need to take into account statistical significance. With small sample sizes you can have a large insignificant difference. Apr 9, 2019 at 14:53
• The important point here is to make the distinction between what is a population statement and what is a sample one. From the theory, you know that weak stationarity will imply constant mean and variance, by necessity. You simulated your data, so of course, the sample estimates will be numerically different but that does not imply the process is not weakly stationary. If you wanted to convince yourself solely on a simulation experiment, replicate that experiment, say, a thousand times and you will see how things stabilize. Apr 9, 2019 at 16:22