# McCabe-Tremayne test

## McCabe-Tremayne test :

The McCabe-Tremayne test is a statistical test used to determine whether a time series is stationary or non-stationary. A time series is a sequence of data points measured at successive time intervals. Stationarity refers to the statistical properties of a time series, such as the mean and variance, which do not change over time.
To conduct the McCabe-Tremayne test, we first need to calculate the mean and variance of the time series for a certain number of consecutive time periods. For example, let’s say we have a time series with 100 data points and we want to calculate the mean and variance for 10 consecutive time periods. We would first divide the time series into 10 consecutive segments, each with 10 data points. We would then calculate the mean and variance for each of these segments.
Next, we would calculate the mean and variance of the means and variances that we just calculated. This gives us the overall mean and variance for the entire time series. We can then use these values to determine whether the time series is stationary or non-stationary.
Here are two examples to illustrate the McCabe-Tremayne test:
Example 1: Let’s say we have a time series with 100 data points. We calculate the mean and variance for 10 consecutive time periods and find that the mean is 10 and the variance is 5 for each period. We then calculate the overall mean and variance of these means and variances and find that the overall mean is 10 and the overall variance is 5. This indicates that the time series is stationary because the mean and variance do not change over time.
Example 2: Now let’s say we have a different time series with 100 data points. We again calculate the mean and variance for 10 consecutive time periods and find that the mean is 10 for the first 5 periods, but then increases to 15 for the last 5 periods. The variance also increases from 5 in the first 5 periods to 10 in the last 5 periods. When we calculate the overall mean and variance of these means and variances, we find that the overall mean is 12.5 and the overall variance is 7.5. This indicates that the time series is non-stationary because the mean and variance are changing over time.
In summary, the McCabe-Tremayne test is a useful statistical tool for determining whether a time series is stationary or non-stationary. It involves calculating the mean and variance of the time series for a certain number of consecutive time periods, and then using these values to determine whether the time series is stationary or non-stationary.