Statistical Methods for Data Analysis. Random numbers with ROOT and RooFit



Similar documents
Statistical Methods for Data Analysis. Probability and PDF s

Random-Number Generation

6.2 Normal distribution. Standard Normal Distribution:

Introduction to ROOT

Introduction to ROOT and data analysis

Chapter 3 RANDOM VARIATE GENERATION

The accurate calibration of all detectors is crucial for the subsequent data

Vertex and track reconstruction with the ALICE Inner Tracking System

Network Protocol Design and Evaluation

Multiple Choice: 2 points each

SCIENTIFIC COMPUTING AND PROGRAMMING IN THE CLOUD USING OPEN SOURCE PLATFORMS: AN ILLUSTRATION USING WEIGHTED VOTING SYSTEMS

A Simple Pseudo Random Number algorithm

Mathematical Libraries on JUQUEEN. JSC Training Course

Euler: A System for Numerical Optimization of Programs

Big Data and Big Analytics

CSE373: Data Structures and Algorithms Lecture 3: Math Review; Algorithm Analysis. Linda Shapiro Winter 2015

ATLAS Test Beam Analysis in Stockholm: An Overview

Lecture 3: Continuous distributions, expected value & mean, variance, the normal distribution

BNG 202 Biomechanics Lab. Descriptive statistics and probability distributions I

Theory versus Experiment. Prof. Jorgen D Hondt Vrije Universiteit Brussel jodhondt@vub.ac.be

USB 3.0 Jitter Budgeting White Paper Revision 0.5

IDL. Get the answers you need from your data. IDL

Lecture 2: Descriptive Statistics and Exploratory Data Analysis

Digital Imaging and Multimedia. Filters. Ahmed Elgammal Dept. of Computer Science Rutgers University

Measurement of Neutralino Mass Differences with CMS in Dilepton Final States at the Benchmark Point LM9

Gamma Distribution Fitting

Stats on the TI 83 and TI 84 Calculator

A teaching experience through the development of hypertexts and object oriented software.

Computer Networks. Network Security and Ethics. Week 14. College of Information Science and Engineering Ritsumeikan University

Part 4 fitting with energy loss and multiple scattering non gaussian uncertainties outliers

Operations with positive and negative numbers - see first chapter below. Rules related to working with fractions - see second chapter below

Advanced analytics at your hands

Point Biserial Correlation Tests

Example: Credit card default, we may be more interested in predicting the probabilty of a default than classifying individuals as default or not.

Introduction to Statistical Computing in Microsoft Excel By Hector D. Flores; and Dr. J.A. Dobelman

Adobe Digital Signatures in Adobe Acrobat X Pro

Evaluating Trading Systems By John Ehlers and Ric Way

Chapter 9 Monté Carlo Simulation

Computer Security: Principles and Practice

NCSS Statistical Software Principal Components Regression. In ordinary least squares, the regression coefficients are estimated using the formula ( )

GEC320 COURSE COMPACT. Four hours per week for 15 weeks (60 hours)

HOW TO CREATE THEME IN MAGENTO 2

Lecture 8. Generating a non-uniform probability distribution

A Simultaneous Solution for General Linear Equations on a Ring or Hierarchical Cluster

A Primer on Mathematical Statistics and Univariate Distributions; The Normal Distribution; The GLM with the Normal Distribution

Tracking/Vertexing/BeamSpot/b-tag Results from First Collisions (TRK )

HTML Egg Pro. Tutorials

Probability and Statistics Prof. Dr. Somesh Kumar Department of Mathematics Indian Institute of Technology, Kharagpur

Assignment 2: Option Pricing and the Black-Scholes formula The University of British Columbia Science One CS Instructor: Michael Gelbart

Matlab and Simulink. Matlab and Simulink for Control

An Introduction to Basic Statistics and Probability

Dealing with large datasets

Approximation of Aggregate Losses Using Simulation

A.Besson, IPHC-Strasbourg

MBA Jump Start Program

Sequences. A sequence is a list of numbers, or a pattern, which obeys a rule.

Cryptography and Network Security Chapter 10

Passive Queue Management

Normal Approximation. Contents. 1 Normal Approximation. 1.1 Introduction. Anthony Tanbakuchi Department of Mathematics Pima Community College

Multiple Optimization Using the JMP Statistical Software Kodak Research Conference May 9, 2005

MACHINE LEARNING IN HIGH ENERGY PHYSICS

Lecture 9: Introduction to Pattern Analysis

Installation of ADS SiMKit startup script and designkit on Windows for SiMKit version 4.4

MATH 10: Elementary Statistics and Probability Chapter 7: The Central Limit Theorem

Reading.. IMAGE COMPRESSION- I IMAGE COMPRESSION. Image compression. Data Redundancy. Lossy vs Lossless Compression. Chapter 8.

CHAPTER 5. Number Theory. 1. Integers and Division. Discussion

1 The Brownian bridge construction

CHAPTER 6 TEXTURE ANIMATION

Programming with Mathcad Prime

Part-Based Recognition

Master s thesis tutorial: part III

RevoScaleR Speed and Scalability

Positional Numbering System

Java Modules for Time Series Analysis

The Normal Distribution. Alan T. Arnholt Department of Mathematical Sciences Appalachian State University

Winter 2016 MATH 631 Online University of Waterloo

Network Security. Chapter 6 Random Number Generation. Prof. Dr.-Ing. Georg Carle

Package SHELF. February 5, 2016

