Mathematical Statistics

Similar documents
Definition 3.1 A statistical hypothesis is a statement about the unknown values of the parameters of the population distribution.

Testing Hypothesis. Maura Mezzetti. Department of Economics and Finance Università Tor Vergata

Preliminary Statistics. Lecture 5: Hypothesis Testing

Preliminary Statistics Lecture 5: Hypothesis Testing (Outline)

Hypothesis Testing. ECE 3530 Spring Antonio Paiva

ORF 245 Fundamentals of Statistics Chapter 9 Hypothesis Testing

MTMS Mathematical Statistics

ECO220Y Review and Introduction to Hypothesis Testing Readings: Chapter 12

Chapter 5: HYPOTHESIS TESTING

Introductory Econometrics. Review of statistics (Part II: Inference)

Introduction to Statistics

Lecture 12 November 3

Unit 19 Formulating Hypotheses and Making Decisions

HYPOTHESIS TESTING: FREQUENTIST APPROACH.

Topic 17: Simple Hypotheses

Economics 520. Lecture Note 19: Hypothesis Testing via the Neyman-Pearson Lemma CB 8.1,

8.1-4 Test of Hypotheses Based on a Single Sample

14.30 Introduction to Statistical Methods in Economics Spring 2009

Probability Methods in Civil Engineering Prof. Dr. Rajib Maity Department of Civil Engineering Indian Institution of Technology, Kharagpur

F79SM STATISTICAL METHODS

Basic Concepts of Inference

Hypothesis Test. The opposite of the null hypothesis, called an alternative hypothesis, becomes

Hypothesis Testing. 1 Definitions of test statistics. CB: chapter 8; section 10.3

Econ 325: Introduction to Empirical Economics

Hypothesis Testing. BS2 Statistical Inference, Lecture 11 Michaelmas Term Steffen Lauritzen, University of Oxford; November 15, 2004

Statistical Process Control (contd... )

4 Hypothesis testing. 4.1 Types of hypothesis and types of error 4 HYPOTHESIS TESTING 49

Lecture Testing Hypotheses: The Neyman-Pearson Paradigm

Statistical Inference. Hypothesis Testing

8: Hypothesis Testing

Topic 17 Simple Hypotheses

Composite Hypotheses and Generalized Likelihood Ratio Tests

Hypothesis testing I. - In particular, we are talking about statistical hypotheses. [get everyone s finger length!] n =

ME3620. Theory of Engineering Experimentation. Spring Chapter IV. Decision Making for a Single Sample. Chapter IV

Mathematical statistics

Quantitative Methods for Economics, Finance and Management (A86050 F86050)

The Purpose of Hypothesis Testing

CH.9 Tests of Hypotheses for a Single Sample

ST495: Survival Analysis: Hypothesis testing and confidence intervals

Precept 4: Hypothesis Testing

LECTURE 5. Introduction to Econometrics. Hypothesis testing

STAT 135 Lab 6 Duality of Hypothesis Testing and Confidence Intervals, GLRT, Pearson χ 2 Tests and Q-Q plots. March 8, 2015

Ch. 5 Hypothesis Testing

STA 732: Inference. Notes 2. Neyman-Pearsonian Classical Hypothesis Testing B&D 4

First we look at some terms to be used in this section.

Stat 135, Fall 2006 A. Adhikari HOMEWORK 6 SOLUTIONS

STAT 135 Lab 5 Bootstrapping and Hypothesis Testing

Partitioning the Parameter Space. Topic 18 Composite Hypotheses

CHAPTER 9, 10. Similar to a courtroom trial. In trying a person for a crime, the jury needs to decide between one of two possibilities:

Chapter 9. Hypothesis testing. 9.1 Introduction

STAT 830 Hypothesis Testing

Chapter 10. Hypothesis Testing (I)

Lecture 5: Likelihood ratio tests, Neyman-Pearson detectors, ROC curves, and sufficient statistics. 1 Executive summary

Chapter Three. Hypothesis Testing

23. MORE HYPOTHESIS TESTING

Hypothesis Testing. Part I. James J. Heckman University of Chicago. Econ 312 This draft, April 20, 2006

Statistical Inference

