520 likes | 612 Views
Errors in Experimental Measurements. Sources of errors Accuracy, precision, resolution A mathematical model of errors Confidence intervals For means For proportions How many measurements are needed for desired error?. Why do we need statistics?. 1. Noise, noise, noise, noise, noise!.
E N D
Errors in Experimental Measurements • Sources of errors • Accuracy, precision, resolution • A mathematical model of errors • Confidence intervals • For means • For proportions • How many measurements are needed for desired error? Copyright 2004 David J. Lilja
Why do we need statistics? 1. Noise, noise, noise, noise, noise! OK – not really this type of noise Copyright 2004 David J. Lilja
Why do we need statistics? 2. Aggregate data into meaningful information. 445 446 397 226 388 3445 188 1002 47762 432 54 12 98 345 2245 8839 77492 472 565 999 1 34 882 545 4022 827 572 597 364 Copyright 2004 David J. Lilja
What is a statistic? • “A quantity that is computed from a sample [of data].” Merriam-Webster → A single number used to summarize a larger collection of values. Copyright 2004 David J. Lilja
What are statistics? • “A branch of mathematics dealing with the collection, analysis, interpretation, and presentation of masses of numerical data.” Merriam-Webster → We are most interested in analysis and interpretation here. • “Lies, damn lies, and statistics!” Copyright 2004 David J. Lilja
Goals • Provide intuitive conceptual background for some standard statistical tools. • Draw meaningful conclusions in presence of noisy measurements. • Allow you to correctly and intelligently apply techniques in new situations. → Don’t simply plug and crank from a formula. Copyright 2004 David J. Lilja
Goals • Present techniques for aggregating large quantities of data. • Obtain a big-picture view of your results. • Obtain new insights from complex measurement and simulation results. → E.g. How does a new feature impact the overall system? Copyright 2004 David J. Lilja
Sources of Experimental Errors • Accuracy, precision, resolution Copyright 2004 David J. Lilja
Experimental errors • Errors → noise in measured values • Systematic errors • Result of an experimental “mistake” • Typically produce constant or slowly varying bias • Controlled through skill of experimenter • Examples • Temperature change causes clock drift • Forget to clear cache before timing run Copyright 2004 David J. Lilja
Experimental errors • Random errors • Unpredictable, non-deterministic • Unbiased → equal probability of increasing or decreasing measured value • Result of • Limitations of measuring tool • Observer reading output of tool • Random processes within system • Typically cannot be controlled • Use statistical tools to characterize and quantify Copyright 2004 David J. Lilja
Example: Quantization→ Random error Copyright 2004 David J. Lilja
Quantization error • Timer resolution → quantization error • Repeated measurements X ± Δ Completely unpredictable Copyright 2004 David J. Lilja
A Model of Errors Copyright 2004 David J. Lilja
A Model of Errors Copyright 2004 David J. Lilja
A Model of Errors Copyright 2004 David J. Lilja
Probability of Obtaining a Specific Measured Value Copyright 2004 David J. Lilja
A Model of Errors • Pr(X=xi) = Pr(measure xi) = number of paths from real value to xi • Pr(X=xi) ~ binomial distribution • As number of error sources becomes large • n → ∞, • Binomial → Gaussian (Normal) • Thus, the bell curve Copyright 2004 David J. Lilja
Frequency of Measuring Specific Values Accuracy Precision Mean of measured values Resolution True value Copyright 2004 David J. Lilja
Accuracy, Precision, Resolution • Systematic errors → accuracy • How close mean of measured values is to true value • Random errors → precision • Repeatability of measurements • Characteristics of tools → resolution • Smallest increment between measured values Copyright 2004 David J. Lilja
Quantifying Accuracy, Precision, Resolution • Accuracy • Hard to determine true accuracy • Relative to a predefined standard • E.g. definition of a “second” • Resolution • Dependent on tools • Precision • Quantify amount of imprecision using statistical tools Copyright 2004 David J. Lilja
1-α c1 c2 α/2 α/2 Confidence Interval for the Mean Copyright 2004 David J. Lilja
Normalize x Copyright 2004 David J. Lilja
1-α c1 c2 α/2 α/2 Confidence Interval for the Mean • Normalized z follows a Student’s t distribution • (n-1) degrees of freedom • Area left of c2 = 1 – α/2 • Tabulated values for t Copyright 2004 David J. Lilja
1-α c1 c2 α/2 α/2 Confidence Interval for the Mean • As n → ∞, normalized distribution becomes Gaussian (normal) Copyright 2004 David J. Lilja
Confidence Interval for the Mean Copyright 2004 David J. Lilja
An Example Copyright 2004 David J. Lilja
An Example (cont.) Copyright 2004 David J. Lilja
1-α c1 c2 α/2 α/2 An Example (cont.) • 90% CI → 90% chance actual value in interval • 90% CI → α = 0.10 • 1 - α /2 = 0.95 • n = 8 → 7 degrees of freedom Copyright 2004 David J. Lilja
90% Confidence Interval Copyright 2004 David J. Lilja
95% Confidence Interval Copyright 2004 David J. Lilja
What does it mean? • 90% CI = [6.5, 9.4] • 90% chance real value is between 6.5, 9.4 • 95% CI = [6.1, 9.7] • 95% chance real value is between 6.1, 9.7 • Why is interval wider when we are more confident? Copyright 2004 David J. Lilja
95% 9.4 6.5 6.1 9.7 Higher Confidence → Wider Interval? 90% Copyright 2004 David J. Lilja
1-α c1 c2 α/2 α/2 Key Assumption • Measurement errors are Normally distributed. • Is this true for most measurements on real computer systems? Copyright 2004 David J. Lilja
Key Assumption • Saved by the Central Limit Theorem Sum of a “large number” of values from any distribution will be Normally (Gaussian) distributed. • What is a “large number?” • Typically assumed to be >≈ 6 or 7. Copyright 2004 David J. Lilja
How many measurements? • Width of interval inversely proportional to √n • Want to minimize number of measurements • Find confidence interval for mean, such that: • Pr(actual mean in interval) = (1 – α) Copyright 2004 David J. Lilja
How many measurements? Copyright 2004 David J. Lilja
How many measurements? • But n depends on knowing mean and standard deviation! • Estimate s with small number of measurements • Use this s to find n needed for desired interval width Copyright 2004 David J. Lilja
How many measurements? • Mean = 7.94 s • Standard deviation = 2.14 s • Want 90% confidence mean is within 7% of actual mean. Copyright 2004 David J. Lilja
How many measurements? • Mean = 7.94 s • Standard deviation = 2.14 s • Want 90% confidence mean is within 7% of actual mean. • α = 0.90 • (1-α/2) = 0.95 • Error = ± 3.5% • e = 0.035 Copyright 2004 David J. Lilja
How many measurements? • 213 measurements → 90% chance true mean is within ± 3.5% interval Copyright 2004 David J. Lilja
Proportions • p = Pr(success) in n trials of binomial experiment • Estimate proportion: p = m/n • m = number of successes • n = total number of trials Copyright 2004 David J. Lilja
Proportions Copyright 2004 David J. Lilja
Proportions • How much time does processor spend in OS? • Interrupt every 10 ms • Increment counters • n = number of interrupts • m = number of interrupts when PC within OS Copyright 2004 David J. Lilja
Proportions • How much time does processor spend in OS? • Interrupt every 10 ms • Increment counters • n = number of interrupts • m = number of interrupts when PC within OS • Run for 1 minute • n = 6000 • m = 658 Copyright 2004 David J. Lilja
Proportions • 95% confidence interval for proportion • So 95% certain processor spends 10.2-11.8% of its time in OS Copyright 2004 David J. Lilja
Number of measurements for proportions Copyright 2004 David J. Lilja
Number of measurements for proportions • How long to run OS experiment? • Want 95% confidence • ± 0.5% Copyright 2004 David J. Lilja
Number of measurements for proportions • How long to run OS experiment? • Want 95% confidence • ± 0.5% • e = 0.005 • p = 0.1097 Copyright 2004 David J. Lilja
Number of measurements for proportions • 10 ms interrupts → 3.46 hours Copyright 2004 David J. Lilja
Important Points • Use statistics to • Deal with noisy measurements • Aggregate large amounts of data • Errors in measurements are due to: • Accuracy, precision, resolution of tools • Other sources of noise → Systematic, random errors Copyright 2004 David J. Lilja