Part A Simulation and Statistical Programming HT 2015

Statistical programming theme webpage


Part A SSP has two webpages, one for Simulation theme (maintained by Prof Vihola)

and one (this one, maintained by Prof Nicholls) for the Statistical Programming theme.

Prof Vihola’s page is the ‘main’ page. Material common to both themes will appear there.


Lecture material

Lecture 4 (Lab session - Introduction to Statistical programming with R) and R-code

Here are some extra R script exercises and solutions from an elementary summer course

I gave on R. You may find it useful to run through these to reinforce the material in Lecture 4.


Lecture 6 (Lab session - Functions and flow control in R) and R-code

Lecture 8 (Lab session - Vectorising loops; operations on Data) and R-code

Lecture 10 (Lab session - Recursion and runtime analysis) and R-code

Lecture 12 (Lab session - Solving systems of linear equations; Numerical stability) and R-code

Here is a short supplement to Lecture 12 listing some commands for handling matrices.

Lecture 14 (Lab session - Implementing Bayesian inference using MCMC) and R-code

Problem sheets

Problem sheet 4 [04/03/2015 - garbled font fixed in Q3 and location of trees data added to Q4]


First practical and solutions. Second practical and solutions.

Third practical and solutions. Fourth practical and solutions.

Fifth practical and solutions.

Sixth practical, R-solutions and image generated in solution to Q3.  

(Prac 6 solutions to Q1b and Q3 updated 16-03-15)


Data used in Statistical Programming lectures and practical examples can be found in this directory.

Course details

See Prof Vihola’s Part A SSP webpage for course details.


The workload of this course is equivalent to an 16-lecture course.

There are 14 lectures and 6 practicals.


Lectures 2-3pm Fridays in weeks 3 to 8 take place in the

Evenlode Room of the OUCS building 13 Banbury road.

These lectures focus on Statistical Programming.


The OUCS lectures are followed by practical teaching sessions 3-4pm Fridays

in weeks 3-8 in the same room.




Recommended reading

W.J. Braun and D Murdoch, "A First Course in Statistical Programming with R", ISBN 0-521-69424-8

C.P. Robert and G Casella, ``Introducing Monte Carlo Methods with R'


Advanced texts

W. Venables and B.D. Ripley, “Modern Applied Statistics with S”, ISBN 0- 387-95457-0

J.R Norris, “Markov Chains”, CUP, 1997

S.M Ross, “Simulation”, Elsevier, 4th edition, 2006

C.P. Robert and G Casella, “Monte Carlo Statistical Methods”, Springer, 2004

B.D Ripley, “Stochastic Simulation”, Wiley, 1987




"Anyone who can do solid statistical programming will never miss a meal."

(Prof David Banks 2008)


"The rising stature of statisticians ... is a by-product of the recent explosion

of digital data. In field after field, computing and the Web are creating new realms

of data to explore - sensor signals, surveillance tapes, social network chatter,

public records and more. And the digital data surge only promises to accelerate..."

(Steve Lohr from the New York Times 2009).


"We strongly believe in the power of open data as a fuel for social and economic growth.

But it is vital that we explore ...the full potential of public sector information. We will see

how we can improve access to this data and create opportunities for innovation,

data-driven businesses and services that will benefit everyone."

(Francis Maude, Minister for the Cabinet Office, speaking of the launch of the BIS Data

Strategy Board in 2012)


"For Today's Graduate, Just One Word: Statistics.",

(Lohr again 2009)


"I keep saying that the sexy job in the next 10 years will be statisticians."

(Hal Varian, Chief Economist at Google)


"Hal was right, but they didnt call it 'Statistics'." (Prof David Hand, 2012, referring to

the many names – Data Assimilation, Quantitative Analysis, Big Data, Data Analysis,

Data Science - we have for 'Statistics')




Geoff Nicholls