line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package ConfInt; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
=head1 NAME |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
ConfInt - Perl extension for calculating the confidence interval of |
6
|
|
|
|
|
|
|
meassured values. |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
=head1 SYNOPSIS |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
use ConfInt; |
11
|
|
|
|
|
|
|
ConfInt([ARGUMENT_1],[ARGUMENT_2]); |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
=head1 DESCRIPTION |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
This module calculates and returns the relative error of the turned |
16
|
|
|
|
|
|
|
over values. ConfInt needs two things to be turned over: 1st is the |
17
|
|
|
|
|
|
|
width of the confidence interval. 2nd is the reference to an array |
18
|
|
|
|
|
|
|
including the values. |
19
|
|
|
|
|
|
|
Supported confidence interval width: |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
0.7 (+/- 0.35) ; probability of 0.65 |
22
|
|
|
|
|
|
|
0.6 (+/- 0.30) ; probability of 0.70 |
23
|
|
|
|
|
|
|
0.5 (+/- 0.25) ; probability of 0.75 |
24
|
|
|
|
|
|
|
0.4 (+/- 0.20) ; probability of 0.80 |
25
|
|
|
|
|
|
|
0.3 (+/- 0.15) ; probability of 0.85 |
26
|
|
|
|
|
|
|
0.2 (+/- 0.10) ; probability of 0.90 |
27
|
|
|
|
|
|
|
0.1 (+/- 0.05) ; probability of 0.95 |
28
|
|
|
|
|
|
|
0.05 (+/- 0.025); probability of 0.975 |
29
|
|
|
|
|
|
|
0.02 (+/- 0.01) ; probability of 0.99 |
30
|
|
|
|
|
|
|
0.01 (+/- 0.005); probability of 0.995 |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
EXAMPLE: |
33
|
|
|
|
|
|
|
use ConfInt; |
34
|
|
|
|
|
|
|
@ValueArray = (1,1,1,1,1,2,3,2,1,1,1,1,2,1); |
35
|
|
|
|
|
|
|
$ReturnValue = &ConfInt::ConfInt(0.05,\@ValueArray); |
36
|
|
|
|
|
|
|
print "$ReturnValue"; |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
=head1 EXPORT |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
Returns the relative error of a summary of values. |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=head1 AUTHOR |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
written by Christian Gernhardt |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
=head1 COPYRIGHT |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
Copyright (C) 2001 IBM Deutschland Entwicklung GmbH, IBM Corporation |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
=head1 SEE ALSO |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
perl(1). |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=cut |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
require Exporter; |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
our @ISA = qw(Exporter); |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
our %EXPORT_TAGS = ( 'all' => [ qw( |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
) ] ); |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } ); |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
our @EXPORT = qw( |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
); |
70
|
|
|
|
|
|
|
our $VERSION = '1.0.1'; |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
# ########################### |
73
|
|
|
|
|
|
|
# ## Begin of ConfInt Code ## |
74
|
|
|
|
|
|
|
# ########################### |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
sub ConfInt { |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
# |
79
|
|
|
|
|
|
|
# Measurement value-array |
80
|
|
|
|
|
|
|
# |
81
|
1
|
|
|
1
|
0
|
40
|
$MEAS_VALUES_REF = $_[1]; |
82
|
1
|
|
|
|
|
3
|
@MEAS_VALUES = @$MEAS_VALUES_REF; |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
# |
85
|
|
|
|
|
|
|
# number of measurement values |
86
|
|
|
|
|
|
|
# |
87
|
1
|
|
|
|
|
2
|
$NUM_MEAS_VALUES = 0; |
88
|
|
|
|
|
|
|
|
89
|
1
|
|
|
|
|
3
|
foreach(@MEAS_VALUES) { |
90
|
14
|
|
|
|
|
14
|
$NUM_MEAS_VALUES++; |
91
|
|
|
|
|
|
|
} |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
# |
94
|
|
|
|
|
|
|
# selection of t-distribution array |
95
|
|
|
|
|
|
|
# |
96
|
1
|
50
|
|
|
|
19
|
if($_[0] == 0.7) { |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
# |
99
|
|
|
|
|
|
|
# probability 0.65 (intervalsize: 0.7; +/- 0.35); degree of freedom 1...25 |
100
|
|
|
|
|
|
|
# |
101
|
0
|
|
|
|
|
0
|
@TDISTRIB_07 = (0.510, 0.445, 0.424, 0.414, 0.408, 0.404, 0.402, 0.399, 0.398, 0.397, 0.396, 0.395, 0.394, 0.393, 0.393, 0.392, 0.392, 0.392, 0.391, 0.391, 0.391, 0.390, 0.390, 0.390, 0.390); |
102
|
|
|
|
|
|
|
|
103
|
0
|
|
|
|
|
0
|
for($k=0;$k<$NUM_MEAS_VALUES;$k++) { |
104
|
0
|
0
|
|
|
|
0
|
if($k < 25) { |
105
|
0
|
|
|
|
|
0
|
$TDISTRIB[$k] = $TDISTRIB_07[$k]; |
106
|
|
|
|
|
|
|
} |
107
|
0
|
0
|
|
|
|
0
|
if($k >= 25) { |
108
|
0
|
0
|
0
|
|
|
0
|
if($k < 30 && $k >= 25) { $TDISTRIB[$k] = 0.389; } |
|
0
|
|
|
|
|
0
|
|
109
|
0
|
0
|
0
|
|
|
0
|
if($k < 40 && $k >= 30) { $TDISTRIB[$k] = 0.388; } |
|
0
|
|
|
|
|
0
|
|
110
|
0
|
0
|
0
|
|
|
0
|
if($k < 50 && $k >= 40) { $TDISTRIB[$k] = 0.388; } |
|
0
|
|
|
|
|
0
|
|
111
|
0
|
0
|
0
|
|
|
0
|
if($k < 60 && $k >= 50) { $TDISTRIB[$k] = 0.387; } |
|
0
|
|
|
|
|
0
|
|
112
|
0
|
0
|
0
|
|
|
0
|
if($k < 70 && $k >= 60) { $TDISTRIB[$k] = 0.387; } |
|
0
|
|
|
|
|
0
|
|
113
|
0
|
0
|
0
|
|
|
0
|
if($k < 80 && $k >= 70) { $TDISTRIB[$k] = 0.387; } |
|
0
|
|
|
|
|
0
|
|
114
|
0
|
0
|
0
|
|
|
0
|
if($k < 90 && $k >= 80) { $TDISTRIB[$k] = 0.387; } |
|
0
|
|
|
|
|
0
|
|
115
|
0
|
0
|
0
|
|
|
0
|
if($k < 100 && $k >= 90) { $TDISTRIB[$k] = 0.386; } |
|
0
|
|
|
|
|
0
|
|
116
|
0
|
0
|
0
|
|
|
0
|
if($k < 150 && $k >= 100) { $TDISTRIB[$k] = 0.386; } |
|
0
|
|
|
|
|
0
|
|
117
|
0
|
0
|
0
|
|
|
0
|
if($k < 200 && $k >= 150) { $TDISTRIB[$k] = 0.386; } |
|
0
|
|
|
|
|
0
|
|
118
|
0
|
0
|
0
|
|
|
0
|
if($k < 500 && $k >= 200) { $TDISTRIB[$k] = 0.386; } |
|
0
|
|
|
|
|
0
|
|
119
|
0
|
0
|
0
|
|
|
0
|
if($k < 1000 && $k >= 500){ $TDISTRIB[$k] = 0.385; } |
|
0
|
|
|
|
|
0
|
|
120
|
0
|
0
|
|
|
|
0
|
if($k >= 1000) { $TDISTRIB[$k] = 0.384; } |
|
0
|
|
|
|
|
0
|
|
121
|
|
|
|
|
|
|
} |
122
|
|
|
|
|
|
|
} |
123
|
|
|
|
|
|
|
} |
124
|
|
|
|
|
|
|
|
125
|
|
|
|
|
|
|
elsif($_[0] == 0.6) { |
126
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
# |
128
|
|
|
|
|
|
|
# probability 0.7 (intervalsize: 0.6; +/- 0.3); degree of freedom 1...25 |
129
|
|
|
|
|
|
|
# |
130
|
0
|
|
|
|
|
0
|
@TDISTRIB_06 = (0.727, 0.617, 0.584, 0.569, 0.559, 0.553, 0.549, 0.546, 0.543, 0.542, 0.540, 0.539, 0.538, 0.537, 0.536, 0.535, 0.534, 0.534, 0.533, 0.533, 0.532, 0.532, 0.532, 0.531, 0.531); |
131
|
|
|
|
|
|
|
|
132
|
0
|
|
|
|
|
0
|
for($k=0;$k<$NUM_MEAS_VALUES;$k++) { |
133
|
0
|
0
|
|
|
|
0
|
if($k < 25) { |
134
|
0
|
|
|
|
|
0
|
$TDISTRIB[$k] = $TDISTRIB_06[$k]; |
135
|
|
|
|
|
|
|
} |
136
|
0
|
0
|
|
|
|
0
|
if($k >= 25) { |
137
|
0
|
0
|
0
|
|
|
0
|
if($k < 30 && $k >= 25) { $TDISTRIB[$k] = 0.530; } |
|
0
|
|
|
|
|
0
|
|
138
|
0
|
0
|
0
|
|
|
0
|
if($k < 40 && $k >= 30) { $TDISTRIB[$k] = 0.529; } |
|
0
|
|
|
|
|
0
|
|
139
|
0
|
0
|
0
|
|
|
0
|
if($k < 50 && $k >= 40) { $TDISTRIB[$k] = 0.528; } |
|
0
|
|
|
|
|
0
|
|
140
|
0
|
0
|
0
|
|
|
0
|
if($k < 60 && $k >= 50) { $TDISTRIB[$k] = 0.527; } |
|
0
|
|
|
|
|
0
|
|
141
|
0
|
0
|
0
|
|
|
0
|
if($k < 70 && $k >= 60) { $TDISTRIB[$k] = 0.527; } |
|
0
|
|
|
|
|
0
|
|
142
|
0
|
0
|
0
|
|
|
0
|
if($k < 80 && $k >= 70) { $TDISTRIB[$k] = 0.526; } |
|
0
|
|
|
|
|
0
|
|
143
|
0
|
0
|
0
|
|
|
0
|
if($k < 90 && $k >= 80) { $TDISTRIB[$k] = 0.526; } |
|
0
|
|
|
|
|
0
|
|
144
|
0
|
0
|
0
|
|
|
0
|
if($k < 100 && $k >= 90) { $TDISTRIB[$k] = 0.526; } |
|
0
|
|
|
|
|
0
|
|
145
|
0
|
0
|
0
|
|
|
0
|
if($k < 150 && $k >= 100) { $TDISTRIB[$k] = 0.526; } |
|
0
|
|
|
|
|
0
|
|
146
|
0
|
0
|
0
|
|
|
0
|
if($k < 200 && $k >= 150) { $TDISTRIB[$k] = 0.525; } |
|
0
|
|
|
|
|
0
|
|
147
|
0
|
0
|
0
|
|
|
0
|
if($k < 500 && $k >= 200) { $TDISTRIB[$k] = 0.525; } |
|
0
|
|
|
|
|
0
|
|
148
|
0
|
0
|
0
|
|
|
0
|
if($k < 1000 && $k >= 500){ $TDISTRIB[$k] = 0.525; } |
|
0
|
|
|
|
|
0
|
|
149
|
0
|
0
|
|
|
|
0
|
if($k >= 1000) { $TDISTRIB[$k] = 0.524; } |
|
0
|
|
|
|
|
0
|
|
150
|
|
|
|
|
|
|
} |
151
|
|
|
|
|
|
|
} |
152
|
|
|
|
|
|
|
} |
153
|
|
|
|
|
|
|
|
154
|
|
|
|
|
|
|
elsif($_[0] == 0.5) { |
155
|
|
|
|
|
|
|
|
156
|
|
|
|
|
|
|
# |
157
|
|
|
|
|
|
|
# probability 0.75 (intervalsize: 0.5; +/- 0.25); degree of freedom 1...25 |
158
|
|
|
|
|
|
|
# |
159
|
0
|
|
|
|
|
0
|
@TDISTRIB_05 = (1.000, 0.816, 0.765, 0.741, 0.727, 0.718, 0.711, 0.706, 0.703, 0.700, 0.697, 0.695, 0.694, 0.692, 0.691, 0.690, 0.689, 0.688, 0.688, 0.687, 0.686, 0.686, 0.685, 0.685, 0.684); |
160
|
|
|
|
|
|
|
|
161
|
0
|
|
|
|
|
0
|
for($k=0;$k<$NUM_MEAS_VALUES;$k++) { |
162
|
0
|
0
|
|
|
|
0
|
if($k < 25) { |
163
|
0
|
|
|
|
|
0
|
$TDISTRIB[$k] = $TDISTRIB_05[$k]; |
164
|
|
|
|
|
|
|
} |
165
|
0
|
0
|
|
|
|
0
|
if($k >= 25) { |
166
|
0
|
0
|
0
|
|
|
0
|
if($k < 30 && $k >= 25) { $TDISTRIB[$k] = 0.683; } |
|
0
|
|
|
|
|
0
|
|
167
|
0
|
0
|
0
|
|
|
0
|
if($k < 40 && $k >= 30) { $TDISTRIB[$k] = 0.681; } |
|
0
|
|
|
|
|
0
|
|
168
|
0
|
0
|
0
|
|
|
0
|
if($k < 50 && $k >= 40) { $TDISTRIB[$k] = 0.679; } |
|
0
|
|
|
|
|
0
|
|
169
|
0
|
0
|
0
|
|
|
0
|
if($k < 60 && $k >= 50) { $TDISTRIB[$k] = 0.679; } |
|
0
|
|
|
|
|
0
|
|
170
|
0
|
0
|
0
|
|
|
0
|
if($k < 70 && $k >= 60) { $TDISTRIB[$k] = 0.678; } |
|
0
|
|
|
|
|
0
|
|
171
|
0
|
0
|
0
|
|
|
0
|
if($k < 80 && $k >= 70) { $TDISTRIB[$k] = 0.678; } |
|
0
|
|
|
|
|
0
|
|
172
|
0
|
0
|
0
|
|
|
0
|
if($k < 90 && $k >= 80) { $TDISTRIB[$k] = 0.677; } |
|
0
|
|
|
|
|
0
|
|
173
|
0
|
0
|
0
|
|
|
0
|
if($k < 100 && $k >= 90) { $TDISTRIB[$k] = 0.677; } |
|
0
|
|
|
|
|
0
|
|
174
|
0
|
0
|
0
|
|
|
0
|
if($k < 150 && $k >= 100) { $TDISTRIB[$k] = 0.676; } |
|
0
|
|
|
|
|
0
|
|
175
|
0
|
0
|
0
|
|
|
0
|
if($k < 200 && $k >= 150) { $TDISTRIB[$k] = 0.676; } |
|
0
|
|
|
|
|
0
|
|
176
|
0
|
0
|
0
|
|
|
0
|
if($k < 500 && $k >= 200) { $TDISTRIB[$k] = 0.675; } |
|
0
|
|
|
|
|
0
|
|
177
|
0
|
0
|
0
|
|
|
0
|
if($k < 1000 && $k >= 500){ $TDISTRIB[$k] = 0.675; } |
|
0
|
|
|
|
|
0
|
|
178
|
0
|
0
|
|
|
|
0
|
if($k >= 1000) { $TDISTRIB[$k] = 0.674; } |
|
0
|
|
|
|
|
0
|
|
179
|
|
|
|
|
|
|
} |
180
|
|
|
|
|
|
|
} |
181
|
|
|
|
|
|
|
} |
182
|
|
|
|
|
|
|
|
183
|
|
|
|
|
|
|
elsif($_[0] == 0.4) { |
184
|
|
|
|
|
|
|
|
185
|
|
|
|
|
|
|
# |
186
|
|
|
|
|
|
|
# probability 0.8 (intervalsize: 0.4; +/- 0.2); degree of freedom 1...25 |
187
|
|
|
|
|
|
|
# |
188
|
0
|
|
|
|
|
0
|
@TDISTRIB_04 = (1.376, 1.061, 0.978, 0.941, 0.920, 0.906, 0.896, 0.889, 0.883, 0.879, 0.876, 0.873, 0.870, 0.868, 0.866, 0.865, 0.863, 0.862, 0.861, 0.860, 0.859, 0.858, 0.858, 0.857, 0.856); |
189
|
|
|
|
|
|
|
|
190
|
0
|
|
|
|
|
0
|
for($k=0;$k<$NUM_MEAS_VALUES;$k++) { |
191
|
0
|
0
|
|
|
|
0
|
if($k < 25) { |
192
|
0
|
|
|
|
|
0
|
$TDISTRIB[$k] = $TDISTRIB_04[$k]; |
193
|
|
|
|
|
|
|
} |
194
|
0
|
0
|
|
|
|
0
|
if($k >= 25) { |
195
|
0
|
0
|
0
|
|
|
0
|
if($k < 30 && $k >= 25) { $TDISTRIB[$k] = 0.854; } |
|
0
|
|
|
|
|
0
|
|
196
|
0
|
0
|
0
|
|
|
0
|
if($k < 40 && $k >= 30) { $TDISTRIB[$k] = 0.851; } |
|
0
|
|
|
|
|
0
|
|
197
|
0
|
0
|
0
|
|
|
0
|
if($k < 50 && $k >= 40) { $TDISTRIB[$k] = 0.849; } |
|
0
|
|
|
|
|
0
|
|
198
|
0
|
0
|
0
|
|
|
0
|
if($k < 60 && $k >= 50) { $TDISTRIB[$k] = 0.848; } |
|
0
|
|
|
|
|
0
|
|
199
|
0
|
0
|
0
|
|
|
0
|
if($k < 70 && $k >= 60) { $TDISTRIB[$k] = 0.847; } |
|
0
|
|
|
|
|
0
|
|
200
|
0
|
0
|
0
|
|
|
0
|
if($k < 80 && $k >= 70) { $TDISTRIB[$k] = 0.846; } |
|
0
|
|
|
|
|
0
|
|
201
|
0
|
0
|
0
|
|
|
0
|
if($k < 90 && $k >= 80) { $TDISTRIB[$k] = 0.846; } |
|
0
|
|
|
|
|
0
|
|
202
|
0
|
0
|
0
|
|
|
0
|
if($k < 100 && $k >= 90) { $TDISTRIB[$k] = 0.845; } |
|
0
|
|
|
|
|
0
|
|
203
|
0
|
0
|
0
|
|
|
0
|
if($k < 150 && $k >= 100) { $TDISTRIB[$k] = 0.844; } |
|
0
|
|
|
|
|
0
|
|
204
|
0
|
0
|
0
|
|
|
0
|
if($k < 200 && $k >= 150) { $TDISTRIB[$k] = 0.843; } |
|
0
|
|
|
|
|
0
|
|
205
|
0
|
0
|
0
|
|
|
0
|
if($k < 500 && $k >= 200) { $TDISTRIB[$k] = 0.842; } |
|
0
|
|
|
|
|
0
|
|
206
|
0
|
0
|
0
|
|
|
0
|
if($k < 1000 && $k >= 500){ $TDISTRIB[$k] = 0.842; } |
|
0
|
|
|
|
|
0
|
|
207
|
0
|
0
|
|
|
|
0
|
if($k >= 1000) { $TDISTRIB[$k] = 0.841; } |
|
0
|
|
|
|
|
0
|
|
208
|
|
|
|
|
|
|
} |
209
|
|
|
|
|
|
|
} |
210
|
|
|
|
|
|
|
} |
211
|
|
|
|
|
|
|
|
212
|
|
|
|
|
|
|
elsif($_[0] == 0.3) { |
213
|
|
|
|
|
|
|
|
214
|
|
|
|
|
|
|
# |
215
|
|
|
|
|
|
|
# probability 0.85 (intervalsize: 0.3; +/- 0.15); degree of freedom 1...25 |
216
|
|
|
|
|
|
|
# |
217
|
0
|
|
|
|
|
0
|
@TDISTRIB_03 = (1.963, 1.386, 1.250, 1.190, 1.156, 1.134, 1.119, 1.108, 1.100, 1.093, 1.088, 1.083, 1.079, 1.076, 1.074, 1.071, 1.069, 1.067, 1.066, 1.064, 1.063, 1.061, 1.060, 1.059, 1.058); |
218
|
|
|
|
|
|
|
|
219
|
0
|
|
|
|
|
0
|
for($k=0;$k<$NUM_MEAS_VALUES;$k++) { |
220
|
0
|
0
|
|
|
|
0
|
if($k < 25) { |
221
|
0
|
|
|
|
|
0
|
$TDISTRIB[$k] = $TDISTRIB_03[$k]; |
222
|
|
|
|
|
|
|
} |
223
|
0
|
0
|
|
|
|
0
|
if($k >= 25) { |
224
|
0
|
0
|
0
|
|
|
0
|
if($k < 30 && $k >= 25) { $TDISTRIB[$k] = 1.055; } |
|
0
|
|
|
|
|
0
|
|
225
|
0
|
0
|
0
|
|
|
0
|
if($k < 40 && $k >= 30) { $TDISTRIB[$k] = 1.050; } |
|
0
|
|
|
|
|
0
|
|
226
|
0
|
0
|
0
|
|
|
0
|
if($k < 50 && $k >= 40) { $TDISTRIB[$k] = 1.047; } |
|
0
|
|
|
|
|
0
|
|
227
|
0
|
0
|
0
|
|
|
0
|
if($k < 60 && $k >= 50) { $TDISTRIB[$k] = 1.045; } |
|
0
|
|
|
|
|
0
|
|
228
|
0
|
0
|
0
|
|
|
0
|
if($k < 70 && $k >= 60) { $TDISTRIB[$k] = 1.044; } |
|
0
|
|
|
|
|
0
|
|
229
|
0
|
0
|
0
|
|
|
0
|
if($k < 80 && $k >= 70) { $TDISTRIB[$k] = 1.043; } |
|
0
|
|
|
|
|
0
|
|
230
|
0
|
0
|
0
|
|
|
0
|
if($k < 90 && $k >= 80) { $TDISTRIB[$k] = 1.042; } |
|
0
|
|
|
|
|
0
|
|
231
|
0
|
0
|
0
|
|
|
0
|
if($k < 100 && $k >= 90) { $TDISTRIB[$k] = 1.042; } |
|
0
|
|
|
|
|
0
|
|
232
|
0
|
0
|
0
|
|
|
0
|
if($k < 150 && $k >= 100) { $TDISTRIB[$k] = 1.040; } |
|
0
|
|
|
|
|
0
|
|
233
|
0
|
0
|
0
|
|
|
0
|
if($k < 200 && $k >= 150) { $TDISTRIB[$k] = 1.039; } |
|
0
|
|
|
|
|
0
|
|
234
|
0
|
0
|
0
|
|
|
0
|
if($k < 500 && $k >= 200) { $TDISTRIB[$k] = 1.038; } |
|
0
|
|
|
|
|
0
|
|
235
|
0
|
0
|
0
|
|
|
0
|
if($k < 1000 && $k >= 500){ $TDISTRIB[$k] = 1.037; } |
|
0
|
|
|
|
|
0
|
|
236
|
0
|
0
|
|
|
|
0
|
if($k >= 1000) { $TDISTRIB[$k] = 1.036; } |
|
0
|
|
|
|
|
0
|
|
237
|
|
|
|
|
|
|
} |
238
|
|
|
|
|
|
|
} |
239
|
|
|
|
|
|
|
} |
240
|
|
|
|
|
|
|
|
241
|
|
|
|
|
|
|
elsif($_[0] == 0.2) { |
242
|
|
|
|
|
|
|
|
243
|
|
|
|
|
|
|
# |
244
|
|
|
|
|
|
|
# probability 0.9 (intervalsize: 0.2; +/- 0.1); degree of freedom 1...25 |
245
|
|
|
|
|
|
|
# |
246
|
0
|
|
|
|
|
0
|
@TDISTRIB_02 = (3.078, 1.886, 1.638, 1.533, 1.476, 1.440, 1.415, 1.397, 1.383, 1.372, 1.363, 1.356, 1.350, 1.345, 1.341, 1.337, 1.333, 1.330, 1.328, 1.325, 1.323, 1.321, 1.319, 1.318, 1.316); |
247
|
|
|
|
|
|
|
|
248
|
0
|
|
|
|
|
0
|
for($k=0;$k<$NUM_MEAS_VALUES;$k++) { |
249
|
0
|
0
|
|
|
|
0
|
if($k < 25) { |
250
|
0
|
|
|
|
|
0
|
$TDISTRIB[$k] = $TDISTRIB_02[$k]; |
251
|
|
|
|
|
|
|
} |
252
|
0
|
0
|
|
|
|
0
|
if($k >= 25) { |
253
|
0
|
0
|
0
|
|
|
0
|
if($k < 30 && $k >= 25) { $TDISTRIB[$k] = 1.310; } |
|
0
|
|
|
|
|
0
|
|
254
|
0
|
0
|
0
|
|
|
0
|
if($k < 40 && $k >= 30) { $TDISTRIB[$k] = 1.303; } |
|
0
|
|
|
|
|
0
|
|
255
|
0
|
0
|
0
|
|
|
0
|
if($k < 50 && $k >= 40) { $TDISTRIB[$k] = 1.299; } |
|
0
|
|
|
|
|
0
|
|
256
|
0
|
0
|
0
|
|
|
0
|
if($k < 60 && $k >= 50) { $TDISTRIB[$k] = 1.296; } |
|
0
|
|
|
|
|
0
|
|
257
|
0
|
0
|
0
|
|
|
0
|
if($k < 70 && $k >= 60) { $TDISTRIB[$k] = 1.294; } |
|
0
|
|
|
|
|
0
|
|
258
|
0
|
0
|
0
|
|
|
0
|
if($k < 80 && $k >= 70) { $TDISTRIB[$k] = 1.292; } |
|
0
|
|
|
|
|
0
|
|
259
|
0
|
0
|
0
|
|
|
0
|
if($k < 90 && $k >= 80) { $TDISTRIB[$k] = 1.291; } |
|
0
|
|
|
|
|
0
|
|
260
|
0
|
0
|
0
|
|
|
0
|
if($k < 100 && $k >= 90) { $TDISTRIB[$k] = 1.290; } |
|
0
|
|
|
|
|
0
|
|
261
|
0
|
0
|
0
|
|
|
0
|
if($k < 150 && $k >= 100) { $TDISTRIB[$k] = 1.287; } |
|
0
|
|
|
|
|
0
|
|
262
|
0
|
0
|
0
|
|
|
0
|
if($k < 200 && $k >= 150) { $TDISTRIB[$k] = 1.286; } |
|
0
|
|
|
|
|
0
|
|
263
|
0
|
0
|
0
|
|
|
0
|
if($k < 500 && $k >= 200) { $TDISTRIB[$k] = 1.283; } |
|
0
|
|
|
|
|
0
|
|
264
|
0
|
0
|
0
|
|
|
0
|
if($k < 1000 && $k >= 500){ $TDISTRIB[$k] = 1.282; } |
|
0
|
|
|
|
|
0
|
|
265
|
0
|
0
|
|
|
|
0
|
if($k >= 1000) { $TDISTRIB[$k] = 1.281; } |
|
0
|
|
|
|
|
0
|
|
266
|
|
|
|
|
|
|
} |
267
|
|
|
|
|
|
|
} |
268
|
|
|
|
|
|
|
} |
269
|
|
|
|
|
|
|
|
270
|
|
|
|
|
|
|
elsif($_[0] == 0.1) { |
271
|
|
|
|
|
|
|
|
272
|
|
|
|
|
|
|
# |
273
|
|
|
|
|
|
|
# probability 0.95 (intervalsize: 0.1; +/- 0.05); degree of freedom 1...25 |
274
|
|
|
|
|
|
|
# |
275
|
0
|
|
|
|
|
0
|
@TDISTRIB_01 = (6.314, 2.92, 2.353, 2.132, 2.015, 1.943, 1.895, 1.860, 1.833, 1.812, 1.796, 1.782, 1.771, 1.761, 1.753, 1.746, 1.740, 1.734, 1.729, 1.725, 1.721, 1.717, 1.714, 1.711, 1.708); |
276
|
|
|
|
|
|
|
|
277
|
0
|
|
|
|
|
0
|
for($k=0;$k<$NUM_MEAS_VALUES;$k++) { |
278
|
0
|
0
|
|
|
|
0
|
if($k < 25) { |
279
|
0
|
|
|
|
|
0
|
$TDISTRIB[$k] = $TDISTRIB_01[$k]; |
280
|
|
|
|
|
|
|
} |
281
|
0
|
0
|
|
|
|
0
|
if($k >= 25) { |
282
|
0
|
0
|
0
|
|
|
0
|
if($k < 30 && $k >= 25) { $TDISTRIB[$k] = 1.697; } |
|
0
|
|
|
|
|
0
|
|
283
|
0
|
0
|
0
|
|
|
0
|
if($k < 40 && $k >= 30) { $TDISTRIB[$k] = 1.684; } |
|
0
|
|
|
|
|
0
|
|
284
|
0
|
0
|
0
|
|
|
0
|
if($k < 50 && $k >= 40) { $TDISTRIB[$k] = 1.676; } |
|
0
|
|
|
|
|
0
|
|
285
|
0
|
0
|
0
|
|
|
0
|
if($k < 60 && $k >= 50) { $TDISTRIB[$k] = 1.671; } |
|
0
|
|
|
|
|
0
|
|
286
|
0
|
0
|
0
|
|
|
0
|
if($k < 70 && $k >= 60) { $TDISTRIB[$k] = 1.667; } |
|
0
|
|
|
|
|
0
|
|
287
|
0
|
0
|
0
|
|
|
0
|
if($k < 80 && $k >= 70) { $TDISTRIB[$k] = 1.664; } |
|
0
|
|
|
|
|
0
|
|
288
|
0
|
0
|
0
|
|
|
0
|
if($k < 90 && $k >= 80) { $TDISTRIB[$k] = 1.662; } |
|
0
|
|
|
|
|
0
|
|
289
|
0
|
0
|
0
|
|
|
0
|
if($k < 100 && $k >= 90) { $TDISTRIB[$k] = 1.660; } |
|
0
|
|
|
|
|
0
|
|
290
|
0
|
0
|
0
|
|
|
0
|
if($k < 150 && $k >= 100) { $TDISTRIB[$k] = 1.655; } |
|
0
|
|
|
|
|
0
|
|
291
|
0
|
0
|
0
|
|
|
0
|
if($k < 200 && $k >= 150) { $TDISTRIB[$k] = 1.653; } |
|
0
|
|
|
|
|
0
|
|
292
|
0
|
0
|
0
|
|
|
0
|
if($k < 500 && $k >= 200) { $TDISTRIB[$k] = 1.648; } |
|
0
|
|
|
|
|
0
|
|
293
|
0
|
0
|
0
|
|
|
0
|
if($k < 1000 && $k >= 500){ $TDISTRIB[$k] = 1.646; } |
|
0
|
|
|
|
|
0
|
|
294
|
0
|
0
|
|
|
|
0
|
if($k >= 1000) { $TDISTRIB[$k] = 1.644; } |
|
0
|
|
|
|
|
0
|
|
295
|
|
|
|
|
|
|
} |
296
|
|
|
|
|
|
|
} |
297
|
|
|
|
|
|
|
} |
298
|
|
|
|
|
|
|
|
299
|
|
|
|
|
|
|
elsif($_[0] == 0.05) { |
300
|
|
|
|
|
|
|
|
301
|
|
|
|
|
|
|
# |
302
|
|
|
|
|
|
|
# probability 0.975 (intervalsize: 0.05; +/- 0.025); degree of freedom 1...25 |
303
|
|
|
|
|
|
|
# |
304
|
1
|
|
|
|
|
8
|
@TDISTRIB_005 = (12.706, 4.303, 3.182, 2.776, 2.571, 2.447, 2.365, 2.306, 2.262, 2.228, 2.201, 2.179, 2.160, 2.145, 2.131, 2.120, 2.110, 2.101, 2.093, 2.086, 2.080, 2.074, 2.069, 2.064, 2.060); |
305
|
|
|
|
|
|
|
|
306
|
1
|
|
|
|
|
5
|
for($k=0;$k<$NUM_MEAS_VALUES;$k++) { |
307
|
14
|
50
|
|
|
|
22
|
if($k < 25) { |
308
|
14
|
|
|
|
|
19
|
$TDISTRIB[$k] = $TDISTRIB_005[$k]; |
309
|
|
|
|
|
|
|
} |
310
|
14
|
50
|
|
|
|
30
|
if($k >= 25) { |
311
|
0
|
0
|
0
|
|
|
0
|
if($k < 30 && $k >= 25) { $TDISTRIB[$k] = 2.042; } |
|
0
|
|
|
|
|
0
|
|
312
|
0
|
0
|
0
|
|
|
0
|
if($k < 40 && $k >= 30) { $TDISTRIB[$k] = 2.021; } |
|
0
|
|
|
|
|
0
|
|
313
|
0
|
0
|
0
|
|
|
0
|
if($k < 50 && $k >= 40) { $TDISTRIB[$k] = 2.009; } |
|
0
|
|
|
|
|
0
|
|
314
|
0
|
0
|
0
|
|
|
0
|
if($k < 60 && $k >= 50) { $TDISTRIB[$k] = 2.000; } |
|
0
|
|
|
|
|
0
|
|
315
|
0
|
0
|
0
|
|
|
0
|
if($k < 70 && $k >= 60) { $TDISTRIB[$k] = 1.994; } |
|
0
|
|
|
|
|
0
|
|
316
|
0
|
0
|
0
|
|
|
0
|
if($k < 80 && $k >= 70) { $TDISTRIB[$k] = 1.990; } |
|
0
|
|
|
|
|
0
|
|
317
|
0
|
0
|
0
|
|
|
0
|
if($k < 90 && $k >= 80) { $TDISTRIB[$k] = 1.987; } |
|
0
|
|
|
|
|
0
|
|
318
|
0
|
0
|
0
|
|
|
0
|
if($k < 100 && $k >= 90) { $TDISTRIB[$k] = 1.984; } |
|
0
|
|
|
|
|
0
|
|
319
|
0
|
0
|
0
|
|
|
0
|
if($k < 150 && $k >= 100) { $TDISTRIB[$k] = 1.976; } |
|
0
|
|
|
|
|
0
|
|
320
|
0
|
0
|
0
|
|
|
0
|
if($k < 200 && $k >= 150) { $TDISTRIB[$k] = 1.972; } |
|
0
|
|
|
|
|
0
|
|
321
|
0
|
0
|
0
|
|
|
0
|
if($k < 500 && $k >= 200) { $TDISTRIB[$k] = 1.965; } |
|
0
|
|
|
|
|
0
|
|
322
|
0
|
0
|
0
|
|
|
0
|
if($k < 1000 && $k >= 500){ $TDISTRIB[$k] = 1.962; } |
|
0
|
|
|
|
|
0
|
|
323
|
0
|
0
|
|
|
|
0
|
if($k >= 1000) { $TDISTRIB[$k] = 1.960; } |
|
0
|
|
|
|
|
0
|
|
324
|
|
|
|
|
|
|
} |
325
|
|
|
|
|
|
|
} |
326
|
|
|
|
|
|
|
} |
327
|
|
|
|
|
|
|
|
328
|
|
|
|
|
|
|
elsif($_[0] == 0.02) { |
329
|
|
|
|
|
|
|
|
330
|
|
|
|
|
|
|
# |
331
|
|
|
|
|
|
|
# probability 0.99 (intervalsize: 0.02; +/- 0.01); degree of freedom 1...25 |
332
|
|
|
|
|
|
|
# |
333
|
0
|
|
|
|
|
0
|
@TDISTRIB_002 = (31.821, 6.965, 4.541, 3.747, 3.365, 3.143, 2.998, 2.896, 2.821, 2.764, 2.718, 2.681, 2.650, 2.624, 2.602, 2.583, 2.567, 2.552, 2.539, 2.528, 2.518, 2.508, 2.500, 2.492, 2.485); |
334
|
|
|
|
|
|
|
|
335
|
0
|
|
|
|
|
0
|
for($k=0;$k<$NUM_MEAS_VALUES;$k++) { |
336
|
0
|
0
|
|
|
|
0
|
if($k < 25) { |
337
|
0
|
|
|
|
|
0
|
$TDISTRIB[$k] = $TDISTRIB_002[$k]; |
338
|
|
|
|
|
|
|
} |
339
|
0
|
0
|
|
|
|
0
|
if($k >= 25) { |
340
|
0
|
0
|
0
|
|
|
0
|
if($k < 30 && $k >= 25) { $TDISTRIB[$k] = 2.457; } |
|
0
|
|
|
|
|
0
|
|
341
|
0
|
0
|
0
|
|
|
0
|
if($k < 40 && $k >= 30) { $TDISTRIB[$k] = 2.423; } |
|
0
|
|
|
|
|
0
|
|
342
|
0
|
0
|
0
|
|
|
0
|
if($k < 50 && $k >= 40) { $TDISTRIB[$k] = 2.403; } |
|
0
|
|
|
|
|
0
|
|
343
|
0
|
0
|
0
|
|
|
0
|
if($k < 60 && $k >= 50) { $TDISTRIB[$k] = 2.390; } |
|
0
|
|
|
|
|
0
|
|
344
|
0
|
0
|
0
|
|
|
0
|
if($k < 70 && $k >= 60) { $TDISTRIB[$k] = 2.381; } |
|
0
|
|
|
|
|
0
|
|
345
|
0
|
0
|
0
|
|
|
0
|
if($k < 80 && $k >= 70) { $TDISTRIB[$k] = 2.374; } |
|
0
|
|
|
|
|
0
|
|
346
|
0
|
0
|
0
|
|
|
0
|
if($k < 90 && $k >= 80) { $TDISTRIB[$k] = 2.368; } |
|
0
|
|
|
|
|
0
|
|
347
|
0
|
0
|
0
|
|
|
0
|
if($k < 100 && $k >= 90) { $TDISTRIB[$k] = 2.364; } |
|
0
|
|
|
|
|
0
|
|
348
|
0
|
0
|
0
|
|
|
0
|
if($k < 150 && $k >= 100) { $TDISTRIB[$k] = 2.351; } |
|
0
|
|
|
|
|
0
|
|
349
|
0
|
0
|
0
|
|
|
0
|
if($k < 200 && $k >= 150) { $TDISTRIB[$k] = 2.345; } |
|
0
|
|
|
|
|
0
|
|
350
|
0
|
0
|
0
|
|
|
0
|
if($k < 500 && $k >= 200) { $TDISTRIB[$k] = 2.334; } |
|
0
|
|
|
|
|
0
|
|
351
|
0
|
0
|
0
|
|
|
0
|
if($k < 1000 && $k >= 500){ $TDISTRIB[$k] = 2.330; } |
|
0
|
|
|
|
|
0
|
|
352
|
0
|
0
|
|
|
|
0
|
if($k >= 1000) { $TDISTRIB[$k] = 2.328; } |
|
0
|
|
|
|
|
0
|
|
353
|
|
|
|
|
|
|
} |
354
|
|
|
|
|
|
|
} |
355
|
|
|
|
|
|
|
} |
356
|
|
|
|
|
|
|
|
357
|
|
|
|
|
|
|
elsif($_[0] == 0.01) { |
358
|
|
|
|
|
|
|
|
359
|
|
|
|
|
|
|
# |
360
|
|
|
|
|
|
|
# probability 0.995 (intervalsize: 0.01; +/- 0.005); degree of freedom 1...25 |
361
|
|
|
|
|
|
|
# |
362
|
0
|
|
|
|
|
0
|
@TDISTRIB_001 = (63.656, 9.952, 5.841, 4.604, 4.032, 3.707, 3.499, 3.355, 3.250, 3.169, 3.106, 3.055, 3.012, 2.977, 2.947, 2.921, 2.898, 2.878, 2.861, 2.845, 2.831, 2.819, 2.807, 2.797, 2.787); |
363
|
|
|
|
|
|
|
|
364
|
0
|
|
|
|
|
0
|
for($k=0;$k<$NUM_MEAS_VALUES;$k++) { |
365
|
0
|
0
|
|
|
|
0
|
if($k < 25) { |
366
|
0
|
|
|
|
|
0
|
$TDISTRIB[$k] = $TDISTRIB_001[$k]; |
367
|
|
|
|
|
|
|
} |
368
|
0
|
0
|
|
|
|
0
|
if($k >= 25) { |
369
|
0
|
0
|
0
|
|
|
0
|
if($k < 30 && $k >= 25) { $TDISTRIB[$k] = 2.750; } |
|
0
|
|
|
|
|
0
|
|
370
|
0
|
0
|
0
|
|
|
0
|
if($k < 40 && $k >= 30) { $TDISTRIB[$k] = 2.704; } |
|
0
|
|
|
|
|
0
|
|
371
|
0
|
0
|
0
|
|
|
0
|
if($k < 50 && $k >= 40) { $TDISTRIB[$k] = 2.678; } |
|
0
|
|
|
|
|
0
|
|
372
|
0
|
0
|
0
|
|
|
0
|
if($k < 60 && $k >= 50) { $TDISTRIB[$k] = 2.660; } |
|
0
|
|
|
|
|
0
|
|
373
|
0
|
0
|
0
|
|
|
0
|
if($k < 70 && $k >= 60) { $TDISTRIB[$k] = 2.648; } |
|
0
|
|
|
|
|
0
|
|
374
|
0
|
0
|
0
|
|
|
0
|
if($k < 80 && $k >= 70) { $TDISTRIB[$k] = 2.639; } |
|
0
|
|
|
|
|
0
|
|
375
|
0
|
0
|
0
|
|
|
0
|
if($k < 90 && $k >= 80) { $TDISTRIB[$k] = 2.632; } |
|
0
|
|
|
|
|
0
|
|
376
|
0
|
0
|
0
|
|
|
0
|
if($k < 100 && $k >= 90) { $TDISTRIB[$k] = 2.626; } |
|
0
|
|
|
|
|
0
|
|
377
|
0
|
0
|
0
|
|
|
0
|
if($k < 150 && $k >= 100) { $TDISTRIB[$k] = 2.609; } |
|
0
|
|
|
|
|
0
|
|
378
|
0
|
0
|
0
|
|
|
0
|
if($k < 200 && $k >= 150) { $TDISTRIB[$k] = 2.601; } |
|
0
|
|
|
|
|
0
|
|
379
|
0
|
0
|
0
|
|
|
0
|
if($k < 500 && $k >= 200) { $TDISTRIB[$k] = 2.586; } |
|
0
|
|
|
|
|
0
|
|
380
|
0
|
0
|
0
|
|
|
0
|
if($k < 1000 && $k >= 500){ $TDISTRIB[$k] = 2.581; } |
|
0
|
|
|
|
|
0
|
|
381
|
0
|
0
|
|
|
|
0
|
if($k >= 1000) { $TDISTRIB[$k] = 2.578; } |
|
0
|
|
|
|
|
0
|
|
382
|
|
|
|
|
|
|
} |
383
|
|
|
|
|
|
|
} |
384
|
|
|
|
|
|
|
} |
385
|
|
|
|
|
|
|
|
386
|
|
|
|
|
|
|
else { |
387
|
0
|
|
|
|
|
0
|
return -1; |
388
|
|
|
|
|
|
|
} |
389
|
|
|
|
|
|
|
|
390
|
|
|
|
|
|
|
# |
391
|
|
|
|
|
|
|
# calculation of mean value |
392
|
|
|
|
|
|
|
# |
393
|
1
|
|
|
|
|
2
|
$MEAN_VALUE_TMP = 0; |
394
|
1
|
|
|
|
|
3
|
for($i=0;$i<$NUM_MEAS_VALUES;$i++) { |
395
|
14
|
|
|
|
|
22
|
$MEAN_VALUE_TMP = $MEAS_VALUES[$i] + $MEAN_VALUE_TMP; |
396
|
|
|
|
|
|
|
} |
397
|
1
|
|
|
|
|
2
|
$MEAN_VALUE = $MEAN_VALUE_TMP/$NUM_MEAS_VALUES; |
398
|
|
|
|
|
|
|
|
399
|
|
|
|
|
|
|
# |
400
|
|
|
|
|
|
|
# calculation of standard variation |
401
|
|
|
|
|
|
|
# |
402
|
1
|
|
|
|
|
2
|
$STD_VAR_TMP = 0; |
403
|
1
|
|
|
|
|
3
|
for($j=0;$j<$NUM_MEAS_VALUES;$j++) { |
404
|
14
|
|
|
|
|
46
|
$STD_VAR_TMP = ((($MEAS_VALUES[$j] - $MEAN_VALUE)**2)/($NUM_MEAS_VALUES - 1)) + $STD_VAR_TMP; |
405
|
|
|
|
|
|
|
} |
406
|
1
|
|
|
|
|
7
|
$STD_VAR = $STD_VAR_TMP**0.5; |
407
|
|
|
|
|
|
|
|
408
|
|
|
|
|
|
|
# |
409
|
|
|
|
|
|
|
# calculation of confidence intervall |
410
|
|
|
|
|
|
|
# |
411
|
1
|
|
|
|
|
24
|
$CONF_INT = $TDISTRIB[$NUM_MEAS_VALUES - 2] * $STD_VAR / ($NUM_MEAS_VALUES**0.5); |
412
|
|
|
|
|
|
|
|
413
|
|
|
|
|
|
|
# |
414
|
|
|
|
|
|
|
# calculation of relative error |
415
|
|
|
|
|
|
|
# |
416
|
1
|
|
|
|
|
4
|
$REL_ERR = $CONF_INT / $MEAN_VALUE * 100; |
417
|
|
|
|
|
|
|
|
418
|
1
|
|
|
|
|
14
|
return $REL_ERR; |
419
|
|
|
|
|
|
|
} |
420
|
|
|
|
|
|
|
|
421
|
|
|
|
|
|
|
# ######################### |
422
|
|
|
|
|
|
|
# ## End of ConfInt Code ## |
423
|
|
|
|
|
|
|
# ######################### |
424
|
|
|
|
|
|
|
|
425
|
|
|
|
|
|
|
1; |
426
|
|
|
|
|
|
|
__END__ |