apologies, please disregard the last question, it comes from my mathematical mistakes, not root. -- CMS-Bristol http://cern.ch/dan.holmes ---------- Forwarded message ---------- Date: Mon, 3 Nov 2003 14:45:55 +0100 (CET) From: Dan Holmes <dholmes@mail.cern.ch> To: roottalk@cern.ch Subject: gaussian integrals Hello, I am trying to convert gaussian significances to probabilities repeatedly and quickly within some looping code. What is the best way to do this? .. i have tried defining the erf and integrating it but i'm not convinced root is giving me the correct answers.. my code: { form1 = new TFormula("form1","pow(2.718281828,-pow(x,2))"); TF1 f1("func1","form1",-10,10); f1.Draw(); double prob=f1.Integral(-1,1); cout<<"returned integral is "<<prob<<endl; cout<<"prob is "<<prob*pow( 1.77245,-1)<<endl; // integral of -100 to 100 is 1.77245 } returned integral is 1.49365 prob is 0.842703 ..but i think i should get an answer closer to 63% within 1 standard deviation of a gaussian?? << root vers: 3.05/07>> ..can you see what i am doing wrong or suggest anything? ..maybe there is a tutorial on this but i couldn't find it. cheers, Dan. -- CMS-Bristol http://cern.ch/dan.holmes
This archive was generated by hypermail 2b29 : Thu Jan 01 2004 - 17:50:16 MET