Introduction to programming in applied statistics
Introduction to Python and ROOT:
Python is a widely used high-level general-purpose programming
languages, which emphasizes code readability and easy interface.
ROOT is a piece of (CERN developped) software (libraries), which
enables fast reading of data, advanced stastistical analysis and
fitting, and graphical displaying of the results.
A programming language (chosen to be Python) and its interface to a
statistics and graphics package (chosen to be ROOT) are essential
to a course on applied statistics, as we will be using it for all
data analysis. Much of the analyses involved is hard/impossible to
do using simpler programming languages (e.g. matlab).
Installing Python:
Python (version 2.7 or later) is typically part of Linux/MAC-OS
installations, and if you have it already, you can skip this step.
To test if this is the case, try:
> python --version
If a (new) installation is need (possibly for Windows), please see
the
Python download
webpage, and find the version appropriate for your operating
system. We suggest using
Python
v2.7.5.
If you want, Lars has made
a
few pedagogical notes on installing Python on Linux/Mac OS.
Installing ROOT:
ROOT can be downloaded in the latest (and suggested)
version
5.34. Again, find the version suitable for your operating
system. Instalation instructions can be found on that same page or in a
bit
more pedagogically version by Lars, which goes a little further
than the ROOT webpage (enabling Python, etc.).
An example Python/ROOT macro (small piece of program not needing to be
compiled) to test the installation can be found at:
CalcPrimeNumbers.py, of
which I've also made an extensively commented version:
CalcPrimeNumbers_Commented.py.
To test if the program runs, simply type:
> ./CalcPrimeNumbers.py
Slides introducing ROOT:
The following slides are very general and possibly too advanced for
what is needed for this course, but nevertheless useful:
Overview of talk
Part 1
Part 2
Part 3
Part 4
Part 5
Useful links for new ROOT users:
ROOT User Guide
ROOT Tutorials (i.e. examples)
ROOT FAQ