Representing Uncertainty by Probability and Possibility What s the Difference?

Solving simultaneous equations using the inverse matrix

CDD user guide. PsN Revised

UNIT I: RANDOM VARIABLES PART- A -TWO MARKS

CCNY. BME I5100: Biomedical Signal Processing. Linear Discrimination. Lucas C. Parra Biomedical Engineering Department City College of New York

FX 115 MS Training guide. FX 115 MS Calculator. Applicable activities. Quick Reference Guide (inside the calculator cover)

Data Retention in MLC NAND Flash Memory: Characterization, Optimization, and Recovery

MATH 10: Elementary Statistics and Probability Chapter 5: Continuous Random Variables

Brent A. Perdue. July 15, 2009

CPE 462 VHDL: Simulation and Synthesis

Petrel TIPS&TRICKS from SCM

Precalculus Orientation and FAQ

5MD00. Assignment Introduction. Luc Waeijen

Mathematical Libraries and Application Software on JUROPA and JUQUEEN

Data Analysis Tools. Tools for Summarizing Data

STATISTICA Solutions for Financial Risk Management Management and Validated Compliance Solutions for the Banking Industry (Basel II)

Transcription:

Statistical Methods for Data Analysis Random numbers with ROOT and RooFit Luca Lista INFN Napoli

ROOT Random number generators TRandom basic Random number generator class (periodicity = 10 9 ). Note that this is a very simple generator (linear congruential) which is known to have defects (the lower random bits are correlated) and therefore should NOT be used in any statistical study. TRandom3 based on the "Mersenne Twister generator", and is the recommended one, since it has good random proprieties (period of 2 19937 1, about 10 6000 ) and it is fast. TRandom1 based on the RANLUX algorithm, has mathematically proven random proprieties and a period of about 10 171. It is however slower than the others. TRandom2 is based on the Tausworthe generator of L'Ecuyer, and it has the advantage of being fast and using only 3 words (of 32 bits) for the state. The period is 10 26. Luca Lista Statistical Methods for Data Analysis 2

Generating with standard PDF s Provided methods of TRandomN objects: Exp(tau) Integer(imax) Gaus(mean, sigma) Rndm() RndmArray(n, x) Uniform(x) Uniform(x1, x2) Landau(mpv, sigma) Poisson(mean) Binomial(ntot, prob) Luca Lista Statistical Methods for Data Analysis 3

Generators in ROOT::Math Generators provided based on GSL (GNU Scientific Library) Same interface as TRandomN Different generators supported via template parameter (RANLUX, by F.James, in this case) ROOT::Math::Random<GSLRngRanLux> r; Double x = r.uniform(); Luca Lista Statistical Methods for Data Analysis 4

Generate random from a TF1 ROOT provides tools to generate random number according to a TF1 TF1 f( ); double x = f.getrandom(); TH1D histo( ); histo.fillrandom(f, 1000); Adopted technique: binned cumulative inversion Caveat: approximations may depend on internal function binning. Can change it using: f.npx(5000); Luca Lista Statistical Methods for Data Analysis 5

Generate according to phase-spaces Original implementation: GENBOD function (W515 from CERNLIB) using the Raubold and Lynch method Implemented in ROOT with TGenPhaseSpace class TLorentzVector target(0.0, 0.0, 0.0, 0.938); TLorentzVector beam(0.0, 0.0,.65,.65); TLorentzVector W = beam + target; //(Momentum, Energy units are Gev/C, GeV) Double_t masses[3] = { 0.938, 0.139, 0.139 }; TGenPhaseSpace event; event.setdecay(w, 3, masses); TH2F *h2 = new TH2F("h2","h2", 50,1.1,1.8, 50,1.1,1.8); for (Int_t n=0;n<100000;n++) { Double_t weight = event.generate(); TLorentzVector *pproton = event.getdecay(0); TLorentzVector *ppip = event.getdecay(1); TLorentzVector *ppim = event.getdecay(2); TLorentzVector pppip = *pproton + *ppip; TLorentzVector pppim = *pproton + *ppim; h2->fill(pppip.m2(),pppim.m2(),weight); } h2->draw(); Luca Lista Statistical Methods for Data Analysis 6

Random generation in RooFit Each PDF is instrumented with methods to generate random samples RooGaussian gauss("gauss","gaussian PDF", x, mu, sigma); RooDataSet* data = gauss.generate(x, 10000); RooPlot* xframe = x.frame(); data->ploton(xframe); xframe->draw(); Hit or miss method is used by default, except for optimized cases (Gaussian, ecc.) Optimized implementations for: PDF sum, product Convolutions Users can define a specialized random generator for custom PDF definitions Luca Lista Statistical Methods for Data Analysis 7

References RANLUX F. James, RANLUX: A Fortran implementation of the high-quality pseudo-random number generator of Lüscher, Computer Physics Communications, 79 (1994) 111 114 GSL random generators: http://www.gnu.org/software/gsl/manual/html_node/randomnumber-generator-algorithms.html http://www.gnu.org/software/gsl/manual/html_node/random- Number-Distributions.html ROOT Math generator documentation: http://project-mathlibs.web.cern.ch/project-mathlibs/sw/html/ group Random.html RooFit online tutorial http://roofit.sourceforge.net/docs/tutorial/ index.html Credits: RooFit slides and examples extracted, adapted and/or inspired by original presentations by Wouter Verkerke Luca Lista Statistical Methods for Data Analysis 8