exp{ (x i) 2 i=1 n i=1 (x i a) 2 (x i ) 2 = exp{ i=1 n i=1 n 2ax i a 2 i=1

Hypothesis tests

280 CHAPTER 9 TESTS OF HYPOTHESES FOR A SINGLE SAMPLE Tests of Statistical Hypotheses

Lecture 21. Hypothesis Testing II

Announcements. Unit 3: Foundations for inference Lecture 3: Decision errors, significance levels, sample size, and power.

Statistical Inference: Estimation and Confidence Intervals Hypothesis Testing

Hypothesis Testing The basic ingredients of a hypothesis test are

Math 494: Mathematical Statistics

Let us first identify some classes of hypotheses. simple versus simple. H 0 : θ = θ 0 versus H 1 : θ = θ 1. (1) one-sided

Problems ( ) 1 exp. 2. n! e λ and

Cherry Blossom run (1) The credit union Cherry Blossom Run is a 10 mile race that takes place every year in D.C. In 2009 there were participants

A Very Brief Summary of Statistical Inference, and Examples

Section 5.4: Hypothesis testing for μ

Lecture 13: p-values and union intersection tests

Summary of Chapters 7-9

Hypothesis testing: theory and methods

Statistical Inference: Uses, Abuses, and Misconceptions

STAT 830 Hypothesis Testing

Hypothesis Testing Chap 10p460

Testing Simple Hypotheses R.L. Wolpert Institute of Statistics and Decision Sciences Duke University, Box Durham, NC 27708, USA

6.4 Type I and Type II Errors

Topic 10: Hypothesis Testing

40.530: Statistics. Professor Chen Zehua. Singapore University of Design and Technology

Hypothesis for Means and Proportions

2. What are the tradeoffs among different measures of error (e.g. probability of false alarm, probability of miss, etc.)?

simple if it completely specifies the density of x

Business Statistics: Lecture 8: Introduction to Estimation & Hypothesis Testing

Lecture 21: October 19

Quantitative Introduction ro Risk and Uncertainty in Business Module 5: Hypothesis Testing

Hypothesis Testing. Testing Hypotheses MIT Dr. Kempthorne. Spring MIT Testing Hypotheses

Hypotheses and Errors

Nuisance parameters and their treatment

Bias Variance Trade-off

7.2 One-Sample Correlation ( = a) Introduction. Correlation analysis measures the strength and direction of association between

Parameter estimation and forecasting. Cristiano Porciani AIfA, Uni-Bonn

Parameter Estimation, Sampling Distributions & Hypothesis Testing

STAT 801: Mathematical Statistics. Hypothesis Testing

Direction: This test is worth 250 points and each problem worth points. DO ANY SIX

Wooldridge, Introductory Econometrics, 4th ed. Appendix C: Fundamentals of mathematical statistics

LECTURE 5 HYPOTHESIS TESTING

Hypothesis Testing: One Sample

Topic 15: Simple Hypotheses

Topic 19 Extensions on the Likelihood Ratio

Transcription:

Mathematical Statistics MAS 713 Chapter 8

Previous lecture: 1 Bayesian Inference 2 Decision theory 3 Bayesian Vs. Frequentist 4 Loss functions 5 Conjugate priors Any questions? Mathematical Statistics (MAS713) Ariel Neufeld 2 / 84

This lecture 8. Hypothesis Testing 8.1 Tests of Hypotheses 8.2 Confidence Intervals vs. Hypothesis Tests 8.3 Mathematical Formulation of Tests 8.4 Likelihood Ratio Test 8.5 Examples Additional reading : Chapter 8 Mathematical Statistics (MAS713) Ariel Neufeld 3 / 84

8. Hypothesis Testing 8.1 Tests of Hypotheses Hypotheses testing : Introduction In the previous lectures we showed how a parameter of a population can be estimated from sample data, using either a point estimate or an interval of likely values called a confidence interval This can be divided into two major areas : estimation, including point estimation and interval estimation tests of hypotheses Today we discuss different tests of hypotheses. Mathematical Statistics (MAS713) Ariel Neufeld 4 / 84

8. Hypothesis Testing 8.1 Tests of Hypotheses Hypotheses testing : Introduction There are many situations in which we must decide whether a statement concerning a parameter is true or false, that is, we must test a hypothesis about a parameter Mathematical Statistics (MAS713) Ariel Neufeld 5 / 84

8. Hypothesis Testing 8.1 Tests of Hypotheses Hypotheses testing : Introduction For instance, suppose that a customer protection agency wants to test a paint manufacturer s claim that the average drying time of his new fast-drying paint is 20 minutes It instructs a member of its staff to paint each of 36 boards using a different can of the paint : the observed average drying time for this sample is 20.75 minutes does that really contradict the manufacturer s claim? This type of question can be answered using a statistical inference technique called hypothesis testing Mathematical Statistics (MAS713) Ariel Neufeld 6 / 84

Statistical hypotheses 8. Hypothesis Testing 8.1 Tests of Hypotheses Many problems require that we decide which of two competing statements about some parameter of a population is true the statements are called hypotheses In the previous situation, we might express the hypothesis to test as H 0 : µ = 20 where µ is the true unknown mean drying time for this type of paint. This statement is called null hypothesis, and is usually denoted H 0 Mathematical Statistics (MAS713) Ariel Neufeld 7 / 84

Statistical hypotheses 8. Hypothesis Testing 8.1 Tests of Hypotheses The statement to be favoured in case we come to the conclusion that H 0 is (most probably) not true is called the alternative hypothesis, and is usually denoted H a (or sometimes H 1 in some references) The choice of H a depends mostly on the problem and what we hope to be able to show In our example, it could be either H a : µ 20 or H a : µ > 20 Mathematical Statistics (MAS713) Ariel Neufeld 8 / 84

8. Hypothesis Testing 8.1 Tests of Hypotheses Null hypothesis The value µ 0 of the population parameter specified in the null hypothesis H 0 : µ = µ 0 is usually determined in one of three ways : it may result from past experience or knowledge of the process, or from previous tests or experiments determine whether the parameter value has changed it may be determined from some theory or some model check whether the theory or the model is valid it may result from external considerations, such as engineering specifications, or from contractual obligations conformance testing Mathematical Statistics (MAS713) Ariel Neufeld 9 / 84

8. Hypothesis Testing 8.1 Tests of Hypotheses Null hypothesis Note : in some instances, a null hypothesis of the form H 0 : µ µ 0 or H 0 : µ µ 0 may seem appropriate. However, the test procedure for such an H 0 always exactly amounts to that for H 0 : µ = µ 0 we always state a null hypothesis as an equality Mathematical Statistics (MAS713) Ariel Neufeld 10 / 84

Alternative hypothesis 8. Hypothesis Testing 8.1 Tests of Hypotheses The alternative hypothesis can essentially be of two types We talk about two-sided alternative when H a is of the form H a : µ µ 0 This is the exact negation of the null hypothesis H 0 : µ = µ 0, µ 0 being the only value of some interest in the problem However, in many situations, we may wish to favour a given direction for the alternative : H a : µ < µ 0 or H a : µ > µ 0 We then talk about one-sided alternative Mathematical Statistics (MAS713) Ariel Neufeld 11 / 84

Alternative hypothesis 8. Hypothesis Testing 8.1 Tests of Hypotheses For instance, in the previous example, the customer protection agency may only wish to highlight that the average drying time of the paint is actually longer than the advertised 20 minutes (no criticisms if this time is even shorther) The considered alternative might change the conclusion of a hypothesis test, and should be carefully formulated! Mathematical Statistics (MAS713) Ariel Neufeld 12 / 84

Hypothesis testing 8. Hypothesis Testing 8.1 Tests of Hypotheses A procedure leading to a decision about a particular hypothesis H 0 is called a test of hypothesis Such procedures rely on using the information contained in a random sample from the population of interest if this information is consistent with the hypothesis H 0, we will not reject H 0 ; however, if this information is inconsistent with H 0, we will conclude that H 0 is false and we will reject it Mathematical Statistics (MAS713) Ariel Neufeld 13 / 84

Hypothesis testing 8. Hypothesis Testing 8.1 Tests of Hypotheses Fact The truth or the falsity of a particular hypothesis can never be known with certainty, unless we can examine the entire population The decision we make depends on a random sample, so is a kind of random object a hypothesis test should be developed with the probability of reaching a wrong conclusion in mind Mathematical Statistics (MAS713) Ariel Neufeld 14 / 84

8. Hypothesis Testing 8.1 Tests of Hypotheses To illustrate the general concepts, consider again the mean drying time problem. Imagine that we wish to test H 0 : µ = 20 against H a : µ 20 We have a sample of n = 36 specimens and the sample mean x is observed As the sample mean is a good estimate of µ, we expect x to be reasonably close to µ if x falls close to 20 min, no clear contradiction with H 0, we do not reject it if x is considerably distant from 20 min, evidence in support of H a, we reject H 0 Mathematical Statistics (MAS713) Ariel Neufeld 15 / 84

8. Hypothesis Testing 8.1 Tests of Hypotheses The numerical value which is computed from the sample and used to decide between H 0 and H a, here the (possibly standardised) sample mean, is called the test statistic Mathematical Statistics (MAS713) Ariel Neufeld 16 / 84

Hypothesis testing 8. Hypothesis Testing 8.1 Tests of Hypotheses Suppose that we decide to reject H 0 if x is smaller than 19.33 or larger than 20.67 (arbitrary criterion for illustrative purpose only) if x [19.33, 20.67], we do not reject H 0 : µ = 20 The values for which we reject H 0, that is here values less than 19.33 and greater than 20.67, are called critical region for the test, the limiting values (here 19.33 and 20.67) being the critical values Mathematical Statistics (MAS713) Ariel Neufeld 17 / 84

Hypothesis testing 8. Hypothesis Testing 8.1 Tests of Hypotheses This provides a clear-cut criterion for the decision, however it is not guaranteed : a) even if the true mean µ = 20, there is a possibility that the sample mean x may be outside [19.33, 20.67], due to bad luck b) even if the true mean µ 20, say µ = 21, there is a possibility that the sample mean may be in [19.33, 20.67] Mathematical Statistics (MAS713) Ariel Neufeld 18 / 84

