Z-test:
- What it is: Used when you want to compare a sample mean to a known population mean, and you also know the population standard deviation.
- Assumptions: Normally distributed data, known population variance, and large sample size (often >30).
- Use case: Let's say you're a trader and you've got data about the average returns of a specific stock over the past 20 years. Now, you collect a sample of returns over the past month. Using a Z-test, you could determine if this month's returns are statistically different from the historical average.
It's important to note that in practice, t-tests are more commonly used than Z-tests for these scenarios, especially the one-sample and paired tests. This is because, for Z-tests, the population variance must be known, which is rarely the case in real-world scenarios. Nonetheless, you can find the more about Z-Tests below.
Let's delve into examples related to trading for each type of Z-test:
1. One-sample Z-test:
- What it is: Used to compare the mean of a single sample to a known population mean.
- Hypothesis:
- : The sample mean is equal to the population mean.
- : The sample mean is not equal to the population mean (or is greater than or less than, depending on the specific test being conducted).
- Assumptions: Large sample size (often >30), known population variance, sample is randomly selected, and the data distribution is approximately normal.
1. One-sample Z-test:
- Scenario: You're a trader who believes that the average daily return of Stock A over the past year (which is known to be 2%) has changed this month. To test your belief, you gather daily returns of Stock A for this month.
- Application:
- Null Hypothesis, : The mean return for Stock A this month is 2% (same as the known yearly average).
- Alternative Hypothesis, : The mean return for Stock A this month is different from 2%.
- By performing a one-sample Z-test on this month's data, you can determine whether there's enough evidence to reject the null hypothesis and conclude that the return has significantly changed.
2. Two-sample Z-test:
- What it is: Used to compare the means of two independent samples to see if they come from populations with the same mean.
- Hypothesis:
- : The means of the two populations are equal.
- : The means of the two populations are not equal (or one is greater than the other, depending on the specific test).
- Assumptions: Both samples are large (often >30 for each sample), known population variances, samples are independently and randomly selected, and the data distributions are approximately normal.
2. Two-sample Z-test:
- Scenario: You have two trading strategies: Strategy A and Strategy B. Both strategies have been back-tested on a large number of historical trading days. You want to determine if one strategy has a statistically significant different mean return than the other.
- Application:
- Null Hypothesis, : Strategy A and Strategy B have the same average return.
- Alternative Hypothesis, : Strategy A and Strategy B have different average returns.
- With the two-sample Z-test, you can determine whether the mean return of Strategy A is significantly different from that of Strategy B.
3. Paired Z-test:
- What it is: The concept of a paired Z-test isn't as standard as the paired t-test. However, theoretically, it would be used to compare means from the same group at two different times or under two different conditions.
- Hypothesis:
- : The mean difference between the paired observations is zero.
- : The mean difference between the paired observations is not zero.
- Assumptions: Differences are normally distributed, known population variance of differences, and observations are independent of one another.
3. Paired Z-test:
- Scenario: Suppose you have a specific trading strategy, and you want to determine if its performance was different before and after a particular event, like a policy announcement or a major financial crisis. To do this, you collect daily returns of the strategy for a month before the event and a month after the event.
- Application:
- Null Hypothesis, : The mean difference in daily returns of the trading strategy before and after the event is zero.
- Alternative Hypothesis, : The mean difference in daily returns of the trading strategy before and after the event is not zero.
- Using a paired Z-test (or more typically a paired t-test), you can determine if there's a statistically significant difference in the strategy's performance before and after the event.
As a reminder, in most real-world applications, the t-test is preferred for one-sample and paired scenarios due to the rare knowledge of population variance. The Z-test is more appropriate for large datasets where the Central Limit Theorem ensures the sampling distribution of the mean is approximately normal.
Z-Score
ELI5: Think of a classroom of students. If you want to know how a particular student performed compared to the average, you'll see how many marks above or below the average they scored. This difference, when compared to the typical (standard) difference in scores in the class, gives the Z-score.
Trading Context: If a stock has a return that's unusual given its typical variability, the Z-score would tell us how unusual it is. A Z-score of 2, for instance, would mean the stock's return is 2 standard deviations above the average return for that stock.
Z-Test
ELI5: Imagine you have a bag of candies and the label says each candy is 5 grams on average. You suspect they're lighter. To test this, you randomly pick some candies, weigh them, and then use a Z-test to see if the average weight of your sample is significantly different from the 5 grams stated.
Trading Context: Let's say you believe a new trading strategy has a higher return than the industry average. You would use a Z-test to compare the average return of your strategy with the industry average to see if there's a significant difference.
Z-Statistic (or Z-Value)
ELI5: Using the candy example, the Z-statistic would be the number that tells you how far off your sample's average weight is from the stated 5 grams, in terms of standard deviations. If the Z-statistic is large (either positive or negative), it's evidence that the candies might not actually average 5 grams.
Trading Context: When you do a Z-test for your trading strategy, the Z-statistic is the value you get. It tells you how many standard deviations your strategy's average return is from the industry average. If it's far from 0 (like 2 or -2), it suggests that your strategy might genuinely have a different return than the industry average.
To summarize in a trading context:
- Z-Score is a measure to see how unusual a particular return is compared to a stock's typical returns.
- Z-Test is a test you'd use to see if the average returns of a sample (like from your trading strategy) are different from a known average.
- Z-Statistic is the actual value you get when you run a Z-test, indicating how far off, in standard deviations, your sample average is from the known average.
Understanding these terms can help you gauge the performance of your trading strategy compared to known benchmarks or averages.