Weekend batch
Avijeet is a Senior Research Analyst at Simplilearn. Passionate about Data Analytics, Machine Learning, and Deep Learning, Avijeet is also interested in politics, cricket, and football.
Free eBook: Top Programming Languages For A Data Scientist
Normality Test in Minitab: Minitab with Statistics
Machine Learning Career Guide: A Playbook to Becoming a Machine Learning Engineer
In this lesson, we'll learn how to apply a method for developing a hypothesis test for situations in which both the null and alternative hypotheses are composite. That's not completely accurate. The method, called the likelihood ratio test , can be used even when the hypotheses are simple, but it is most commonly used when the alternative hypothesis is composite. Throughout the lesson, we'll continue to assume that we know the the functional form of the probability density (or mass) function, but we don't know the value of one (or more) of its parameters. That is, we might know that the data come from a normal distrbution, but we don't know the mean or variance of the distribution, and hence the interest in performing a hypothesis test about the unknown parameter(s).
The title of this page is a little risky, as there are few simple examples when it comes to likelihood ratio testing! But, we'll work to make the example as simple as possible, namely by assuming again, unrealistically, that we know the population variance, but not the population mean. Before we state the definition of a likelihood ratio test, and then investigate our simple, but unrealistic, example, we first need to define some notation that we'll use throughout the lesson.
We'll assume that the probability density (or mass) function of X is \(f(x;\theta)\) where \(\theta\) represents one or more unknown parameters. Then:
Let's make sure we are clear about that phrase "where \(\omega '\) is the complement of \(\omega\) with respect to the parameter space \(\Omega\)."
If the total parameter space of the mean \(\mu\) is \(\Omega = {\mu: −∞ < \mu < ∞}\) and the null hypothesis is specified as \(H_0: \mu = 3\), how should we specify the alternative hypothesis so that the alternative parameter space is the complement of the null parameter space?
If the null parameter space is \(\Omega = {\mu: \mu = 3}\), then the alternative parameter space is everything that is in \(\Omega = {\mu: −∞ < \mu < ∞}\) that is not in \(\Omega\). That is, the alternative parameter space is \(\Omega ' = {\mu: \mu ≠ 3}\). And, so the alternative hypothesis is:
\(H_A : \mu \ne 3\)
In this case, we'd be interested in deriving a two-tailed test.
If the alternative hypothesis is \(H_A: \mu > 3\), how should we (technically) specify the null hypothesis so that the null parameter space is the complement of the alternative parameter space?
If the alternative parameter space is (\omega ' = {\mu: \mu > 3}\), then the null parameter space is \(\omega = {\mu: \mu ≤ 3}\). And, so the null hypothesis is:
\(H_0 : \mu \le 3\)
Now, the reality is that some authors do specify the null hypothesis as such, even when they mean \(H_0: \mu = 3\). Ours don't, and so we won't. (That's why I put that "technically" in parentheses up above.) At any rate, in this case, we'd be interested in deriving a one-tailed test.
Definition. Let:
\(L(\hat{\omega})\) denote the maximum of the likelihood function with respect to \(\theta\) when \(\theta\) is in the null parameter space \(\omega\).
\(L(\hat{\Omega})\) denote the maximum of the likelihood function with respect to \(\theta\) when \(\theta\) is in the entire parameter space \(\Omega\).
Then, the likelihood ratio is the quotient:
\(\lambda = \dfrac{L(\hat{\omega})}{L(\hat{\Omega})}\)
And, to test the null hypothesis \(H_0 : \theta \in \omega\) against the alternative hypothesis \(H_A : \theta \in \omega'\), the critical region for the likelihood ratio test is the set of sample points for which:
\(\lambda = \dfrac{L(\hat{\omega})}{L(\hat{\Omega})} \le k\)
where \(0 < k < 1\), and k is selected so that the test has a desired significance level \(\alpha\).
A food processing company packages honey in small glass jars. Each jar is supposed to contain 10 fluid ounces of the sweet and gooey good stuff. Previous experience suggests that the volume X , the volume in fluid ounces of a randomly selected jar of the company's honey is normally distributed with a known variance of 2. Derive the likelihood ratio test for testing, at a significance level of \(\alpha = 0.05\), the null hypothesis \(H_0: \mu = 10\) against the alternative hypothesis H_A: \mu ≠ 10\).
Because we are interested in testing the null hypothesis \(H_0: \mu = 10\) against the alternative hypothesis \(H_A: \mu ≠ 10\) for a normal mean, our total parameter space is:
\(\Omega =\left \{\mu : -\infty < \mu < \infty \right \}\)
and our null parameter space is:
\(\omega = \left \{10\right \}\)
Now, to find the likelihood ratio, as defined above, we first need to find \(L(\hat{\omega})\). Well, when the null hypothesis \(H_0: \mu = 10\) is true, the mean \(\mu\) can take on only one value, namely, \(\mu = 10\). Therefore:
\(L(\hat{\omega}) = L(10)\)
We also need to find \(L(\hat{\Omega})\) in order to define the likelihood ratio. To find it, we must find the value of \(\mu\) that maximizes \(L(\mu)\) . Well, we did that back when we studied maximum likelihood as a method of estimation. We showed that \(\hat{\mu} = \bar{x}\) is the maximum likelihood estimate of \(\mu\) . Therefore:
\(L(\hat{\Omega}) = L(\bar{x})\)
Now, putting it all together to form the likelihood ratio, we get:
which simplifies to:
Now, let's step aside for a minute and focus just on the summation in the numerator. If we "add 0" in a special way to the quantity in parentheses:
we can show that the summation can be written as:
\(\sum_{i=1}^{n}(x_i - 10)^2 = \sum_{i=1}^{n}(x_i - \bar{x})^2 + n(\bar{x} -10)^2 \)
Therefore, the likelihood ratio becomes:
which greatly simplifies to:
\(\lambda = exp \left [-\dfrac{n}{4}(\bar{x}-10)^2 \right ]\)
Now, the likelihood ratio test tells us to reject the null hypothesis when the likelihood ratio \(\lambda\) is small, that is, when:
\(\lambda = exp\left[-\dfrac{n}{4}(\bar{x}-10)^2 \right] \le k\)
where k is chosen to ensure that, in this case, \(\alpha = 0.05\). Well, by taking the natural log of both sides of the inequality, we can show that \(\lambda ≤ k\) is equivalent to:
\( -\dfrac{n}{4}(\bar{x}-10)^2 \le \text{ln} k \)
which, by multiplying through by −4/ n , is equivalent to:
\((\bar{x}-10)^2 \ge -\dfrac{4}{n} \text{ln} k \)
which is equivalent to:
\(\dfrac{|\bar{X}-10|}{\sigma / \sqrt{n}} \ge \dfrac{\sqrt{-(4/n)\text{ln} k}}{\sigma / \sqrt{n}} =k* \)
Aha! We should recognize that quantity on the left-side of the inequality! We know that:
\(Z = \dfrac{\bar{X}-10}{\sigma / \sqrt{n}} \)
follows a standard normal distribution when \(H_0: \mu = 10\). Therefore we can determine the appropriate \(k^*\) by using the standard normal table. We have shown that the likelihood ratio test tells us to reject the null hypothesis \(H_0: \mu = 10\) in favor of the alternative hypothesis \(H_A: \mu ≠ 10\) for all sample means for which the following holds:
\(\dfrac{|\bar{X}-10|}{ \sqrt{2} / \sqrt{n}} \ge z_{0.025} = 1.96 \)
Doing so will ensure that our probability of committing a Type I error is set to \(\alpha = 0.05\), as desired.
Well, geez, now why would we be revisiting the t -test for a mean \(\mu\) when we have already studied it back in the hypothesis testing section? Well, the answer, it turns out, is that, as we'll soon see, the t -test for a mean \(\mu\) is the likelihood ratio test! Let's take a look!
Suppose that a random sample \(X_1 , X_2 , \dots , X_n\) arises from a normal population with unknown mean \(\mu\) and unknown variance \(\sigma^2\). (Yes, back to the realistic situation, in which we don't know the population variance either.) Find the size \(\alpha\) likelihood ratio test for testing the null hypothesis \(H_0: \mu = \mu_0\) against the two-sided alternative hypothesis \(H_A: \mu ≠ \mu_0\) .
Our unrestricted parameter space is:
\( \Omega = \left\{ (\mu, \sigma^2) : -\infty < \mu < \infty, 0 < \sigma^2 < \infty \right\} \)
Under the null hypothesis, the mean \(\mu\) is the only parameter that is restricted. Therefore, our parameter space under the null hypothesis is:
\( \omega = \left\{(\mu, \sigma^2) : \mu =\mu_0, 0 < \sigma^2 < \infty \right\}\)
Now, first consider the case where the mean and variance are unrestricted. We showed back when we studied maximum likelihood estimation that the maximum likelihood estimates of \(\mu\) and \(\sigma^2\) are, respectively:
\(\hat{\mu} = \bar{x} \text{ and } \hat{\sigma}^2 = \dfrac{1}{n}\sum_{i=1}^{n}(x_i - \bar{x})^2 \)
Therefore, the maximum of the likelihood function for the unrestricted parameter space is:
\( L(\hat{\Omega})= \left[\dfrac{ne^{-1}}{2\pi \Sigma (x_i - \bar{x})^2} \right]^{n/2} \)
Now, under the null parameter space, the maximum likelihood estimates of \(\mu\) and \(\sigma^2\) are, respectively:
\( \hat{\mu} = \mu_0 \text{ and } \hat{\sigma}^2 = \dfrac{1}{n}\sum_{i=1}^{n}(x_i - \mu_0)^2 \)
Therefore, the likelihood under the null hypothesis is:
\( L(\hat{\omega})= \left[\dfrac{ne^{-1}}{2\pi \Sigma (x_i - \mu_0)^2} \right]^{n/2} \)
And now taking the ratio of the two likelihoods, we get:
which reduces to:
\( \lambda = \left[ \dfrac{\sum_{i=1}^{n}(x_i - \bar{x})^2}{\sum_{i=1}^{n}(x_i - \mu_0)^2} \right] ^{n/2}\)
Focusing only on the denominator for a minute, let's do that trick again of "adding 0" in just the right away. Adding 0 to the quantity in the parentheses, we get:
\( \sum_{i=1}^{n}(x_i - \mu_0)^2 = \sum_{i=1}^{n}(x_i - \bar{x})^2 +n(\bar{x} - \mu_0)^2 \)
Then, our likelihood ratio \(\lambda\) becomes:
\( \lambda = \left[ \dfrac{\sum_{i=1}^{n}(x_i - \bar{x})^2}{\sum_{i=1}^{n}(x_i - \mu_0)^2} \right] ^{n/2} = \left[ \dfrac{\sum_{i=1}^{n}(x_i - \bar{x})^2}{ \sum_{i=1}^{n}(x_i - \bar{x})^2 +n(\bar{x} - \mu_0)^2} \right] ^{n/2} \)
which, upon dividing through numerator and denominator by \( \sum_{i=1}^{n}(x_i - \bar{x})^2 \) simplifies to:
Therefore, the likelihood ratio test's critical region, which is given by the inequality \(\lambda ≤ k\), is equivalent to:
which with some minor algebraic manipulation can be shown to be equivalent to:
So, in a nutshell, we've shown that the likelihood ratio test tells us that for this situation we should reject the null hypothesis \(H_0: \mu= \mu_0\) in favor of the alternative hypothesis \(H_A: \mu ≠ \mu_0\) if:
\( \dfrac{(\bar{x}-\mu_0)^2 }{s^2 / n} \ge k^{*} \)
Well, okay, so I started out this page claiming that the t -test for a mean \(\mu\) is the likelihood ratio test. Is it? Well, the above critical region is equivalent to rejecting the null hypothesis if:
\( \dfrac{|\bar{x}-\mu_0| }{s / \sqrt{n}} \ge k^{**} \)
Does that look familiar? We previously learned that if \(X_1, X_2, \dots, X_n\) are normally distributed with mean \(\mu\) and variance \(\sigma^2\), then:
\( T = \dfrac{\bar{X}-\mu}{S / \sqrt{n}} \)
follows a T distribution with n − 1 degrees of freedom. So, this tells us that we should use the T distribution to choose \(k^{**}\) . That is, set:
\(k^{**} = t_{\alpha /2, n-1}\)
and we have our size \(\alpha\) t -test that ensures the probability of committing a Type I error is \(\alpha\).
It turns out... we didn't know it at the time... but every hypothesis test that we derived in the hypothesis testing section is a likelihood ratio test. Back then, we derived each test using distributional results of the relevant statistic(s), but we could have alternatively, and perhaps just as easily, derived the tests using the likelihood ratio testing method.
Definition of Composite Hypothesis in the context of A/B testing (online controlled experiments).
In hypothesis testing a composite hypothesis is a hypothesis which covers a set of values from the parameter space. For example, if the entire parameter space covers -∞ to +∞ a composite hypothesis could be μ ≤ 0. It could be any other number as well, such 1, 2 or 3,1245. The alternative hypothesis is always a composite hypothesis : either one-sided hypothesis if the null is composite or a two-sided one if the null is a point null. The "composite" part means that such a hypothesis is the union of many simple point hypotheses.
In a Null Hypothesis Statistical Test only the null hypothesis can be a point hypothesis. Also, a composite hypothesis usually spans from -∞ to zero or some value of practical significance or from such a value to +∞.
Testing a composite null is what is most often of interest in an A/B testing scenario as we are usually interested in detecting and estimating effects in only one direction: either an increase in conversion rate or average revenue per user, or a decrease in unsubscribe events would be of interest and not its opposite. In fact, running a test so long as to detect a statistically significant negative outcome can result in significant business harm.
Like this glossary entry? For an in-depth and comprehensive reading on A/B testing stats, check out the book "Statistical Methods in Online A/B Testing" by the author of this glossary, Georgi Georgiev.
One-tailed vs Two-tailed Tests of Significance in A/B Testing blog.analytics-toolkit.com
Statistical Methods in Online A/B Testing
Take your A/B testing program to the next level with the most comprehensive book on user testing statistics in e-commerce.
Select a letter to see all A/B testing terms starting with that letter or visit the Glossary homepage to see all.
Find centralized, trusted content and collaborate around the technologies you use most.
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Get early access and see previews of new features.
This example is a variation of the one in the docs :
What am I doing wrong?
You need to call the composite functions. This is not explained in the docs, but there is an example in a 2016 blog post .
Reminder: Answers generated by artificial intelligence tools are not allowed on Stack Overflow. Learn more
Post as a guest.
Required, but never shown
By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy .
Composite Hypothesis:
A statistical hypothesis which does not completely specify the distribution of a random variable is referred to as a composite hypothesis.
Browse Other Glossary Entries
Planning on taking an introductory statistics course, but not sure if you need to start at the beginning? Review the course description for each of our introductory statistics courses and estimate which best matches your level, then take the self test for that course. If you get all or almost all the questions correct, move on and take the next test.
Considering becoming adata scientist, customer analyst or our data science certificate program?
Advanced Statistics Quiz
Looking at statistics for graduate programs or to enhance your foundational knowledge?
Regression Quiz
Entering the biostatistics field? Test your skill here.
Read up on our latest blogs
Learn about our certificate programs
Find the right course for you
Our mentors and academic advisors are standing by to help guide you towards the courses or program that makes the most sense for you and your goals.
300 W Main St STE 301, Charlottesville, VA 22903
(434) 973-7673
By submitting your information, you agree to receive email communications from Statistics.com. All information submitted is subject to our privacy policy . You may opt out of receiving communications at any time.
IMAGES
VIDEO
COMMENTS
What you can generate and how. Most things should be easy to generate and everything should be possible. To support this principle Hypothesis provides strategies for most built-in types with arguments to constrain or adjust the output, as well as higher-order strategies that can be composed to generate more complex types.
Rejection and failure to reject the null hypothesis, critical regions, C, and type I and type II errors have the same meaning for a composite hypotheses as it does with a simple hypothesis. Significance level and power will necessitate an extension of the ideas for simple hypotheses. 18.2 The Power Function
A composite hypothesis is a hypothesis that does not predict the exact parameters, distribution, or range of the dependent variable. Often, we would predict an exact outcome. For example: "23 year old men are on average 189cm tall." Here, we are giving an exact parameter. So, the hypothesis is not composite.
A hypothesis which is not simple (i.e. in which not all of the parameters are specified) is called a composite hypothesis. For instance, if we hypothesize that $${H_o}:\mu > 62$$ (and $${\sigma ^2} = 4$$) or$${H_o}:\mu = 62$$ and $${\sigma ^2} < 4$$, the hypothesis becomes a composite hypothesis because we cannot know the exact distribution of the population in either case.
A composite hypothesis is a type of statistical hypothesis that includes a range of possible values for a parameter, rather than specifying a single value. This concept is crucial when dealing with null and alternative hypotheses, as it allows researchers to consider multiple scenarios or conditions under which the data may be analyzed, providing a more flexible approach to hypothesis testing.
then we have a simple hypothesis, as discussed in past lectures. When a set contains more than one parameter value, then the hypothesis is called a composite hypothesis, because it involves more than one model. The name is even clearer if we consider the following equivalent expression for the hypotheses above. H 0: X ˘p 0; p 0 2fp 0(xj 0)g 02 ...
Lecture 7 | Composite hypotheses and the t-test 7.1 Composite null and alternative hypotheses This week we will discuss various hypothesis testing problems involving a composite null hypothesis and a compositive alternative hypothesis. To motivate the discussion, consider the following examples: Example 7.1. There are 80 students in a STATS 200 ...
A composite hypothesis test contains more than one parameter and more than one model. In a simple hypothesis test, the probability density functions for both the null hypothesis (H 0) and alternate hypothesis (H 1) are known. In academic and hypothetical situations, the simple hypothesis test works for most cases.
Definition: Simple and composite hypothesis. Definition: Let H H be a statistical hypothesis. Then, H H is called a simple hypothesis, if it completely specifies the population distribution; in this case, the sampling distribution of the test statistic is a function of sample size alone. H H is called a composite hypothesis, if it does not ...
0 is called the null hypothesis and H 1 the alternative hypothesis. Rejection and failure to reject the null hypothesis, critical regions, C, and type I and type II errors have the same meaning for a composite hypotheses as it does with a simple hypothesis. 1 Power Power is now a function ˇ( ) = P fX2Cg:
Any hypothesis that is not a simple hypothesis is called a composite hypothesis. Example 26-1 Section Suppose \(X_1 , X_2 , \dots , X_n\) is a random sample from an exponential distribution with parameter \(\theta\).
Composite Hypothesis. In subject area: Mathematics. Classically, composite hypotheses are used to determine if a point null is statistically distinguishable from the best alternative, or to determine if the best supported alternative lies on a specified side of the point null. From: Philosophy of Statistics, 2011.
A composite hypothesis is a statement that assumes more than one condition or outcome. It can be divided into several sub-hypotheses, each of which represents a different possible outcome. Empirical Hypothesis. An empirical hypothesis is a statement that is based on observed phenomena or data. It is often used in scientific research to develop ...
This lecture explains simple and composite hypotheses.Other videos @DrHarishGargHow to write H0 and H1: https://youtu.be/U1e8CqkSzLISimple and Composite Hypo...
26.2 - Uniformly Most Powerful Tests. The Neyman Pearson Lemma is all well and good for deriving the best hypothesis tests for testing a simple null hypothesis against a simple alternative hypothesis, but the reality is that we typically are interested in testing a simple null hypothesis, such as H 0: μ = 10 against a composite alternative ...
Composite Hypothesis: A composite hypothesis specifies a range of values. Example: A company is claiming that their average sales for this quarter are 1000 units. This is an example of a simple hypothesis. Suppose the company claims that the sales are in the range of 900 to 1000 units. Then this is a case of a composite hypothesis.
Lesson 27: Likelihood Ratio Tests. In this lesson, we'll learn how to apply a method for developing a hypothesis test for situations in which both the null and alternative hypotheses are composite. That's not completely accurate. The method, called the likelihood ratio test, can be used even when the hypotheses are simple, but it is most ...
In hypothesis testing a composite hypothesis is a hypothesis which covers a set of values from the parameter space. For example, if the entire parameter space covers -∞ to +∞ a composite hypothesis could be μ ≤ 0. It could be any other number as well, such 1, 2 or 3,1245. The alternative hypothesis is always a composite hypothesis ...
Simple vs Composite, One or Two sided Simple and Composite hypotheses: If i contains only a single value, i = f ig, then Hi is a simple hypothesis If i contains more than a single value then Hi is a composite hypothesis One-Sided and Two-Sided (for a one-dimensional ) One-sided hypotheses: H0: 0 H1: < 0 or H0: 0 H1: > 1
How to execute Python functions using Hypothesis' composite strategy? 1. Given a Hypothesis Strategy, can I get the minimal example? 5. Multiple strategies for same function parameter in python hypothesis. 3. How to enforce relative constraints on hypothesis strategies? 2.
that now our hypothesis is not that the data comes from a particular given distribution but that the data comes from a family of distributions which is called a composite hypothesis. Running [H,P,STATS]= chi2gof(X,'cdf',@(z)normcdf(z,mean(X),std(X,1))) would test a simple hypothesis that the data comes from a particular normal distribution
The parameter space, Θ, defines the maintained hypothesis, which is a non-empty subset of Rp, for some integer p. We consider the hypothesis, H0: θ ∈ Θ0,whereΘ0 is a subset of Θ,andweshall be concerned with the case where Θ0 contains more than a single point, so that H0 is a composite hypothesis. 2.1 A Simple Illustrative Example
Our mentors and academic advisors are standing by to help guide you towards the courses or program that makes the most sense for you and your goals. 300 W Main St STE 301, Charlottesville, VA 22903. (434) 973-7673. [email protected].