8. Hypothesis Testing 8.1 Tests of Hypotheses Types of errors Mathematical Statistics (MAS713) Ariel Neufeld 19 / 84

8. Hypothesis Testing 8.1 Tests of Hypotheses There are essentially two possible wrong conclusions : a) rejecting H 0 when it is true : this is defined as a type I error b) failing to reject H 0 when it is false : this is defined as type II error Mathematical Statistics (MAS713) Ariel Neufeld 20 / 84

8. Hypothesis Testing 8.1 Tests of Hypotheses Because the decision is based on random variables, probabilities can be associated with these errors The probability of type I error is usually denoted α Pr(type I error) = Pr(reject H 0 when it is true) = α The probability of type II error is usually denoted β Pr(type II error) = Pr(fail to reject H 0 when it is false) = β 1 β, that is Pr(reject H 0 when it is false), is also called the power of the test Note that β actually depends on the true (unknown) value of µ Mathematical Statistics (MAS713) Ariel Neufeld 21 / 84

8. Hypothesis Testing 8.1 Tests of Hypotheses Mathematical Statistics (MAS713) Ariel Neufeld 22 / 84

8. Hypothesis Testing 8.1 Tests of Hypotheses Assume in our running example that it is known from past experience that the drying time is normally distributed with known standard deviation σ = 2 min As we know that Z = n X µ σ N (0, 1), we have : Pr(type I error) = Pr(( X < 19.33) ( X > 20.67) when µ = 20) ( = Pr Z < ) ( 36 + Pr Z > 36 19.33 20 2 20.67 20 2 = Pr(Z < 2.01) + Pr(Z > 2.01) = 0.044 = α (tables) If H 0 is true, we have a 4.4% chance of rejecting it (with our rule) ) Mathematical Statistics (MAS713) Ariel Neufeld 23 / 84

8. Hypothesis Testing 8.1 Tests of Hypotheses Suppose now that µ = 21 (so H 0 is not true!). We have : Pr(type II error) = Pr( X [19.33, 20.67] when µ = 21) ( 36 19.33 21 = Pr Z ) 20.67 21 36 2 2 = Pr( 5.01 Z 0.99) = 0.16 = β (tables) Mathematical Statistics (MAS713) Ariel Neufeld 24 / 84

8. Hypothesis Testing 8.1 Tests of Hypotheses With the decision rule : reject H 0 if x / [19.33, 20.67] Mathematical Statistics (MAS713) Ariel Neufeld 25 / 84

8. Hypothesis Testing 8.1 Tests of Hypotheses With the decision rule : reject H 0 if x / [19.33, 20.67] Mathematical Statistics (MAS713) Ariel Neufeld 25 / 84

8. Hypothesis Testing 8.1 Tests of Hypotheses With the decision rule : reject H 0 if x / [19.33, 20.67] Mathematical Statistics (MAS713) Ariel Neufeld 25 / 84

8. Hypothesis Testing 8.1 Tests of Hypotheses With the decision rule : reject H 0 if x / [19.33, 20.67] α = 0.044, β = 0.16 if µ = 21 See that β would rapidly increase as µ approached the hypothesized value µ 0 Mathematical Statistics (MAS713) Ariel Neufeld 25 / 84

8. Hypothesis Testing 8.1 Tests of Hypotheses Suppose that you want to reduce the error I probability α widen the acceptance region, for instance say reject H 0 if x / [19.2, 20.8] (again for illustrative purpose only) Then, α =... = 0.016 (< 0.044) but β =... = 0.27 (> 0.16) when µ = 21 if α decreases, β must increase and vice-versa! Mathematical Statistics (MAS713) Ariel Neufeld 26 / 84

8. Hypothesis Testing 8.1 Tests of Hypotheses Impossible to make both types of error as small as possible simultaneously Mathematical Statistics (MAS713) Ariel Neufeld 27 / 84

8. Hypothesis Testing 8.1 Tests of Hypotheses With the decision rule : reject H 0 if x / [19.2, 20.8] Mathematical Statistics (MAS713) Ariel Neufeld 28 / 84

8. Hypothesis Testing 8.1 Tests of Hypotheses With the decision rule : reject H 0 if x / [19.2, 20.8] Mathematical Statistics (MAS713) Ariel Neufeld 28 / 84

8. Hypothesis Testing 8.1 Tests of Hypotheses With the decision rule : reject H 0 if x / [19.2, 20.8] α = 0.016, β = 0.27 if µ = 21 Mathematical Statistics (MAS713) Ariel Neufeld 28 / 84

8. Hypothesis Testing 8.1 Tests of Hypotheses Usually, one decides to set α to a predetermined level, called the significance level of the test This is because hypotheses testing methods were actually originally inspired by jury trials Mathematical Statistics (MAS713) Ariel Neufeld 29 / 84

8. Hypothesis Testing 8.1 Tests of Hypotheses In a trial, defendants are primarily assumed innocent (H 0 ). Then, if strong evidence is found to the contrary, then they are declared to be guilty (reject H 0 ) if there is insufficient evidence, they are declared nonguilty (no reject of H 0 ) not the same as proving the defendant innocent (accept H 0 )! If the jury is wrong, either an innocent person is convicted (type I error) or a culprit is let free (type II error) one thought (and probably still thinks) that convicting an innocent person was more a serious problem than the contrary controlling α is more important, could β be whatever it is Mathematical Statistics (MAS713) Ariel Neufeld 30 / 84

8. Hypothesis Testing 8.1 Tests of Hypotheses Errors : analogy to criminal trials Mathematical Statistics (MAS713) Ariel Neufeld 31 / 84

