Introduction to Scientific Programming and Simulation Using R

Introduction to Scientific Programming and Simulation Using R

NOOK Book(eBook)

$80.49 $91.95 Save 12% Current price is $80.49, Original price is $91.95. You Save 12%.
View All Available Formats & Editions

Available on Compatible NOOK Devices and the free NOOK Apps.
WANT A NOOK?  Explore Now

Product Details

ISBN-13: 9781420068740
Publisher: CRC Press
Publication date: 03/11/2009
Series: Chapman & Hall/CRC The R Series
Sold by: Barnes & Noble
Format: NOOK Book
Pages: 472
File size: 6 MB

Table of Contents


Setting Up

Installing R

Starting R

Working Directory

Writing Scripts


Supporting Material

R as a Calculating Environment





Missing data

Expressions and assignments

Logical expressions


The workspace

Basic Programming


Branching with if

Looping with for

Looping with while

Vector-based programming

Program flow

Basic debugging

Good programming habits

 I/O: Input and Output


Input from a file

Input from the keyboard

Output to a file


Programming with Functions


Scope and its consequences

Optional arguments and default values

Vector-based programming using functions

Recursive programming

Debugging functions

Sophisticated Data Structures




The apply family

Better Graphics


Graphics parameters: par

Graphical augmentation

Mathematical typesetting


Grouped graphs: lattice


Pointers to Further Programming Techniques


Frames and environments

Debugging again

Object-oriented programming: S3

Object-oriented programming: S4

Compiled code

Further reading


Numerical Accuracy and Program Efficiency

Machine representation of numbers

Significant digits


Loops versus vectors





Fixed-point iteration

The Newton-Raphson method

The secant method

The bisection method

Numerical Integration

Trapezoidal rule

Simpson’s rule

Adaptive quadrature


Newton’s method for optimisation

The golden-section method

Multivariate optimisation

Steepest ascent

Newton’s method in higher dimensions

Optimisation in R and the wider world

A curve fitting example



The probability axioms

Conditional probability


The Law of Total Probability

Bayes’ theorem

Random Variables

Definition and distribution function

Discrete and continuous random variables

Empirical cdf’s and histograms

Expectation and finite approximations


Variance and standard deviation

The Weak Law of Large Numbers

Discrete Random Variables

Discrete random variables in R

Bernoulli distribution

Geometric distribution

Negative binomial distribution

Poisson distribution

Continuous Random Variables

Continuous random variables in R

Uniform distribution 282

Lifetime models: exponential and Weibull

The Poisson process and the gamma distribution

Sampling distributions: normal, x2, and t

Parameter Estimation

Point Estimation

The Central Limit Theorem

Confidence intervals

Monte-Carlo confidence intervals



Simulating iid uniform samples

Simulating discrete random variables

Inversion method for continuous rv

Rejection method for continuous rv

Simulating normals

Monte-Carlo Integration

Hit-and-miss method

(Improved) Monte-Carlo integration


Variance Reduction

Antithetic sampling

Importance sampling

Control variates

Case Studies




Seed dispersal

Student Projects

The level of a dam


Buffon’s needle and cross

Insurance risk


Stock prices

Glossary of R commands

Programs and functions developed in the text


What People are Saying About This

From the Publisher

This book is a good resource for someone who wants to learn R and use R for statistical computing and graphics. It will also serve well as a textbook or a reference book for students in a course related to computational statistics.
—Hon Keung Tony Ng, Technometrics, May 2011

… a very coherent and useful account of its chosen subject matter. … The programming section … is more comprehensive than Braun & Murdoch (2007), but more accessible than Venables & Ripley (2000). … The book deserves a place on university library shelves … One very useful feature of the book is that nearly every chapter has a set of exercises. There are also plenty of well-chosen examples throughout the book that are used to explain the material. I also appreciated the clear and attractive programming style of the R code presented in the book. I found very little in the way of typos or solecisms. … I can strongly recommend the book for its intended audience. If I ever again have to teach our stochastic modelling course, I will undoubtedly use some of the exercises and examples from Scientific Programming and Simulation Using R.
—David Scott, Australian & New Zealand Journal of Statistics, 2011

It is not often that I think that a statistics text is one that most scientifc statisticians should have in their personal libraries. Introduction to Scientific Programming and Simulation Using R is such a text. … This text provides scientific researchers with a working knowledge of R for both reviewing and for engaging in the statistical evaluation of scientific data. …It is particularly useful for understanding and developing modeling and simulation software. I highly recommend the text, finding it to be one of the most useful books I have read on the subject.
Journal of Statistical Software, September 2010, Volume 36

The authors have written an excellent introduction to scientific programming with R. Their clear prose, logical structure, well-documented code and realistic examples made the book a pleasure to read. One particularly useful feature is the chapter of cases studies at the end, which not only demonstrates complete analyses but also acts as a pedagogical tool to review and integrate material introduced throughout the book. … I would strongly recommend this book for readers interested in using R for simulations, particularly for those new to scientific programming or R. It is also very student-friendly and would be suitable either as a course textbook or for self-study.
Significance, September 2009

I think that the techniques of scientific programming presented will soon enable the novice to apply statistical models to real-world problems. The writing style is easy to read and the book is suitable for private study. If you have never read a book on scientific programming and simulation, then I recommend that you start with this one.
International Statistical Review, 2009

Customer Reviews

Most Helpful Customer Reviews

See All Customer Reviews