Preface

This text presents a brief summary of the theoretical content of the course ``Computational statistics I’’, taught at the University of Helsinki. Despite the name, the course covers basics of both statistical computation and computational statistics, with a heavy focus on Bayesian methods.

The book contains programming examples. There are mainly written in Python 3, unless otherwise mentioned. The reason for using Python instead of e.g. R is that R does not support one of the corner stones of modern numerical computation: automatic differentiation, that will be heavily used during the course.

Some general debugging tips for computational statistics

  • Always set the random seed at the beginning and save the value
  • Test any random samplers you have implemented by sampling from a known distribution
  • When implementing a probability density function, always test numerically that it sums/integrates to 1
  • When implementing procedures for statistical inference from data, simulate data from a known model, apply the inference to that data and check if you obtain the original parameters back