8. Hypothesis Testing 8.1 Tests of Hypotheses Significance level and decision rule Jury must be convinced beyond a reasonable doubt to convict usually, the significance level α is set to 0.10, 0.05 or 0.01 (it all depends on the consequences), and the decision rule is fixed accordingly Mathematical Statistics (MAS713) Ariel Neufeld 32 / 84

8. Hypothesis Testing 8.1 Tests of Hypotheses Definition The p-value is the smallest level of significance that would lead to rejection of H 0 with the observed sample Concretely, the p-value is the probability that the test statistic will take on a value that is at least as extreme as the observed value when H 0 is true ( extreme to be understood in the direction of the alternative) It provides a measure of the credibility of H 0 It might be interpreted as the chance of being wrong if we reject H 0 Mathematical Statistics (MAS713) Ariel Neufeld 33 / 84

8. Hypothesis Testing 8.1 Tests of Hypotheses One-sided alternatives Mathematical Statistics (MAS713) Ariel Neufeld 34 / 84

One-sided alternatives 8. Hypothesis Testing 8.1 Tests of Hypotheses The whole development, yet very similar, must be slightly adapted when one-sided alternatives are concerned First, it might occasionally be difficult to choose the appropriate formulation of the alternative In our running example, suppose now that we would like to highlight that the average drying time is actually longer than the advertised 20 min. Would we test for H 0 : µ 20 against H a : µ > 20, hoping to reject H 0, or H 0 : µ 20 against H a : µ < 20, hoping not to reject H 0? Mathematical Statistics (MAS713) Ariel Neufeld 35 / 84

One-sided alternatives 8. Hypothesis Testing 8.1 Tests of Hypotheses Remember that rejecting H 0 is a strong conclusion (we have enough evidence to do it), unlike not rejecting (we do not have enough evidence to conclude, the decision is dictated by risk aversion, not by facts weak conclusion) always put what we want to prove in the alternative hypothesis Here, we should test H 0 : µ 20 against H a : µ > 20 Mathematical Statistics (MAS713) Ariel Neufeld 36 / 84

One-sided alternatives 8. Hypothesis Testing 8.1 Tests of Hypotheses In a two-sided test, i.e. with alternative H a : µ µ 0, an observed value x of X much smaller than µ 0 or much larger than µ 0 is evidence in direction of H a However, if the alternative is H a : µ > µ 0, a small value of X is not evidence against H 0 : µ = µ 0 in favour of H a (H 0 is more likely than H a if X takes a small value!) we must only seek evidence against H 0 in the direction of H a! Mathematical Statistics (MAS713) Ariel Neufeld 37 / 84

One-sided alternatives 8. Hypothesis Testing 8.1 Tests of Hypotheses 1 Thus, in testing H 0 : µ = µ 0 against H a : µ > µ 0 we should reject H 0 if X is much greater than µ 0 2 Similarly, in testing H 0 : µ = µ 0 against H a : µ < µ 0 we should reject H 0 if X is much smaller than µ 0 The critical region is again determined by the significance level α Mathematical Statistics (MAS713) Ariel Neufeld 38 / 84

8. Hypothesis Testing 8.1 Tests of Hypotheses Confidence Intervals vs. Hypothesis Tests Mathematical Statistics (MAS713) Ariel Neufeld 39 / 84

8. Hypothesis Testing 8.2 Confidence Intervals vs. Hypothesis Tests Hypothesis tests and confidence intervals You might have noticed that the critical values for the (two-sided test) decision rule ] σ σ reject H 0 if x / [µ 0 z 1 α/2 n, µ 0 + z 1 α/2 n look like the limits of the (two-sided) confidence interval for µ (see Chapter 4, Slide 39) [ x z 1 α/2 σ n, x + z 1 α/2 σ n ] As the interval widths are the same, the confidence interval (centred at x) cannot contain µ 0 if the no-rejection area (centred at µ 0 ) does not contain x (and vice-versa) Mathematical Statistics (MAS713) Ariel Neufeld 40 / 84

8. Hypothesis Testing 8.2 Confidence Intervals vs. Hypothesis Tests Hypothesis tests and confidence intervals Generally speaking, there is always a close relationship between the test of hypothesis about any parameter, say θ, and the confidence interval for θ : If [l, u] is a 100 (1 α)% confidence interval for a parameter θ, then the hypothesis test for H 0 : θ = θ 0 against H a : θ θ 0 will reject H 0 at significance level α if and only if θ 0 is not in [l, u] Mathematical Statistics (MAS713) Ariel Neufeld 41 / 84

8. Hypothesis Testing 8.2 Confidence Intervals vs. Hypothesis Tests Hypothesis tests and confidence intervals hypothesis tests and CIs are more or less equivalent, however each provides somewhat different insights : CIs provide a range of likely values for θ tests easily display the risk levels, such as p-values, associated with a specific decision Note : the same analogy exists between one-sided tests and one-sided confidence intervals Mathematical Statistics (MAS713) Ariel Neufeld 42 / 84

8. Hypothesis Testing 8.3 Mathematical Formulation of Tests Mathematical Formulation of Tests Mathematical Statistics (MAS713) Ariel Neufeld 43 / 84

8. Hypothesis Testing 8.3 Mathematical Formulation of Tests Let X 1,..., X n be a random sample. Let S θ Θ be the Parameter space of unknown parameter Hypothesis formulation: Let Θ 0 Θ, Θ a Θ so that Θ 0 Θ a =. Then Null hypothesis H 0 : θ Θ 0 Alternative hypothesis H a : θ Θ a Definition: A hypothesis is called simple if Θ 0 = {θ 0 }, Θ a = {θ a } Mathematical Statistics (MAS713) Ariel Neufeld 44 / 84

8. Hypothesis Testing 8.3 Mathematical Formulation of Tests Definition: A test is a map t : R n {0, 1} where - t(x 1,..., x n ) = 0 means one does not reject the null hypothesis H 0 - t(x 1,..., x n ) = 1 means one rejects the null hypothesis (hence H 1 ) T := t(x 1,..., X n ) is called test statistic If K R denotes the critical region, the decision can be formulated as 1 {t(x1,...,x n) K } = one rejects H 0 if and only if for the observed value x 1,..., x n one has that the observed value of the data satisfies t(x 1,..., x n ) K. Mathematical Statistics (MAS713) Ariel Neufeld 45 / 84

8. Hypothesis Testing 8.3 Mathematical Formulation of Tests Type I error: Whenever θ Θ 0 and T K. Therefore, P θ (T K ) P(T K θ) for θ Θ 0 is the called the probability of having Type I error. Type II error: Whenever θ Θ a and T / K. Therefore, P θ (T / K ) P(T / K θ) for θ Θ a is the called the probability of having Type II error. Definition: The function β : Θ a [0, 1], is called the power of the test. θ β(θ) := P θ (T K ) P(T K θ) Mathematical Statistics (MAS713) Ariel Neufeld 46 / 84

8. Hypothesis Testing 8.3 Mathematical Formulation of Tests Typically one has that: - Θ 0 and Θ a form a partition of Θ - The map θ P θ [T K ] is continuous = one cannot simultaneously minimize P θ (T K ) on Θ 0 and maximize on Θ a Therefore, proceed as follows to construct T, K : 1) Fix significance level α and make sure that sup P θ (T K ) α θ Θ 0 2) Afterwards, try to maximize the power β(θ) = P θ (T K ) for θ Θ a Mathematical Statistics (MAS713) Ariel Neufeld 47 / 84

