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

Slides:



Advertisements
Similar presentations
Statistical Methods for Data Analysis Modeling PDF’s with RooFit
Advertisements

Statistical Methods for Data Analysis Random numbers with ROOT and RooFit Luca Lista INFN Napoli.
Statistical Methods for Data Analysis Random number generators Luca Lista INFN Napoli.
S.Towers TerraFerMA TerraFerMA A Suite of Multivariate Analysis tools Sherry Towers SUNY-SB Version 1.0 has been released! useable by anyone with access.
Introduction to Function Minimization. Motivation example Data on height of a group of people, men and women Data on gender not recorded, not known.
ROOT courses1 The ROOT System A Data Access & Analysis Framework June 2003 Ren é Brun/EP Histograming & Fitting.
Random numbers and optimization techniques Jorge Andre Swieca School Campos do Jordão, January,2003 second lecture.
Probability theory Much inspired by the presentation of Kren and Samuelsson.
8. Hypotheses 8.4 Two more things K. Desch – Statistical methods of data analysis SS10 Inclusion of systematic errors LHR methods needs a prediction (from.
Pseudorandom Number Generators
K. Desch – Statistical methods of data analysis SS10
Principles of the Global Positioning System Lecture 10 Prof. Thomas Herring Room A;
MathMore Lorenzo Moneta, Andràs Zsenei ROOT Workshop 30/9/2005.
Efficient Pseudo-Random Number Generation for Monte-Carlo Simulations Using GPU Siddhant Mohanty, Subho Shankar Banerjee, Dushyant Goyal, Ajit Mohanty.
For 3-G Systems Tara Larzelere EE 497A Semester Project.
Math LHCb Ivan Belyaev LHCb, CERN & ITEP/Moscow.
New ROOT Math Libraries W. Brown 1), M. Fischler 1), L. Moneta 2), A. Zsenei 2) 1) Fermi National Accelerator Laboratory, Batavia, Illinois, USA 2) CERN.
Standard Statistical Distributions Most elementary statistical books provide a survey of commonly used statistical distributions. The reason we study these.
Statistical Methods for Data Analysis Parameter estimates with RooFit Luca Lista INFN Napoli.
A SCALABLE LIBRARY FOR PSEUDORANDOM NUMBER GENERATION ALGORITHM 806: SPRNG.
Introduction to MCMC and BUGS. Computational problems More parameters -> even more parameter combinations Exact computation and grid approximation become.
Plug-in and tutorial development for GIMP- Cathy Irwin, 2004 The Development of Image Completion and Tutorial Plug-ins for the GIMP By: Cathy Irwin Supervisors:
Module 1: Statistical Issues in Micro simulation Paul Sousa.
Data Reduction. 1.Overview 2.The Curse of Dimensionality 3.Data Sampling 4.Binning and Reduction of Cardinality.
Random Number Generators 1. Random number generation is a method of producing a sequence of numbers that lack any discernible pattern. Random Number Generators.
Pseudo-random generators Random Number Generating There are three types of generators table look-up generators hardware generators algorithmic (software)
RooFit – tools for ML fits Authors: Wouter Verkerke and David Kirkby.
My own word  I think synthetic division is a short cut for long division  Long division is the same as regular long division just doing it with polynomials.
Signal and Background Modeling for H → 4l Peter Vankov UK Higgs Meeting, RAL
New ROOT Mathematical Libraries SMatrix Package with matrix and vector classes of arbitrary type (initially developed by T. Glebe for HeraB software) complementary.
MICE input beam weighting Dr Chris Rogers Analysis PC 05/09/2007.
Statistical Methods for Data Analysis Introduction to the course Luca Lista INFN Napoli.
ROOT and statistics tutorial Exercise: Discover the Higgs, part 2 Attilio Andreazza Università di Milano and INFN Caterina Doglioni Université de Genève.
SEAL-ROOT Math Plans for 2005 Math work package Andras Zsenei, Anna Kreshuk, Lorenzo Moneta, Eddy Offermann LCG Application Area Internal Review, 30 March,
Review of Probability. Important Topics 1 Random Variables and Probability Distributions 2 Expected Values, Mean, and Variance 3 Two Random Variables.
Lecture VI Statistics. Lecture questions Mathematical statistics Sampling Statistical population and sample Descriptive statistics.
G. Cowan Lectures on Statistical Data Analysis Lecture 5 page 1 Statistical Data Analysis: Lecture 5 1Probability, Bayes’ theorem 2Random variables and.
MathMore Lorenzo Moneta, Andràs Zsenei ROOT Meeting 19/8/2005.
Conditional Observables Joe Tuggle BaBar ROOT/RooFit Workshop December 2007.
FPGA Helix Tracking Algorithm with STT
Machine Learning with Spark MLlib
Erik Devetak Oxford University 18/09/2008
Oliver Schulte Machine Learning 726
ROOT Mathematical Libraries
3. Random Number Generator
M. Kuhn, P. Hopchev, M. Ferro-Luzzi
Unscented Kalman Filter for a coal run-of-mine bin
Statistical methods in LHC data analysis introduction
ROOT Tutorial Simulation and fitting in ROOT
ROOT: Functions & Fitting
CMS RooStats Higgs Combination Package
A cryptographically secure pseudorandom number generator for Julia
Context-based Data Compression
Chapter 9: Huffman Codes
Random-Number Generation
Lecture 2 – Monte Carlo method in finance
Computing and Statistical Data Analysis Stat 3: The Monte Carlo Method
A Toolkit for the modeling of Multi-parametric fit problems
EM Linearity using calibration constants from Geant4
An Introduction To The Backpropagation Algorithm
Computational Lab in Physics: Monte Carlo Integration.
Statistical Methods for Data Analysis Parameter estimates with RooFit
Computer Simulation Techniques Generating Pseudo-Random Numbers
Non-parametric Filters: Particle Filters
Statistical Methods for Data Analysis Modeling PDF’s with RooFit
Statistical Methods for Data Analysis Random number generators
New Techniques and Technologies for Statistics 2017  Estimation of Response Propensities and Indicators of Representative Response Using Population-Level.
Non-parametric Filters: Particle Filters
Nonlinear Conjugate Gradient Method for Supervised Training of MLP
Statistical Methods for Data Analysis Multivariate discriminators with TMVA Luca Lista INFN Napoli.
Presentation transcript:

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

ROOT Random number generators “basic Random number generator class (periodicity = 109). 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 219937-1, about 106000) and it is fast.” TRandom1 “based on the RANLUX algorithm, has mathematically proven random proprieties and a period of about 10171. 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 1026.” Luca Lista Statistical Methods for Data Analysis

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

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

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

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

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

Statistical Methods for Data Analysis 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/Random-number-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