Available:*
Library | Item Barcode | Call Number | Material Type | Item Category 1 | Status |
---|---|---|---|---|---|
Searching... | 30000010235754 | Q183.9 J66 2009 | Open Access Book | Book | Searching... |
On Order
Summary
Summary
Known for its versatility, the free programming language R is widely used for statistical computing and graphics, but is also a fully functional programming language well suited to scientific programming.
An Introduction to Scientific Programming and Simulation Using Rteaches the skills needed to perform scientific programming while also introducing stochastic modelling. Stochastic modelling in particular, and mathematical modelling in general, are intimately linked to scientific programming because the numerical techniques of scientific programming enable the practical application of mathematical models to real-world problems.
Following a natural progression that assumes no prior knowledge of programming or probability, the book is organised into four main sections:
Programming In Rstarts with how to obtain and install R (for Windows, MacOS, and Unix platforms), then tackles basic calculations and program flow, before progressing to function based programming, data structures, graphics, and object-oriented code A Primer on Numerical Mathematicsintroduces concepts of numerical accuracy and program efficiency in the context of root-finding, integration, and optimization A Self-contained Introduction to Probability Theorytakes readers as far as the Weak Law of Large Numbers and the Central Limit Theorem, equipping them for point and interval estimation Simulation teaches how to generate univariate random variables, do Monte-Carlo integration, and variance reduction techniquesIn the last section, stochastic modelling is introduced using extensive case studies on epidemics, inventory management, and plant dispersal. A tried and tested pedagogic approach is employed throughout, with numerous examples, exercises, and a suite of practice projects. Unlike most guides to R, this volume is not about the application of statistical techniques, but rather shows how to turn algorithms into code. It is for those who want to make tools, not just use them.
Reviews 1
Choice Review
This book by Jones, Maillardet, and Robinson (all, mathematics and statistics, Univ. of Melbourne, Australia) is an introduction to programming in R. R is an open source software package that is widely used in statistical analysis. Unlike most other works on R, this book begins by discussing R as a programming language, rather than by using R to perform various kinds of statistical analysis. The second section of the book discusses numerical methods including root finding, integration, and optimization. These first two sections are accessible to lower-level undergraduates with little background in statistics. The volume's third and fourth sections build on the first two sections to introduce the reader to probability, statistics, and Monte Carlo simulation. This work will be of interest to instructors teaching courses in programming to statistics students as well as to users of R who want to learn R programming. Compare this book with P. Dalgaard's Introductory Statistics with R (1st ed., 2002; 2nd ed., 2008), which provides more coverage of the statistical procedures built into R, but does not cover R programming as thoroughly. Summing Up: Recommended. Academic audiences, lower-division undergraduate and above, and professionals/practitioners. B. Borchers New Mexico Institute of Mining and Technology
Table of Contents
Preface | p. v |
I Programming | p. 1 |
1 Setting up | p. 3 |
1.1 Installing R | p. 3 |
1.2 Starting R | p. 3 |
1.3 Working directory | p. 4 |
1.4 Writing scripts | p. 5 |
1.5 Help | p. 5 |
1.6 Supporting material | p. 5 |
2 R as a calculating environment | p. 11 |
2.1 Arithmetic | p. 11 |
2.2 Variables | p. 12 |
2.3 Functions | p. 13 |
2.4 Vectors | p. 15 |
2.5 Missing data | p. 18 |
2.6 Expressions and assignments | p. 19 |
2.7 Logical expressions | p. 20 |
2.8 Matrices | p. 23 |
2.9 The workspace | p. 25 |
2.10 Exercises | p. 25 |
3 Basic programming | p. 29 |
3.1 Introduction | p. 29 |
3.2 Branching with if | p. 31 |
3.3 Looping with for | p. 33 |
3.4 Looping with while | p. 36 |
3.5 Vector-based programming | p. 38 |
3.6 Program flow | p. 39 |
3.7 Basic debugging | p. 41 |
3.8 Good programming habits | p. 42 |
3.9 Exercises | p. 43 |
4 I/O: Input and Output | p. 49 |
4.1 Text | p. 49 |
4.2 Input from a file | p. 51 |
4.3 Input from the keyboard | p. 53 |
4.4 Output to a file | p. 55 |
4.5 Plotting | p. 56 |
4.6 Exercises | p. 58 |
5 Programming with functions | p. 63 |
5.1 Functions | p. 63 |
5.2 Scope and its consequences | p. 68 |
5.3 Optional arguments and default values | p. 70 |
5.4 Vector-based programming using functions | p. 70 |
5.5 Recursive programming | p. 74 |
5.6 Debugging functions | p. 76 |
5.7 Exercises | p. 78 |
6 Sophisticated data structures | p. 85 |
6.1 Factors | p. 85 |
6.2 Dataframes | p. 88 |
6.3 Lists | p. 94 |
6.4 The apply family | p. 98 |
6.5 Exercises | p. 105 |
7 Better graphics | p. 109 |
7.1 Introduction | p. 109 |
7.2 Graphics parameters: par | p. 111 |
7.3 Graphical augmentation | p. 113 |
7.4 Mathematical typesetting | p. 114 |
7.5 Permanence | p. 118 |
7.6 Grouped graphs: lattice | p. 119 |
7.7 3D-plots | p. 123 |
7.8 Exercises | p. 124 |
8 Pointers to further programming techniques | p. 127 |
8.1 Packages | p. 127 |
8.2 Frames and environments | p. 132 |
8.3 Debugging again | p. 134 |
8.4 Object-oriented programming: S3 | p. 137 |
8.5 Object-oriented programming: S4 | p. 141 |
8.6 Compiled code | p. 144 |
8.7 Further reading | p. 146 |
8.8 Exercises | p. 146 |
II Numerical techniques | p. 149 |
9 Numerical accuracy and program efficiency | p. 151 |
9.1 Machine representation of numbers | p. 151 |
9.2 Significant digits | p. 154 |
9.3 Time | p. 156 |
9.4 Loops versus vectors | p. 158 |
9.5 Memory | p. 160 |
9.6 Caveat | p. 161 |
9.7 Exercises | p. 162 |
10 Root-finding | p. 167 |
10.1 Introduction | p. 167 |
10.2 Fixed-point iteration | p. 168 |
10.3 The Newton-Raphson method | p. 173 |
10.4 The secant method | p. 176 |
10.5 The bisection method | p. 178 |
10.6 Exercises | p. 181 |
11 Numerical integration | p. 187 |
11.1 Trapezoidal rule | p. 187 |
11.2 Simpson's rule | p. 189 |
11.3 Adaptive quadrature | p. 194 |
11.4 Exercises | p. 198 |
12 Optimisation | p. 201 |
12.1 Newton's method for optimisation | p. 202 |
12.2 The golden-section method | p. 204 |
12.3 Multivariate optimisation | p. 207 |
12.4 Steepest ascent | p. 209 |
12.5 Newton's method in higher dimensions | p. 213 |
12.6 Optimisation in R and the wider world | p. 218 |
12.7 A curve fitting example | p. 219 |
12.8 Exercises | p. 220 |
III Probability and statistics | p. 225 |
13 Probability | p. 227 |
13.1 The probability axioms | p. 227 |
13.2 Conditional probability | p. 230 |
13.3 Independence | p. 232 |
13.4 The Law of Total Probability | p. 233 |
13.5 Bayes' theorem | p. 234 |
13.6 Exercises | p. 235 |
14 Random variables | p. 241 |
14.1 Definition and distribution function | p. 241 |
14.2 Discrete and continuous random variables | p. 242 |
14.3 Empirical cdf's and histograms | p. 245 |
14.4 Expectation and finite approximations | p. 246 |
14.5 Transformations | p. 251 |
14.6 Variance and standard deviation | p. 256 |
14.7 The Weak Law of Large Numbers | p. 257 |
14.8 Exercises | p. 261 |
15 Discrete random variables | p. 267 |
15.1 Discrete random variables in R | p. 267 |
15.2 Bernoulli distribution | p. 268 |
15.3 Binomial distribution | p. 268 |
15.4 Geometric distribution | p. 270 |
15.5 Negative binomial distribution | p. 273 |
15.6 Poisson distribution | p. 274 |
15.7 Exercises | p. 277 |
16 Continuous random variables | p. 281 |
16.1 Continuous random variables in R | p. 281 |
16.2 Uniform distribution | p. 282 |
16.3 Lifetime models: exponential and Weibull | p. 282 |
16.4 The Poisson process and the gamma distribution | p. 287 |
16.5 Sampling distributions: normal, X2, and t | p. 292 |
16.6 Exercises | p. 297 |
17 Parameter Estimation | p. 303 |
17.1 Point Estimation | p. 303 |
17.2 The Central Limit Theorem | p. 309 |
17.3 Confidence intervals | p. 314 |
17.4 Monte-Carlo confidence intervals | p. 321 |
17.5 Exercises | p. 322 |
IV Simulation | p. 329 |
18 Simulation | p. 331 |
18.1 Simulating iid uniform samples | p. 331 |
18.2 Simulating discrete random variables | p. 333 |
18.3 Inversion method for continuous rv | p. 338 |
18.4 Rejection method for continuous rv | p. 339 |
18.5 Simulating normals | p. 345 |
18.6 Exercises | p. 348 |
19 Monte-Carlo integration | p. 355 |
19.1 Hit-and-miss method | p. 355 |
19.2 (Improved) Monte-Carlo integration | p. 358 |
19.3 Exercises | p. 360 |
20 Variance reduction | p. 363 |
20.1 Antithetic sampling | p. 363 |
20.2 Importance sampling | p. 367 |
20.3 Control variates | p. 372 |
20.4 Exercises | p. 374 |
21 Case studies | p. 377 |
21.1 Introduction | p. 377 |
21.2 Epidemics | p. 378 |
21.3 Inventory | p. 390 |
21.4 Seed dispersal | p. 405 |
22 Student projects | p. 421 |
22.1 The level of a dam | p. 421 |
22.2 Roulette | p. 425 |
22.3 Buffon's needle and cross | p. 428 |
22.4 Insurance risk | p. 430 |
22.5 Squash | p. 433 |
22.6 Stock prices | p. 438 |
Glossary of R commands | p. 441 |
Programs and functions developed in the text | p. 447 |
Index | p. 449 |