8. Hypothesis Testing 8.3 Mathematical Formulation of Tests Let Θ R. Definition: A test is called upper-tailed if H 0 : θ = θ 0, H a : θ > θ a (= K = (c u, )) A test is called lower-tailed if H 0 : θ = θ 0, H a : θ < θ a (= K = (, c l )) A test is called two-tailed if H 0 : θ = θ 0, H a : θ θ a (= K = (, c) (C, )) Mathematical Statistics (MAS713) Ariel Neufeld 48 / 84

8. Hypothesis Testing 8.3 Mathematical Formulation of Tests z-test - random sample X 1,..., X n i.i.d. N(µ, σ) where µ is unknown but σ known. θ = µ (Θ R) H 0 : µ = µ 0 Test statistic T = T (X 1,..., X n ) := n X n µ 0 σ = T N(0, 1) under P µ0. Mathematical Statistics (MAS713) Ariel Neufeld 49 / 84

8. Hypothesis Testing 8.3 Mathematical Formulation of Tests z-test: How to find critical region Given significance level α upper-tailed test (i.e. H 1 : µ > µ 0 ): K = (c u, ) where one finds c u by α = P µ0 (T K ) = P µ0 (T > c u ) = 1 Φ(c u ) = c u = z 1 α i.e. the 1 α quantile of N(0, 1)-distribution lower-tailed test (i.e. H 1 : µ < µ 0 ): K = (, c l ) where one finds c l by α = P µ0 (T K ) = P µ0 (T < c l ) = Φ(c l ) = c l = z α = z 1 α i.e. the α quantile of N(0, 1)-distribution Mathematical Statistics (MAS713) Ariel Neufeld 50 / 84

8. Hypothesis Testing 8.3 Mathematical Formulation of Tests two-tailed test (i.e. H 1 : µ µ 0 ): K = (, c) (C, ) by symmetry of N(0, 1) choose c = C 0 where one finds c by α = P µ0 (T < c) + P µ0 (T > c) = Φ(c) + 1 Φ( c) = 2Φ(c) = c = z α 2, C = c = z α 2 = z 1 α 2 Mathematical Statistics (MAS713) Ariel Neufeld 51 / 84

8. Hypothesis Testing 8.3 Mathematical Formulation of Tests t-test - random sample X 1,..., X n i.i.d. N(µ, σ) where both µ and σ 2 unknown. θ = (µ, σ 2 ) (Θ R (0, )) H 0 : µ = µ 0 More precisely Θ 0 = {µ 0 } (0, ) Test statistic T = T (X 1,..., X n ) := n X n µ 0 S = T t n 1 where: - S 2 := 1 n n 1 (X i X n ) 2 - t n 1 denotes t-student distribution with n 1-degree of freedom Mathematical Statistics (MAS713) Ariel Neufeld 52 / 84

8. Hypothesis Testing 8.3 Mathematical Formulation of Tests t-test: How to find critical region Given significance level α upper-tailed test (i.e. H 1 : µ > µ 0 ): K = (c u, ) where one finds c u by α = P µ0 (T K ) = P µ0 (T > c u ) = 1 F tn 1 (c u ) = c u = z 1 α i.e. the 1 α quantile of t n 1 -distribution lower-tailed test (i.e. H 1 : µ < µ 0 ): K = (, c l ) where one finds c l by α = P µ0 (T K ) = P µ0 (T < c l ) = F tn 1 (c l ) = c l = z α = z 1 α i.e. the α quantile of t n 1 -distribution Mathematical Statistics (MAS713) Ariel Neufeld 53 / 84

8. Hypothesis Testing 8.3 Mathematical Formulation of Tests two-tailed test (i.e. H 1 : µ µ 0 ): K = (, c) (C, ) by symmetry of t n 1 -distr. choose c = C 0 where one finds c by α = P µ0 (T < c) + P µ0 (T > c) = F tn 1 (c) + 1 F tn 1 ( c) = 2F tn 1 (c) = c = z α 2, C = c = z α 2 = z 1 α 2 Mathematical Statistics (MAS713) Ariel Neufeld 54 / 84

8. Hypothesis Testing 8.3 Mathematical Formulation of Tests What happens if random sample not normal? Let X 1,..., X n random sample, not necessarily normal Assume sample size is large (i.e. n large) Case 1: µ is unknown but σ known. Let H 0 : µ = µ 0 Test statistic T = T (X 1,..., X n ) := n X n µ 0 σ Case 2: Both µ and σ unknown. = T a N(0, 1) under P µ0. Let H 0 : µ = µ 0 Test statistic T = T (X 1,..., X n ) := n X n µ 0 S = T a N(0, 1) under P µ0. = Continue as for the z-test or t-test. Mathematical Statistics (MAS713) Ariel Neufeld 55 / 84

8. Hypothesis Testing 8.3 Mathematical Formulation of Tests p-value Motivation: We would like to see how "extreme" under H 0 is the observed value t(x 1,..., x n ) given data x 1,..., x n. Let Θ 0 = {θ 0 } Definition: The p-value of a test statistic T = t(x 1,..., X n ) given observed values x 1,..., x n is the probability under the null-hypothesis to obtain an at least as extreme value as the one observed. - Hereby, the alternative hypothesis defines what is more extreme. Mathematical Statistics (MAS713) Ariel Neufeld 56 / 84

8. Hypothesis Testing 8.3 Mathematical Formulation of Tests Mathematical Definition of p-value: p-value of T = t(x 1,..., X n ) given observation x 1,..., x n is defined: Upper-tailed test: ( p-value := P θ0 T t(x1,..., x n ) ) Lower-tailed test: ( p-value := P θ0 T t(x1,..., x n ) ) Two-tailed test: ( p-value := 2 min {P θ0 T t(x1,..., x n ) ) (, P θ0 T t(x1,..., x n ) )} Consequence: We reject H 0 (and take H a ) p-value < α Mathematical Statistics (MAS713) Ariel Neufeld 57 / 84

