This page intentionally left blank A Student’s Guide to Data and Error Analysis All students taking laboratory courses within the physical sciences and engineering will benefit from this book, whilst researchers will find it an invaluable reference. This concise, practical guide brings the reader up to speedontheproperhandlingandpresentationofscientificdataanditsinac- curacies. It covers all the vital topics with practical guidelines, computer programs (in Python), and recipes for handling experimental errors and reporting experimental data. In addition to the essentials, it also provides further background material for advanced readers who want to understand howthemethodswork.Plentyofexamples,exercises,andsolutionsarepro- videdtoaidandtestunderstanding,whilstusefuldata,tables,andformulas arecompiledinahandysectionforeasyreference. HERMAN J. C. BERENDSENisEmeritusProfessorofPhysicalChemistryat theUniversityofGroningen,theNetherlands.Hisresearchstartedinnuclear magneticresonance,butfocusedlateronmoleculardynamicssimulationson systemsofbiologicalinterest.Heisoneofthepioneersinthisfieldand,with over37000citations,isoneofthemostquotedauthorsinphysicsandchem- istry.Hehastaughtcoursesinmolecularmodelingworldwideandauthored thebookSimulatingthePhysicalWorld(CambridgeUniversityPress,2007). A Student’s Guide to Data and Error Analysis HERMAN J. C. BERENDSEN EmeritusProfessorofPhysicalChemistry, UniversityofGroningen,theNetherlands CAMBRIDGEUNIVERSITYPRESS Cambridge,NewYork,Melbourne,Madrid,CapeTown,Singapore, SãoPaulo,Delhi,Dubai,Tokyo,MexicoCity CambridgeUniversityPress TheEdinburghBuilding,CambridgeCB28RU,UK PublishedintheUnitedStatesofAmericabyCambridgeUniversityPress,NewYork www.cambridge.org Informationonthistitle:www.cambridge.org/9780521119405 (cid:2)c H.Berendsen2011 Thispublicationisincopyright.Subjecttostatutoryexception andtotheprovisionsofrelevantcollectivelicensingagreements, noreproductionofanypartmaytakeplacewithout thewrittenpermissionofCambridgeUniversityPress. Firstpublished2011 PrintedintheUnitedKingdomattheUniversityPress,Cambridge AcatalogrecordforthispublicationisavailablefromtheBritishLibrary LibraryofCongressCataloging-in-PublicationData Berendsen,HermanJ.C. Astudent’sguidetodataanderroranalysis/HermanJ.C.Berendsen. p. cm. ISBN978-0-521-11940-5(Hardback)–ISBN978-0-521-13492-7(pbk.) 1. Erroranalysis(Mathematics) I. Title. QA275.B432011 511(cid:3).43–dc22 2010048231 ISBN978-0-521-11940-5Hardback ISBN978-0-521-13492-7Paperback CambridgeUniversityPresshasnoresponsibilityforthepersistenceor accuracyofURLsforexternalorthird-partyinternetwebsitesreferredto inthispublication,anddoesnotguaranteethatanycontentonsuch websitesis,orwillremain,accurateorappropriate. Tomywifeanddaughters Contents Preface pagexi Part I Data and error analysis 1 1 Introduction 3 2 Thepresentationofphysicalquantitieswiththeirinaccuracies 5 2.1 Howtoreportaseriesofmeasurements 5 2.2 Howtorepresentnumbers 9 2.3 Howtoexpressinaccuracies 10 2.4 Reportingunits 13 2.5 Graphicalpresentationofexperimentaldata 14 3 Errors:classificationandpropagation 18 3.1 Classificationoferrors 18 3.2 Errorpropagation 19 4 Probabilitydistributions 27 4.1 Introduction 27 4.2 Propertiesofprobabilitydistributions 29 4.3 Thebinomialdistribution 32 4.4 ThePoissondistribution 36 4.5 Thenormaldistribution 37 4.6 Thecentrallimittheorem 41 4.7 Otherdistributions 42 5 Processingofexperimentaldata 53 5.1 Thedistributionfunctionofadataseries 54 5.2 Theaverageandthemeansquareddeviation ofadataseries 57 5.3 Estimatesformeanandvariance 58 5.4 AccuracyofmeanandStudent’st-distribution 59 vii viii CONTENTS 5.5 Accuracyofvariance 60 5.6 Handlingdatawithunequalweights 61 5.7 Robustestimates 63 6 Graphicalhandlingofdatawitherrors 71 6.1 Introduction 71 6.2 Linearizationoffunctions 73 6.3 Graphicalestimatesoftheaccuracyofparameters 77 6.4 Usingcalibration 78 7 Fittingfunctionstodata 84 7.1 Introduction 84 7.2 Linearregression 87 7.3 Generalleast-squaresfit 92 7.4 Thechi-squaredtest 95 7.5 Accuracyoftheparameters 98 7.6 F-testonsignificanceofthefit 106 8 BacktoBayes:knowledgeasaprobabilitydistribution 111 8.1 Directandinverseprobabilities 111 8.2 EnterBayes 112 8.3 Choosingtheprior 114 8.4 ThreeexamplesofBayesianinference 114 8.5 Conclusion 121 References 123 Answers to exercises 125 Part II Appendices 133 A1 Combininguncertainties 135 A2 Systematicdeviationsduetorandomerrors 138 A3 Characteristicfunction 141 A4 Frombinomialtonormaldistributions 143 A4.1 Thebinomialdistribution 143 A4.2 Themultinomialdistribution 144 A4.3 ThePoissondistribution 145 A4.4 Thenormaldistribution 146