# Re: Error of the integral

From: Arthur E. Snyder <snyder_at_slac.stanford.edu>
Date: Tue, 18 Oct 2005 11:35:32 -0700 (PDT)

I don't think there is (though such things are some times hard to find). I just compute the derivatives numerical myself, so:

Double_t dIntegral(TF1* f,Double_t lo,Double_t up,Int_t par,Double_t eps) {
Int_t nPar=f->GetNpar();

```  if(par<0) return 0.0;
if(par>=nPar) return 0.0;
if(nPar>=100) return 0.0;
```

Double_t pars;
f->GetParameters(pars);
Double_t dPar=fabs(pars[par])*eps;
if(dPar<eps) dPar=eps;
pars[par]+=dPar;
Double_t iUp=f->Integral(lo,up,pars)/Common::binSize;   pars[par]-=2.0*dPar;
Double_t iLo=f->Integral(lo,up,pars)/Common::binSize;   return (iUp-iLo)/2.0/dPar;
}

It would be nice if ROOT provide such functions and error calculations as well as thing like moment integrals, etc. Maybe it does and I just can't find them (in which case somebody will tell us ...).

-Art S.

```A.E. Snyder, Group EC                        \!c*p?/
SLAC Mail Stop #95                          ((.   .))
Box 4349                                        |
Stanford, Ca, USA, 94309                      '\|/`
e-mail:snyder_at_slac.stanford.edu                 o
phone:650-926-2701                              _
http://www.slac.stanford.edu/~snyder          BaBar
FAX:650-926-2657                          Collaboration

```

On Tue, 18 Oct 2005, Alberto Pulvirenti wrote:

> Dear all,
>
> If I have a TF1 object coming from a best-fit operation, where
> parameters and their errors are set, I know that it is possible to
> calculate its integral between two values A and B.
> Is there a way to calculate also the error of this integral, taking into
> account the errors on the fitted parameters?
>
> Thanks, regards
>
> Alberto
>
>
Received on Tue Oct 18 2005 - 20:38:01 MEST

This archive was generated by hypermail 2.2.0 : Tue Jan 02 2007 - 14:45:13 MET