8. Hypothesis Testing 8.3 Mathematical Formulation of Tests Example coin toss: n = 10, X 1,..., X 10 i.i.d. Ber(θ) under P θ Test statistic: T = t(x 1,..., X 10 ) = 10 X i Bin(10, θ) under P θ Data: x 1,..., x 10 with t(x 1,..., x n ) = 10 x i = 7. Case 1: H 0 : θ = 0.5, H a : θ > 0.5. p-value = P 0.5 (T 7) = 0.17 Case 2: H 0 : θ = 0.5, H a : θ < 0.5. p-value = P 0.5 (T 7) = 0.94 Case 3: H 0 : θ = 0.5, H a : θ 0.5. p-value = 2 P 0.5 (T 7) = 0.34 Conclusion: For significance level α = 0.05, H 0 will in all cases not be rejected. Mathematical Statistics (MAS713) Ariel Neufeld 58 / 84

8. Hypothesis Testing 8.4 Likelihood Ratio Test Likelihood Ratio Test Mathematical Statistics (MAS713) Ariel Neufeld 59 / 84

Let X 1,..., X n be random sample 8. Hypothesis Testing 8.4 Likelihood Ratio Test Given observations x := (x 1,..., x n ) Let θ L(θ x) := p(x θ) be the Likelihood function Given observations x 1,..., x n, consider the ratio Λ(x 1,..., x n ) := sup θ Θ 0 L(θ x) sup θ Θa L(θ x) Intuition: If Λ(x 1,..., x n ) is small one can interpret that more likely H a is true. Definition: For any given c 0 the Likelihood Ratio Test (LRT) with respect to c is defined as T (X 1,..., X n ) := Λ(X 1,..., X n ) = sup θ Θ 0 L(θ X) sup θ Θa L(θ X) with corresponding critical region K := {x : Λ(x) < c} Mathematical Statistics (MAS713) Ariel Neufeld 60 / 84

8. Hypothesis Testing 8.4 Likelihood Ratio Test There is slight alternative definition of the LRT test: Definition: For any given c (0, 1) the alternative Likelihood Ratio Test (LRT) with respect to c is defined as Λ(X 1,..., X n ) = sup θ Θ 0 L(θ X) sup θ Θ L(θ X) with corresponding critical region K := {x : Λ(x) < c} Mathematical Statistics (MAS713) Ariel Neufeld 61 / 84

8. Hypothesis Testing 8.4 Likelihood Ratio Test In which is sense is LRT Test optimal? Neyman-Pearson Lemma Assume that: Θ 0 = {θ 0 }, Θ a = {θ a } T (X 1,..., X n ) = Λ(X 1,..., X n ) (i.e. LRT) with critical region K = [0, c) Let α := P θ0 (T K ). Then, for any other test (T, K ) with P θ0 (T K ) α we have that P θa (T K ) P θa (T K ) Intepretation: Under the above assumptions, LRT is the most powerful test with significance level α (also called uniformly most powerful UMP test of all level α tests) Mathematical Statistics (MAS713) Ariel Neufeld 62 / 84

8. Hypothesis Testing 8.4 Likelihood Ratio Test 5 Steps to follow when doing a statistical test 1) Choose your model (i.e. sample distribution) 2) Define H 0 and H a 3) Define statistical test T = t(x 1,..., X n ) 4) Fix significance level α. This characterizes K 5) Compute t(x 1,..., x n ) given observation (x 1,..., x n ) and conclude by the decision rule 1 {t(x1,...,x n) K } Mathematical Statistics (MAS713) Ariel Neufeld 63 / 84

8. Hypothesis Testing 8.5 Examples Examples Mathematical Statistics (MAS713) Ariel Neufeld 64 / 84

8. Hypothesis Testing 8.5 Examples Example Suppose that X 1,..., X n are i.i.d. samples from N (µ, σ) random variables with σ known, but µ unknown. 1 Apply the Neyman-Pearson lemma to construct the best test of the hypotheses where µ 1 µ 0. 2 Is this a simple test? 3 What is the test statistic? 4 What is the critical region? 5 What is the power of the test? H 0 : µ = µ 0 H a : µ = µ 1 Mathematical Statistics (MAS713) Ariel Neufeld 65 / 84

8. Hypothesis Testing 8.5 Examples Question: Is this a simple test? Solution: Yes, because both H 0 = {µ 0 } and H a = {µ 1 } are singletons. Mathematical Statistics (MAS713) Ariel Neufeld 66 / 84

8. Hypothesis Testing 8.5 Examples Question: Is this a simple test? Solution: Yes, because both H 0 = {µ 0 } and H a = {µ 1 } are singletons. Mathematical Statistics (MAS713) Ariel Neufeld 66 / 84

8. Hypothesis Testing 8.5 Examples The LR is given by p (x 1,..., x n µ 0 ) = p (x 1,..., x n µ 1 ) = Λ (x 1,..., x n ) := p (x 1,..., x n µ 0 ) p (x 1,..., x n µ 1 ) n n ( 1 exp 1 ) 2πσ 2 2σ (x i µ 0 ) 2 ( 1 exp 1 ) 2πσ 2 2σ (x i µ 1 ) 2 Mathematical Statistics (MAS713) Ariel Neufeld 67 / 84

8. Hypothesis Testing 8.5 Examples We use the Neyman-Pearson lemma and write Λ (x 1,..., x n ) := p (x 1,..., x n µ 0 ) p (x 1,..., x n µ 1 ) n 1 ( exp 1 2πσ 2 2σ (x i µ 0 ) 2) = n 1 ( exp 1 2πσ 2 2σ (x i µ 1 ) 2) = n n ( exp 1 (x 2σ 2 i µ 0 ) 2) ( exp 1 (x 2σ 2 i µ 1 ) 2) ( ( n )) = exp 1 n 2σ 2 (x i µ 0 ) 2 (x i µ 1 ) 2 ( = exp n ( )) 2σ 2 2 x (µ 0 µ 1 ) + µ 2 0 µ2 1 Mathematical Statistics (MAS713) Ariel Neufeld 68 / 84

8. Hypothesis Testing 8.5 Examples We use the Neyman-Pearson lemma and write Λ (x 1,..., x n ) := p (x 1,..., x n µ 0 ) p (x 1,..., x n µ 1 ) n 1 ( exp 1 2πσ 2 2σ (x i µ 0 ) 2) = n 1 ( exp 1 2πσ 2 2σ (x i µ 1 ) 2) = n n ( exp 1 (x 2σ 2 i µ 0 ) 2) ( exp 1 (x 2σ 2 i µ 1 ) 2) ( ( n )) = exp 1 n 2σ 2 (x i µ 0 ) 2 (x i µ 1 ) 2 ( = exp n ( )) 2σ 2 2 x (µ 0 µ 1 ) + µ 2 0 µ2 1 Mathematical Statistics (MAS713) Ariel Neufeld 68 / 84

