ebook img

Monte Carlo Methods Utilizing Mathematica®: Applications in Inverse Transform and Acceptance-Rejection Sampling PDF

150 Pages·2023·1.165 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 Monte Carlo Methods Utilizing Mathematica®: Applications in Inverse Transform and Acceptance-Rejection Sampling

Synthesis Lectures on Mathematics & Statistics SeriesEditor StevenG.Krantz,DepartmentofMathematics,WashingtonUniversity,SaintLouis,MO, USA This series includes titles in applied mathematics and statistics for cross-disciplinary STEMprofessionals,educators,researchers,andstudents.Theseriesfocusesonnewand traditionaltechniquestodevelopmathematicalknowledgeandskills,anunderstandingof core mathematical reasoning, and the ability to utilize data in specific applications. Sujaul Chowdhury Monte Carlo Methods Utilizing Mathematica® Applications in Inverse Transform and Acceptance-Rejection Sampling SujaulChowdhury DepartmentofPhysics ShahjalalUniversityofScience andTechnology Sylhet,Bangladesh ISSN1938-1743 ISSN1938-1751 (electronic) SynthesisLecturesonMathematics &Statistics ISBN978-3-031-23293-0 ISBN978-3-031-23294-7 (eBook) https://doi.org/10.1007/978-3-031-23294-7 ©TheEditor(s)(ifapplicable)andTheAuthor(s),underexclusivelicensetoSpringerNature SwitzerlandAG2023 Thisworkissubjecttocopyright.AllrightsaresolelyandexclusivelylicensedbythePublisher,whetherthewhole orpartofthematerialisconcerned,specificallytherightsoftranslation,reprinting,reuseofillustrations,recitation, broadcasting,reproductiononmicrofilmsorinanyotherphysicalway,andtransmissionorinformationstorage andretrieval,electronicadaptation,computersoftware,orbysimilarordissimilarmethodologynowknownor hereafterdeveloped. Theuseofgeneraldescriptivenames,registerednames,trademarks,servicemarks,etc.inthispublicationdoes notimply,evenintheabsenceofaspecificstatement,thatsuchnamesareexemptfromtherelevantprotective lawsandregulationsandthereforefreeforgeneraluse. Thepublisher,theauthors,andtheeditorsaresafetoassumethattheadviceandinformationinthisbookare believedtobetrueandaccurateatthedateofpublication.Neitherthepublishernortheauthorsortheeditorsgive awarranty,expressedorimplied,withrespecttothematerialcontainedhereinorforanyerrorsoromissionsthat mayhavebeenmade.Thepublisherremainsneutralwithregardtojurisdictionalclaimsinpublishedmapsand institutionalaffiliations. ThisSpringerimprintispublishedbytheregisteredcompanySpringerNatureSwitzerlandAG Theregisteredcompanyaddressis:Gewerbestrasse11,6330Cham,Switzerland Preface This book on Monte Carlo Methods Using Inverse Transform and Acceptance-Rejection Sampling Utilizing Mathematica is intended for undergraduate students of Mathemat- ics, Statistics, and Physics who wish to know how Monte Carlo methods work with calculations done using a user-friendly program Mathematica. All treatments have been done as less manually as practicable. All calculations except for gathering accepted values of random variate in acceptance-rejection sampling have been done using Mathematica. Definite integrals of a number of functions F(x) have been evaluated using uniform, linear,Gaussianandexponentialprobabilitydensityfunctionsp(x).Itisshownthatresults agree with known exact values better if p(x) is proportional to F(x). Deviation from the proportionality has been shown to result in worse agreement. Allnecessarybackgroundmaterialsarecovered.Aseparatechapterhasbeendedicated to variational Monte Carlo method applied to ground state of simple harmonic oscillator. Necessary background on variational method has been covered so that readers need not consult Quantum Mechanics textbooks. ThebookisonMonteCarlomethods.ThesearenumericalmethodsforComputational Physics. These are parts of the syllabus for undergraduate students of Mathematics and Physics for the course titled “Computational Physics”. Besides the four referenced books, this is the only book to teach how basic Monte Carlo methods work. This is possibly the 1st Mathematica-based book on the topic. Pedagogical features: the book contains practical demonstrations of how to carry out definite integrals using Monte Carlo methods using Mathematica and using random vari- ates sampled by inverse transform method and acceptance-rejection method. Moreover, the book contains a chapter on Variational Quantum Monte Carlo method applied to simple harmonic oscillator. v vi Preface Key words for the book are: Monte Carlo methods, Mathematica, basic Monte Carlo integration,VariationalQuantumMonteCarlomethod,simpleharmonicoscillator,inverse transform sampling, and acceptance-rejection sampling. Sylhet, Bangladesh Sujaul Chowdhury 2022 Contents PartI Monte Carlo Methods Using Inverse Transform Sampling UtilizingMathematica 1 IntroductionforPartI ................................................ 3 1.1 Random Variable ................................................. 3 1.2 Continuous Random Variable ...................................... 3 1.3 Uniform Random Variable ......................................... 4 1.4 Normal or Gaussian Random Variable .............................. 4 1.5 Generating Random Variates by Inverse Transform Method ............ 6 1.6 Variance Reduction and Importance Sampling ....................... 9 2 EvaluationofDefiniteIntegralsUsingInverseTransformSampling UtilizingMathematica ................................................ 13 2.1 Evaluation of Definite Integrals Using Inverse Transform Sampling: Example I ....................................................... 13 2.2 Evaluation of Definite Integrals Using Inverse Transform Sampling: Example II ...................................................... 17 2.3 Evaluation of Definite Integrals Using Inverse Transform Sampling: Example III ..................................................... 23 2.4 Evaluation of Definite Integrals Using Inverse Transform Sampling: Example IV ..................................................... 27 2.5 Evaluation of Definite Integrals Using Inverse Transform Sampling: Example V ...................................................... 31 PartII MonteCarloMethodsUsingAcceptance-RejectionSampling UtilizingMathematica 3 IntroductionforPartII ............................................... 45 3.1 Random Variable ................................................. 45 3.2 Continuous Random Variable ...................................... 45 3.3 Uniform Random Variable ......................................... 46 3.4 Normal or Gaussian Random Variable .............................. 46 vii viii Contents 3.5 Generating Random Variates by Acceptance-Rejection Method ......... 49 3.6 Variance Reduction and Importance Sampling ....................... 51 4 EvaluationofDefiniteIntegralsUsingAcceptance-RejectionSampling UtilizingMathematica ................................................ 53 4.1 Evaluation of Definite Integrals Using Acceptance-Rejection Sampling: Example I ............................................. 53 4.2 Evaluation of Definite Integrals Using Acceptance-Rejection Sampling: Example II ............................................ 67 4.3 Evaluation of Definite Integrals Using Acceptance-Rejection Sampling: Example III ............................................ 81 4.4 Evaluation of Definite Integrals Using Acceptance-Rejection Sampling: Example IV ............................................ 96 4.5 Evaluation of Definite Integrals Using Acceptance-Rejection Sampling: Example V ............................................ 102 5 VariationalMonteCarloMethodAppliedtoGroundStateofSimple HarmonicOscillatorUsingAcceptance-RejectionSamplingUtilizing Mathematica ......................................................... 111 5.1 The Variational Method of Quantum Mechanics Applied to Ground State of Any Quantum Mechanical System .......................... 111 5.2 The Variational Method of Quantum Mechanics Applied to Ground State of Simple Harmonic Oscillator ................................ 113 5.3 Ground State Energy of Simple Harmonic Oscillator Using Variational Quantum Monte Carlo Method and Acceptance-Rejection Sampling ................................ 116 ConcludingRemarks .................................................... 133 Appendix:HandoutsforComputationalLabandAutomatedCollection ofAcceptedRandomVariates .................................. 135 References .............................................................. 149 Part I Monte Carlo Methods Using Inverse Transform Sampling Utilizing Mathematica 1 Introduction for Part I This chapter provides background for Chap. 2. It introduces readers to continuous, uni- form and Gaussian random variables. Inverse transform method of generating random variate for given probability distribution function, and concept of importance sampling are also introduced. 1.1 Random Variable InthecontextofMonteCarlomethods,todefinearandomvariable,wemustindicatethe values that the variable can assume and probabilities of occurrence of these values. We do not know value of the variable in any given case; but we do know the values that the variable can assume and the probabilities of occurrence of these values. 1.2 Continuous Random Variable Arandomvariablex iscalledcontinuousifitcanassumeanyfractionalvalueinacertain interval, say a to b. Besides specifying the interval containing all its possible values, we needtostateafunctionp(x)calledprobabilitydensityfunctionorprobabilitydistribution function. We have (1) p(x)≥0 for a≤x≤b, (2) the product p(x)dx is probability that x≤x≤x + dx, (cid:2) (3) b(cid:4) p(x)dx is probability that a(cid:4)≤x≤b(cid:4) where a < a(cid:4) and b(cid:4) < b, (cid:2)a(cid:4) (4) b p(x)dx =1 indicating the surety that x lies in the interval a to b. a ©TheAuthor(s),underexclusivelicensetoSpringerNatureSwitzerlandAG2023 3 S.Chowdhury,MonteCarloMethodsUtilizingMathematica®,SynthesisLectures onMathematics&Statistics,https://doi.org/10.1007/978-3-031-23294-7_1

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.