TGraphSmooth.h

Go to the documentation of this file.
00001 // @(#)root/hist:$Id: TGraphSmooth.h 24702 2008-07-08 12:01:46Z brun $
00002 // Author: Christian Stratowa 30/09/2001
00003 
00004 /******************************************************************************
00005 * Copyright(c) 2001-    , Dr. Christian Stratowa, Vienna, Austria.            *
00006 * Author: Christian Stratowa with help from Rene Brun.                                                 *
00007 *                                                                             *
00008 * Algorithms for smooth regression adapted from:                              *
00009 * R: A Computer Language for Statistical Data Analysis                        *
00010 * Copyright (C) 1996 Robert Gentleman and Ross Ihaka                          *
00011 * Copyright (C) 1999-2001 Robert Gentleman, Ross Ihaka and the                *
00012 * R Development Core Team                                                     *
00013 * R is free software, for licensing see the GNU General Public License        *
00014 * http://www.ci.tuwien.ac.at/R-project/welcome.html                           *
00015 *                                                                             *
00016 * Based on: "The ROOT System", All rights reserved.                           *
00017 * Authors: Rene Brun and Fons Rademakers.                                     *
00018 * For the licensing terms of "The ROOT System" see $ROOTSYS/AA_LICENSE.       *
00019 * For the list of contributors to "The ROOT System" see $ROOTSYS/AA_CREDITS.  *
00020 ******************************************************************************/
00021 
00022 #ifndef ROOT_TGraphSmooth
00023 #define ROOT_TGraphSmooth
00024 
00025 //////////////////////////////////////////////////////////////////////////
00026 //                                                                      //
00027 // TGraphSmooth                                                         //
00028 //                                                                      //
00029 // Class for different regression smoothers                             //
00030 //                                                                      //
00031 //////////////////////////////////////////////////////////////////////////
00032 
00033 #ifndef ROOT_TGraph
00034 #include "TGraph.h"
00035 #endif
00036 
00037 
00038 class TGraphSmooth: public TNamed {
00039 
00040 private:
00041    TGraphSmooth(const TGraphSmooth&); // Not implented
00042    TGraphSmooth& operator=(const TGraphSmooth&); // Not implented
00043 
00044 protected:
00045    Int_t       fNin;        //Number of input points
00046    Int_t       fNout;       //Number of output points
00047    TGraph     *fGin;        //Input graph
00048    TGraph     *fGout;       //Output graph
00049    Double_t    fMinX;       //Minimum value of array X
00050    Double_t    fMaxX;       //Maximum value of array X
00051 
00052 public :
00053    TGraphSmooth();
00054    TGraphSmooth(const char *name);
00055 //      TGraphSmooth(const TGraphSmooth &smoothReg);   //??
00056    virtual ~TGraphSmooth();
00057 
00058    TGraph         *Approx(TGraph *grin, Option_t *option="linear", Int_t nout=50, Double_t *xout=0,
00059                           Double_t yleft=0, Double_t yright=0, Int_t rule=0, Double_t f=0, Option_t *ties="mean");
00060    TGraph         *SmoothKern(TGraph *grin, Option_t *option="normal", Double_t bandwidth=0.5, Int_t nout=100, Double_t *xout=0);
00061    TGraph         *SmoothLowess(TGraph *grin, Option_t *option="",Double_t span=0.67, Int_t iter = 3, Double_t delta = 0);
00062    TGraph         *SmoothSuper(TGraph *grin, Option_t *option="", Double_t bass = 0, Double_t span=0, Bool_t isPeriodic = kFALSE, Double_t *w=0);
00063 
00064    void            Approxin(TGraph *grin, Int_t iKind, Double_t &Ylow, Double_t &Yhigh, Int_t rule, Int_t iTies);
00065    void            Smoothin(TGraph *grin);
00066    static Double_t Approx1(Double_t v, Double_t f, Double_t *x, Double_t *y, Int_t n, Int_t iKind, Double_t Ylow, Double_t Yhigh);
00067    void            Lowess(Double_t *x, Double_t *y, Int_t n, Double_t *ys, Double_t span, Int_t iter, Double_t delta);
00068    static void     Lowest(Double_t *x, Double_t *y, Int_t n, Double_t &xs,
00069                           Double_t &ys, Int_t nleft, Int_t nright, Double_t *w, Bool_t userw, Double_t *rw, Bool_t &ok);
00070    static Int_t    Rcmp(Double_t x, Double_t y);
00071    static void     Psort(Double_t *x, Int_t n, Int_t k);
00072    static void     Rank(Int_t n, Double_t *a, Int_t *index, Int_t *rank, Bool_t down=kTRUE);
00073    static void     BDRksmooth(Double_t *x, Double_t *y, Int_t n,
00074                               Double_t *xp, Double_t *yp, Int_t np, Int_t kernel, Double_t bw);
00075    static void     BDRsupsmu(Int_t n, Double_t *x, Double_t *y, Double_t *w, Int_t iper,
00076                              Double_t span, Double_t alpha, Double_t *smo, Double_t *sc);
00077    static void     BDRsmooth(Int_t n, Double_t *x, Double_t *y, Double_t *w,
00078                              Double_t span, Int_t iper, Double_t vsmlsq, Double_t *smo, Double_t *acvr);
00079 
00080    ClassDef(TGraphSmooth,1) //Graph Smoother
00081 };
00082 
00083 #endif

Generated on Tue Jul 5 14:22:50 2011 for ROOT_528-00b_version by  doxygen 1.5.1