8. Hypothesis Testing 8.5 Examples We use the Neyman-Pearson lemma and write Λ (x 1,..., x n ) := p (x 1,..., x n µ 0 ) p (x 1,..., x n µ 1 ) n 1 ( exp 1 2πσ 2 2σ (x i µ 0 ) 2) = n 1 ( exp 1 2πσ 2 2σ (x i µ 1 ) 2) = n n ( exp 1 (x 2σ 2 i µ 0 ) 2) ( exp 1 (x 2σ 2 i µ 1 ) 2) ( ( n )) = exp 1 n 2σ 2 (x i µ 0 ) 2 (x i µ 1 ) 2 ( = exp n ( )) 2σ 2 2 x (µ 0 µ 1 ) + µ 2 0 µ2 1 Mathematical Statistics (MAS713) Ariel Neufeld 68 / 84

8. Hypothesis Testing 8.5 Examples We use the Neyman-Pearson lemma and write Λ (x 1,..., x n ) := p (x 1,..., x n µ 0 ) p (x 1,..., x n µ 1 ) n 1 ( exp 1 2πσ 2 2σ (x i µ 0 ) 2) = n 1 ( exp 1 2πσ 2 2σ (x i µ 1 ) 2) = n n ( exp 1 (x 2σ 2 i µ 0 ) 2) ( exp 1 (x 2σ 2 i µ 1 ) 2) ( ( n )) = exp 1 n 2σ 2 (x i µ 0 ) 2 (x i µ 1 ) 2 ( = exp n ( )) 2σ 2 2 x (µ 0 µ 1 ) + µ 2 0 µ2 1 Mathematical Statistics (MAS713) Ariel Neufeld 68 / 84

8. Hypothesis Testing 8.5 Examples We use the Neyman-Pearson lemma and write Λ (x 1,..., x n ) := p (x 1,..., x n µ 0 ) p (x 1,..., x n µ 1 ) n 1 ( exp 1 2πσ 2 2σ (x i µ 0 ) 2) = n 1 ( exp 1 2πσ 2 2σ (x i µ 1 ) 2) = n n ( exp 1 (x 2σ 2 i µ 0 ) 2) ( exp 1 (x 2σ 2 i µ 1 ) 2) ( ( n )) = exp 1 n 2σ 2 (x i µ 0 ) 2 (x i µ 1 ) 2 ( = exp n ( )) 2σ 2 2 x (µ 0 µ 1 ) + µ 2 0 µ2 1 Mathematical Statistics (MAS713) Ariel Neufeld 68 / 84

8. Hypothesis Testing 8.5 Examples the test statistic is for given c is: ( Λ (x 1,..., x n ) := exp n ( )) 2σ 2 2 x (µ 0 µ 1 ) + µ 2 0 H0 µ2 1 c H a We try to separate between random variables and constants = We take the log transform which is equal to n ( ) 2σ 2 2 x (µ 0 µ 1 ) + µ 2 0 H0 µ2 1 log c H a x H 0 σ 2 log c + µ 0 + µ 1 H a n µ 0 µ 1 2 Mathematical Statistics (MAS713) Ariel Neufeld 69 / 84

8. Hypothesis Testing 8.5 Examples The critical region is C = {x : x < σ2 n log c + µ } 0 + µ 1 µ 0 µ 1 2 Mathematical Statistics (MAS713) Ariel Neufeld 70 / 84

8. Hypothesis Testing 8.5 Examples What is the power of the test? Solution: P µ1 (Λ (X 1,..., X n ) < c) ( P µ1 X < σ2 log c + µ ) 0 + µ 1 n µ 0 µ 1 2 We need to find the distribution of X under the alternative: ( ) σ X H a N µ 1, n Mathematical Statistics (MAS713) Ariel Neufeld 71 / 84

8. Hypothesis Testing 8.5 Examples ( ( X µ1 σ 2 log c P µ1 n < + µ ) ) 0 + µ 1 n µ 1 σ n µ 0 µ 1 2 σ which is for Z N(0, 1) also equal ( ( σ 2 log c P Z < + µ ) ) 0 + µ 1 n µ 1 n µ 0 µ 1 2 σ which can be easily found (using standard normal-table). Mathematical Statistics (MAS713) Ariel Neufeld 72 / 84

8. Hypothesis Testing 8.5 Examples In the same way you can find the significance level α (so that Neyman-Pearson Lemma holds) α := P µ0 (Λ (X 1,..., X n ) < c) Mathematical Statistics (MAS713) Ariel Neufeld 73 / 84

8. Hypothesis Testing 8.5 Examples Example Suppose that X 1,..., X n are i.i.d. samples from N (µ, σ) random variables with σ known. 1 Apply the alternative LRT Λ(X 1,..., X n ) for some c (0, 1) with the hypothesis 2 What is the critical region? H 0 :µ = µ 0 H a :µ µ 0 Mathematical Statistics (MAS713) Ariel Neufeld 74 / 84

Solution: The alternative LRT is given by 8. Hypothesis Testing 8.5 Examples Λ (x 1,..., x n ) := p (x 1,..., x n µ 0 ) sup p (x 1,..., x n µ) µ p (x 1,..., x n µ 0 ) = p (x 1,..., x n µ) = n n H 0 H a c ( 1 exp 1 ) 2πσ 2 2σ (x i µ 0 ) 2 ( 1 exp 1 ) 2πσ 2 2σ (x i µ) 2 Since µ is unknown we estimate it from the data by finding the unrestricted MLE: µ = x Mathematical Statistics (MAS713) Ariel Neufeld 75 / 84

The alternative LRT is given by 8. Hypothesis Testing 8.5 Examples Λ (x 1,..., x n ) := p (x 1,..., x n µ 0 ) p (x 1,..., x n µ) n 1 ( exp 1 2πσ 2 2σ (x i µ 0 ) 2) = n 1 ( exp 1 2πσ 2 2σ (x i µ) 2) n ( exp 1 (x 2σ 2 i µ 0 ) 2) = n ( exp 1 (x 2σ 2 i µ) 2) ( ( n )) = exp 1 n 2σ 2 (x i µ 0 ) 2 (x i µ) 2 ( = exp n ( 2σ 2 2 x (µ 0 x) + µ 2 0 x 2)) Mathematical Statistics (MAS713) Ariel Neufeld 76 / 84

The alternative LRT is given by 8. Hypothesis Testing 8.5 Examples Λ (x 1,..., x n ) := p (x 1,..., x n µ 0 ) p (x 1,..., x n µ) n 1 ( exp 1 2πσ 2 2σ (x i µ 0 ) 2) = n 1 ( exp 1 2πσ 2 2σ (x i µ) 2) n ( exp 1 (x 2σ 2 i µ 0 ) 2) = n ( exp 1 (x 2σ 2 i µ) 2) ( ( n )) = exp 1 n 2σ 2 (x i µ 0 ) 2 (x i µ) 2 ( = exp n ( 2σ 2 2 x (µ 0 x) + µ 2 0 x 2)) Mathematical Statistics (MAS713) Ariel Neufeld 76 / 84

