Download H - WordPress.com

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project

Document related concepts
no text concepts found
Transcript
Semester I, EE, 2013/14
Wojciech Artichowicz, PhD. Eng.
Department of Hydraulic
Engineering
Statistical hypothesis
Statistical hypothesis is such supposition on a distribution
(or its parameters) of some given random variable, that it
can be inferred whether it is true or not on a basis of a
sample, being a realization of this random variable.
Null and alternative hypotheses
Hypothesis, which is being tested is called a null
hypothesis, and is denoted as H0.
Hypothesis, which is accepted if null hypothesis is
rejected, is called an alternative gypothesis and is denoted
as H1.
Types of statistical hypotheses
Due to the object of hypothesis
• Parametric
• Non-parametric
Due to explicitness of a definition of CDF of a RV:
• Simple – define CDF absolutely
• Compound – do not define CDF absolutely
Example
H0: Mean value of resistance against tension of steel beams
is equal to 150 MPa.
H1: Mean value of resistance against tension of steel beams
is not equal to 150 MPa.
Example
H0: CDF of BOD5 in water in Vistula river is identical to
normal distribution.
H1: CDF of BOD5 in water in Vistula river is different
than normal distribution.
Type I and II errors
Type I error is rejecting the null hypothesis, in a case when
it is true.
Type II error is accepting the null hypothesis, in a case
when it is false.
Significance coefficient
Significance coefficient a is a a`priori assumed probability
of making an error of type I.
Critical region
Critical region is a set of values of testing statistic, for
which null hypothesis is rejected.
p-value
p-value is a smallest significance coefficient, for which the
observed value of testing statistic leads to rejection of null
hypothesis.
Remark: The smaller is p-value the more reasonable is to
reject null hypothesis.
Robustness of statistical test
Robustness of a statistical test denoted as 1-b is a
probability of rejecting false null hypothesis and accpeting
the alternative hypothesis.
Value of b is a probability of making error of type II.
Test for mean value (1)
Let random variable X has a normal distribution with
known standard deviation s.
H0: m = m0
H1: m < m0
H1: m > m0
H1: m ≠ m0
The test of this hypothesis is a mean of a sample 𝑥 .
Statistic
𝑥 − 𝜇0
𝑍=
𝑛
𝜎
has distribution N(0,1).
Test for mean value (1)
Finding the critical region:
𝑃 𝑈 ≥ 𝑢𝛼 = 𝛼
𝑥 − 𝜇0
𝑃
𝑛 ≥ 𝑢𝛼 = 𝛼
𝜎
𝑥 − 𝜇0
𝑥 − 𝜇0
𝑃 −
𝑛 ≤ −𝑢𝛼 ⋀
𝑛 ≥ 𝑢𝛼 = 𝛼
𝜎
𝜎
Null hypothesis is rejected, if
𝑥 − 𝜇0
𝑥 − 𝜇0
−
𝑛 ≤ −𝑢𝛼 ⋀
𝑛 ≥ 𝑢𝛼
𝜎
𝜎
Test for mean value (1)
Critical region:
𝑥 − 𝜇0
𝑥 − 𝜇0
−
𝑛 ≤ −𝑢𝛼 ⋀
𝑛 ≥ 𝑢𝛼
𝜎
𝜎
Example
Random variable has normal distribution N(m,5). A sample
has been collected of a size n=16 observations. Taking
significance level a=0.05 test hypothesis, that mean value
of a statistical population is equal to m=10. Mean value
computed on a basis of a sample is 10.9.
H0: m = 10;
H1: m ≠ 10;
𝑥 − 𝜇0
𝑛 = 0.72
𝜎
𝑢𝛼 = ±1.9599
No basis to reject the null hypothesis.
Example
Example
Example
Random variable has normal distribution N(m,5). A sample
has been collected of a size n=16 observations. Taking
significance level a=0.05 test hypothesis, that mean value
of a statistical population is equal to m=10 against the
alternative hypothesis saying that the mean value is greater than
10. Mean value computed on a basis of a sample is 10.9.
H0: m = 10;
H1: m > 10;
𝑥 − 𝜇0
𝑛 = 0.72
𝜎
𝑢𝛼 = 1.64485
No basis to reject the null hypothesis.
Test for mean value (2)
Let random variable X have any pdf, and the sample on
which the test is performed is large.
H0: m = m0
H1: m < m0
H1: m > m0
H1: m ≠ m0
The test statistic
𝑥 − 𝜇0
𝑍=
𝑛
𝑠
has distribution N(0,1).
𝑥 − 𝜇0
𝑥 − 𝜇0
𝑃 −
𝑛 ≤ −𝑢𝛼 ⋀
𝑛 ≥ 𝑢𝛼 = 𝛼
𝑠
𝑠
Test for mean value (3)
Let random variable X have normal distribution, and the
sample on which the test is performed is small.
H0: m = m0
H1: m < m0
H1: m > m0
H1: m ≠ m0
The test statistic
𝑥 − 𝜇0
𝑡=
𝑛−1
𝑠
has t-Student’s istribution with n-1 degrees of freedom.
𝑥 − 𝜇0
𝑥 − 𝜇0
𝑃 −
𝑛 ≤ −𝑡𝛼 ⋀
𝑛 ≥ 𝑡𝛼 = 𝛼
𝑠
𝑠
Example
From the statistical population the sample was colected
x={5.6; 5.0; 5.2; 5.2; 5.5; 5.1; 5.5}. On the significance level
a=0.05 test the hypothesis H0: m = 5.2 against H1: m ≠ 5.2.
𝑥 − 𝜇0
𝑛 − 1 = 1.06066
𝑠
𝑡𝛼 = 2.4469
No basis to reject H0.
Test for variance
Let X be random variable with normal distribution.
H0: 𝜎 2 = 𝜎02
H1: 𝜎 2 < 𝜎02
H1: 𝜎 2 > 𝜎02
H1: 𝜎 2 ≠ 𝜎02
Statistic:
2
𝑛
∙
𝑠
𝑢2 = 2
𝜎
has distribution c2 with n-1 degrees of freedom.
2
𝑛
∙
𝑠
𝑃 𝑢12 ≤ 2 ≤ 𝑢22 = 𝛼
𝜎
2
𝑛
∙
𝑠
𝑢12 ≤ 2 ≤ 𝑢22
𝜎
Example
Using certain measuring
device n=10 independent
measurements of the same quantity were made: x={7.03; 7.05;
7.04; 7.04; 7.07; 7.02; 7.01; 7.05; 7.03; 7.02}. Manufacturer says,
that standard deviation of this device is equal to 0.03. Check if
the manufacturer says the truth. Take a=0,01.
H0: 𝜎 2 = 𝜎02 ;
H1: 𝜎 2 > 𝜎02 ;
2
𝑛
∙
𝑠
𝑢2 = 2 = 3.50617
𝜎
𝑢𝛼2 = 21.66
No reason to reject the null hypothesis.
Example
Basic types of non-parametric tests
• Goodness of fit tests
• Independence tests
• Other
Goodness of fit tests
Goodness of fit tests check the hypothesis, that the
examined random variable has a distribution of certain
type. For example.:
• Shapiro’s-Wilk’s test of normality
• c2 goodness of fit test
Independence tests
Independence tests check the hypothesis, that two (or
more) random variables are independent on each other.
For example.: c2 independence test
Measures of distance between distributions
𝛥=
sup
−∞<𝑥<∞
|𝐹1 𝑥 − 𝐹2 𝑥 |
∞
𝛥=
𝑓1 𝑥 − 𝑓2 𝑥
−∞
2 𝑑𝑥
c2 Goodness of fit test
General population has any distribution with CDF that belongs
to some set 𝒟 of defined functional type of CDFs.
𝐻0 : 𝐹(𝑥) ∈ 𝒟
𝐻1 : 𝐹(𝑥) ∉ 𝒟
Statistic
𝑘
𝜒2 =
𝑖=1
(𝑛𝑖 − 𝑛 ∙ 𝑝𝑖 )2
𝑛 ∙ 𝑝𝑖
has 𝜒 2 distribution with k-m-1 degrees of freedom, where:
k – number of bins of empirical probability distribution
function,
m – number of parameters of f(x) estimated with MLM based on
a sample
Example
Water flow discharge in a pipe was examined. using c2 test
check, if the distriubion of flow discharge can be treaded as
normal. Use a=0.01.
i
xi – xi+1
[m3/s]
ni
1
2
3
4
5
6
0.0-0.2
0.2-0.4
0.4-0.6
0.6-0.8
0.8-1.0
1.0-1.2
8
15
26
36
12
3
Example
Water flow discharge in a pipe was examined. using c2 test
check, if the distriubion of flow discharge can be treaded as
normal. Use a=0.01.
k=6
n=100
m=2
i
xi – xi+1
[m3/s]
ni
1
2
3
4
5
6
0.0-0.2
0.2-0.4
0.4-0.6
0.6-0.8
0.8-1.0
1.0-1.2
8
15
26
36
12
3
6
𝜒2 =
𝑖=1
n∙pi
pi
0.0631443
0.17589
0.304792
0.279876
0.136157
0.0401402
𝑛𝑖 − 𝑛 ∙ 𝑝𝑖
𝑛 ∙ 𝑝𝑖
6.31443
17.589
30.4792
27.9876
13.6157
4.01402
2
= 4.23098
𝜒𝛼2 = 11.3449
No basis to reject the null hypothesis.
Example
6
𝜒2 =
𝑖=1
𝑛𝑖 − 𝑛 ∙ 𝑝𝑖
𝑛 ∙ 𝑝𝑖
2
= 4.23098
𝜒𝛼2 = 11.3449
No basis to reject the null hypothesis.
Related documents