ebook img

Uncertainty analysis of experimental data with R PDF

207 Pages·2017·4.727 MB·English
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview Uncertainty analysis of experimental data with R

Uncertainty Analysis of Experimental Data with R Uncertainty Analysis of Experimental Data with R Benjamin D. Shaw CRC Press Taylor & Francis Group 6000 Broken Sound Parkway NW, Suite 300 Boca Raton, FL 33487-2742 © 2017 by Taylor & Francis Group, LLC CRC Press is an imprint of Taylor & Francis Group, an Informa business No claim to original U.S. Government works Printed on acid-free paper International Standard Book Number-13: 978-1-4987-9732-0 (Hardback) This book contains information obtained from authentic and highly regarded sources. Reasonable efforts have been made to publish reliable data and information, but the author and publisher cannot assume responsibility for the validity of all materials or the consequences of their use. The authors and publishers have attempted to trace the copyright holders of all material reproduced in this publication and apologize to copyright holders if permission to publish in this form has not been obtained. If any copyright material has not been acknowledged please write and let us know so we may rectify in any future reprint. Except as permitted under U.S. Copyright Law, no part of this book may be reprinted, reproduced, transmitted, or utilized in any form by any electronic, mechanical, or other means, now known or hereafter invented, including photocopying, microfilming, and recording, or in any information storage or retrieval system, without written permission from the publishers. For permission to photocopy or use material electronically from this work, please access www. copyright.com (http://www.copyright.com/) or contact the Copyright Clearance Center, Inc. (CCC), 222 Rosewood Drive, Danvers, MA 01923, 978-750-8400. CCC is a not-for-profit organization that provides licenses and registration for a variety of users. For organizations that have been granted a photocopy license by the CCC, a separate system of payment has been arranged. Trademark Notice: Product or corporate names may be trademarks or registered trademarks, and are used only for identification and explanation without intent to infringe. Library of Congress Cataloging‑in‑Publication Data Names: Shaw, Ben D. Title: Uncertainty analysis of experimental data with R / Benjamin David Shaw. Description: Boca Raton : CRC Press, 2017. | Includes bibliographical references. Identifiers: LCCN 2016048268 | ISBN 9781498797320 Subjects: LCSH: Uncertainty (Information theory)--Textbooks. | Probabilities--Textbooks. | R (Computer program language) Classification: LCC Q375 .S53 2017 | DDC 001.4/34028553--dc23 LC record available at https://lccn.loc.gov/2016048268 Visit the Taylor & Francis Web site at http://www.taylorandfrancis.com and the CRC Press Web site at http://www.crcpress.com I dedicate this book, with love, to my family. Contents 1. Introduction .....................................................................................................1 1.1 What Is This Book About? ...................................................................1 1.2 Units ........................................................................................................3 1.3 Physical Constants and Their Uncertainties .....................................5 1.4 Dimensionless Quantities ....................................................................5 1.5 Software ..................................................................................................6 1.6 Topics Covered ......................................................................................7 Problems ............................................................................................................7 References .........................................................................................................8 2. Aspects of R ...................................................................................................11 2.1 Getting R ...............................................................................................11 2.2 Using R .................................................................................................11 2.3 Getting Help ........................................................................................12 2.4 Libraries and Packages .......................................................................13 2.5 Variables ...............................................................................................13 2.6 Vectors ...................................................................................................14 2.7 Arithmetic ............................................................................................15 2.8 Data Frames .........................................................................................16 2.9 Exporting Data ....................................................................................17 2.10 Importing Data ....................................................................................18 2.11 Internal Mathematical Functions ......................................................18 2.12 Writing Your Own Functions ............................................................19 2.13 Plotting Mathematical Functions ......................................................19 2.14 Loops .....................................................................................................20 2.15 Making Decisions ................................................................................21 2.16 Scripts....................................................................................................23 2.17 Reading Data from Websites .............................................................25 2.18 Matrices and Linear Algebra .............................................................25 2.19 Some Useful Functions and Operations ..........................................28 2.19.1 Data Frames ...........................................................................28 2.19.2 Vectors .....................................................................................29 2.19.3 Probability and Statistics ......................................................29 2.19.4 Plotting ...................................................................................29 2.19.5 Matrices and Linear Algebra ...............................................30 2.19.6 Data, Functions, Libraries, and Packages ..........................30 2.19.7 Various Other Functions and Operations ..........................30 Problems ..........................................................................................................30 References .......................................................................................................32 vii viii Contents 3. Statistics ..........................................................................................................33 3.1 Populations and Samples ...................................................................33 3.2 Mean, Median, Standard Deviation, and Variance of a Sample ......34 3.3 Covariance and Correlation ...............................................................35 3.4 Visualizing Data ..................................................................................36 3.4.1 Histograms ..............................................................................36 3.4.2 Box Plots ..................................................................................37 3.4.3 Plotting Data Sets ...................................................................39 3.4.4 Some Plotting Parameters and Commands .......................42 3.5 Estimating Population Statistics .......................................................43 3.5.1 Confidence Interval for the Population Mean Using Student’s t Variables ..............................................................43 3.5.2 Confidence Interval for the Population Variance Using Chi-Square Variables ..................................................44 3.5.3 Confidence Interval Interpretation ......................................45 3.6 Comparing the Means of Two Samples ...........................................46 3.7 Testing Data for Normality ................................................................47 3.8 Outlier Identification ..........................................................................49 3.8.1 Modified Thompson τ Technique ........................................50 3.8.2 Chauvenet’s Criterion ...........................................................51 Problems ..........................................................................................................54 References .......................................................................................................56 4. Curve Fits ........................................................................................................57 4.1 Linear Regression ................................................................................57 4.2 Nonlinear Regression .........................................................................64 4.3 Kernel Smoothing ...............................................................................67 Problems ..........................................................................................................71 References .......................................................................................................73 5. Uncertainty of a Measured Quantity ........................................................75 5.1 What Is Uncertainty? ..........................................................................75 5.2 Random Variables ...............................................................................75 5.3 Measurement Uncertainties ...............................................................78 5.4 Elemental Systematic Errors ..............................................................82 5.4.1 Normal Distributions ............................................................83 5.4.2 Uniform Distributions ...........................................................83 5.4.3 Triangular Distributions .......................................................84 5.5 Coverage Factors .................................................................................85 Problems ..........................................................................................................89 References .......................................................................................................90 6. Uncertainty of a Result Calculated Using Experimental Data .............91 6.1 Taylor Series Approach ......................................................................92 6.2 Coverage Factors .................................................................................99 Contents ix 6.3 The Kline–McClintock Equation .....................................................102 6.4 Balance Checks ..................................................................................103 Problems ........................................................................................................103 References .....................................................................................................105 7. Taylor Series Uncertainty of a Linear Regression Curve Fit ..............107 7.1 Curve-Fit Expressions ......................................................................107 7.2 Cases to Consider ..............................................................................110 7.2.1 Case 1: No Errors in x and No Correlations ....................110 i 7.2.2 Case 2: Random Errors Only ..............................................112 7.2.3 Case 3: Random and Systematic Errors ............................114 7.3 General Linear Regression Theory .................................................117 7.4 Uncertainties in Regression Coefficients .......................................126 7.5 Evaluating Uncertainties with Built-in R Functions ....................127 Problems ........................................................................................................128 References .....................................................................................................129 8. Monte Carlo Methods ................................................................................131 8.1 Overall Monte Carlo Approach ......................................................131 8.2 Random Number Generation ..........................................................132 8.2.1 Accept/Reject Method ........................................................133 8.2.2 Inverse-cdf Method .............................................................136 8.3 Random Sampling ............................................................................137 8.4 Uncertainty of a Measured Variable ...............................................138 8.5 Bootstrapping with Internal Functions in R ..................................141 8.6 Monte Carlo Convergence Criteria.................................................143 8.7 Uncertainty of a Result Calculated Using Experimental Data ...144 8.8 Uncertainty Bands for Linear Regression Curve Fits ..................149 8.9 Uncertainty Bands for a Curve Fit with Kernel Smoothing........152 Problems ........................................................................................................155 References .....................................................................................................157 9. The Bayesian Approach .............................................................................159 9.1 Bayes’ Theorem for Probability Density Functions......................164 9.2 Bayesian Estimation of the Mean and Standard Deviation of a Normal Population ....................................................................167 Problems ........................................................................................................172 References .....................................................................................................174 Appendix: Probability Density Functions ....................................................175 Index .....................................................................................................................191

See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.