The alternative LRT is given by 8. Hypothesis Testing 8.5 Examples Λ (x 1,..., x n ) := p (x 1,..., x n µ 0 ) p (x 1,..., x n µ) n 1 ( exp 1 2πσ 2 2σ (x i µ 0 ) 2) = n 1 ( exp 1 2πσ 2 2σ (x i µ) 2) n ( exp 1 (x 2σ 2 i µ 0 ) 2) = n ( exp 1 (x 2σ 2 i µ) 2) ( ( n )) = exp 1 n 2σ 2 (x i µ 0 ) 2 (x i µ) 2 ( = exp n ( 2σ 2 2 x (µ 0 x) + µ 2 0 x 2)) Mathematical Statistics (MAS713) Ariel Neufeld 76 / 84

The alternative LRT is given by 8. Hypothesis Testing 8.5 Examples Λ (x 1,..., x n ) := p (x 1,..., x n µ 0 ) p (x 1,..., x n µ) n 1 ( exp 1 2πσ 2 2σ (x i µ 0 ) 2) = n 1 ( exp 1 2πσ 2 2σ (x i µ) 2) n ( exp 1 (x 2σ 2 i µ 0 ) 2) = n ( exp 1 (x 2σ 2 i µ) 2) ( ( n )) = exp 1 n 2σ 2 (x i µ 0 ) 2 (x i µ) 2 ( = exp n ( 2σ 2 2 x (µ 0 x) + µ 2 0 x 2)) Mathematical Statistics (MAS713) Ariel Neufeld 76 / 84

The alternative LRT is given by 8. Hypothesis Testing 8.5 Examples Λ (x 1,..., x n ) := p (x 1,..., x n µ 0 ) p (x 1,..., x n µ) n 1 ( exp 1 2πσ 2 2σ (x i µ 0 ) 2) = n 1 ( exp 1 2πσ 2 2σ (x i µ) 2) n ( exp 1 (x 2σ 2 i µ 0 ) 2) = n ( exp 1 (x 2σ 2 i µ) 2) ( ( n )) = exp 1 n 2σ 2 (x i µ 0 ) 2 (x i µ) 2 ( = exp n ( 2σ 2 2 x (µ 0 x) + µ 2 0 x 2)) Mathematical Statistics (MAS713) Ariel Neufeld 76 / 84

8. Hypothesis Testing 8.5 Examples The alternative LRT is given by ( Λ (x 1,..., x n ) := exp n ( )) 2σ 2 2 xµ 0 + x 2 + µ 2 0 And the test is: ( Λ (x 1,..., x n ) := exp n ( )) 2σ 2 2 xµ 0 + x 2 + µ 2 H0 0 c H a We take the log transform which is equal to n ( ) 2σ 2 2 xµ 0 + x 2 + µ 2 H0 0 log c H a x 2 + 2 xµ 0 H 0 H a 2σ 2 n log c + µ2 0 Mathematical Statistics (MAS713) Ariel Neufeld 77 / 84

8. Hypothesis Testing 8.5 Examples The critical region is } C = {x : x 2 + 2 xµ 0 < 2σ2 n log c + µ2 0 } = {x : ( x µ 0 ) 2 < 2σ2 n log c { } = x : x µ 0 > 2σ2 log c n Mathematical Statistics (MAS713) Ariel Neufeld 78 / 84

8. Hypothesis Testing 8.5 Examples Example Suppose that the distribution of lifetimes of TV tubes can be adequately modelled by an exponential distribution with mean θ so { 1 p (x θ) = θ exp ( ) x θ, x 0 0, Otherwise Under usual production conditions, the mean lifetime is 2000 hours but if a fault occurs in the process, the mean lifetime drops to 1000 hours. A random sample of 20 tube lifetimes is to taken in order to test the hypotheses H 0 :θ = 2000 = θ 0 H a :θ = 1000 = θ a 1 Use the Neyman-Pearson lemma to find the most powerful test with significance level α. 2 Find the Type I error. Mathematical Statistics (MAS713) Ariel Neufeld 79 / 84

Solution: We have that the likelihood is Therefore p (x 1,..., x 20 θ) = 8. Hypothesis Testing 8.5 Examples 20 20 1 p (x i θ) = ( θ exp x ) θ ( = 1 exp 1 θ20 θ 20 Λ (x 1,..., x 20 ) = p (x 1,..., x 20 θ = 2000) p (x 1,..., x 20 θ = 1000) ( ) 1000 20 ( 20 x = exp 2000 1000 20 x ) 2000 ( ) x = 2 20 exp 100 x i ) Mathematical Statistics (MAS713) Ariel Neufeld 80 / 84

8. Hypothesis Testing 8.5 Examples Using the Neyman-Pearson lemma, the most powerful test of significance α has critical region { ( ) } x C = x 1,..., x 20 : 2 20 exp < c 100 { ( ) } x = x 1,..., x 20 : exp < 2 20 c 100 = {x 1,..., x 20 : x < 100 (log c + 20 log 2)} Mathematical Statistics (MAS713) Ariel Neufeld 81 / 84

8. Hypothesis Testing 8.5 Examples The type I error is ( ) P θ0 X < 100 (log c + 20 log 2) ( ) =P θ0 X < 100 (log c + 20 log 2) θ = 2000 ( ) 1 20 =P θ0 X i 100 (log c + 20 log 2) 20 ( 20 ) =P θ0 X i 20 100 (log c + 20 log 2) ( ) =P θ0 Y 20 100 (log c + 20 log 2) X i where Y = 20 Mathematical Statistics (MAS713) Ariel Neufeld 82 / 84

8. Hypothesis Testing 8.5 Examples It turns out that the sum of n independent exponentially distribution R.V.s with parameter 1 θ follows the Gamma distribution with parameters n and 1 θ ( Y Γ n, 1 ) θ = So we can calculate (using matlab) P θ0 (Y 20 100 (log λ 20 log 2)) Mathematical Statistics (MAS713) Ariel Neufeld 83 / 84

8. Hypothesis Testing Objectives Now you should be able to : understand the concepts of significance level, power, error of type I and of type II explain and use the relationship between confidence intervals and hypothesis tests construct the LRT with nuisance parameters Put yourself to the test! Q3 p.402, Q6 p.403, Q7 p.403, Q15 p.404, Q17 p.405 Mathematical Statistics (MAS713) Ariel Neufeld 84 / 84