94 2. FUNDAMENTAL RELIABILITY MATHEMATICS
Step 8: e Chi-Square goodness-of-fit test.
Since W D 0:989 <
2
0:95
.
7
/
D 14:07, the hypothesis H
0
should not be rejected with a
confidence level 95%, that is, the material’s yield strength follows the normal distribution
with a mean
x
D 60:1 (ksi) and a standard deviation
x
D 5:23 (ksi).
2.13.3 THE CHI-SQUARE (
2
) GOODNESS-of-FIT TEST BY THE MATLAB
PROGRAM
e MATLAB can be used to conduct the Chi-square (
2
) goodness-of-fit test. Suppose that
the collected sample data X is arranged in one column matrix and stored as a Microsoft Excel
file. Import the sample data X into a MATLAB program and then use the command histogram
(X)” to create its histogram. Per the histogram or previous experience about the sample data,
we can assume that the sample data follow a specific distribution.
In MATLAB software, there are several commands related to the goodness-of-fit test. For
the goodness-of-fit test, two commands in the MATLAB program are needed. e first com-
mand fitdist.X; distname/ is to create the assumed distribution with the distribution parameters
which are determined by the sample data X
pd D fitdist.X; distname/; (2.135)
where
X—is the sample data and is expressed as a one-column matrix.
distname—is the name of the assumed distribution. “wbl for a Weibull distribution and
exp” for an exponential distribution. A full list of distname can be found through the
“Help” in MATLAB software.
pd—is just any variable name for representing the assumed distribution.
e second command chi2gof .X;
0
CDF
0
; pd;
0
Alpha
0
; value/ is to conduct the Chi-square
(
2
) goodness-of-fit test.
h D chi2gof .X;
0
CDF
0
; pd;
0
Alpha
0
; value/ (2.136)
h D chi2gof .X;
0
CDF
0
; pd/; (2.137)
where
X—is the same as that in Equation (2.135).
0
CDF
0
—will not be changed and means that the comparison between the sample data and
the assumed distribution will be through the CDF.
2.13. GOODNESS-OF-FIT TEST:
2
TEST 95
pd—should be the same variable name as that in Equation (2.135).
0
Alpha
0
; value—is the significant level a and its value. e value of the significant level a
can be 0.10, 0.05, 0.01, and so on. However, the significant level a must be at least 0.10. If
the significant level a has a default value, that is, 0.05, the command in Equation (2.137)
can be used.
h—will be equal to 0 or 1. If h is equal to 0, the hypothesis should not be rejected; that
is, the sample data can be properly described by the assumed distribution. If h is equal to
1, the hypothesis should be rejected; that is, the sample data cannot be properly described
by the assumed distribution.
Example 2.47
A set of 100 sample data of material strength is listed in Table 2.14 and is stored in an Excel file
with the name “Example2-44.xls.” (1) Display its histogram. (2) Use the MATLAB program to
check whether it follows a lognormal distribution with a significant level a D 0:05. (3) Use the
MATLAB program to check whether it follows a Weibull distribution with a significant level
a D 0:05. (4) Use the MATLAB program to check whether it follows a normal distribution
with a significant level a D 0:05.
Table 2.14: One hundred sample data of material strengh (ksi)
12.47, 12.15, 22.01, 16.66, 10.57, 28.11, 27.98,47.46, 60.95, 17.63, 37.9,5.91, 9.69, 6.1, 13.82, 39.25, 44.65,
42.83, 85.33, 14.06, 8.13, 2.66, 23.99, 27.36, 23.28, 13.52, 63.75, 8.83, 158.65, 21.83, 16.04, 46.82, 20.22, 55.95,
74.14, 7.1, 37.27, 24.6, 48.51, 4.96, 49.78, 27.69, 77.36, 3.79, 19.79, 18.63, 23.9, 153.06, 27.72, 74.08, 9.89,6.99,
14.76, 10.07, 14.25, 30.84, 19.63, 9.34, 61.22, 10.37, 54.44, 32.57, 6.88, 41.54, 49.41, 30.09, 16.82, 29.09, 72.4,
36.42, 25.31, 9.25, 11.33, 10.06, 18.42, 23.85, 29.87, 38.07, 24.71, 56.74, 25.72, 3.92, 5.53, 37.66, 45.59, 17.19,
79.8, 6.51, 13.17, 15.55, 12.28, 13.91, 10.79, 38.44, 19.56, 3.86, 31.36, 27.29, 71.44, 24.31,
Solution:
1. Display its histogram.
e MATLAB program for display the histogram with a 10 bin is:
%Import the data from an Excel file
X=xlsread(‘Example 2.44’),
% Create a 10-bin histogram
histogram(X,10)
96 2. FUNDAMENTAL RELIABILITY MATHEMATICS
e histogram of this sample data is shown in Figure 2.29. From the histogram, the sample
data might follow a lognormal or Weibull distribution. Since the histogram is significantly
skewed toward the left, it could not be a normal distribution.
35
30
25
20
15
10
5
0
0 20 40 60 80 100 120 140 160
Figure 2.29: e histogram of sample data.
2. A lognormal distribution.
e hypothesis H
0
: e material strength follows a lognormal distribution.
e MATLAB program for this goodness-of-fit test is:
% The goodness-of-fit test on the data in the Excel
% file “Example2.43.xls”
X=xlsread('Example2.44');
Q2=fitdist(X,'logn')
h=chi2gof(X,'CDF',Q2)
After running the above MATLAB program, the result of “h” is 0. e hypothesis should
not be rejected. So, the material strength can be properly described by a lognormal distri-
bution.
3. A Weibull distribution.
e hypothesis H
0
: the material strength follows a Weibull distribution.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset