Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/root/TGraphSmooth.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 // @(#)root/hist:$Id$
0002 // Author: Christian Stratowa 30/09/2001
0003 
0004 /*************************************************************************
0005  * Copyright (C) 2006, Rene Brun and Fons Rademakers.                    *
0006  * All rights reserved.                                                  *
0007  *                                                                       *
0008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
0009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
0010  *************************************************************************/
0011 
0012 /******************************************************************************
0013 * Copyright(c) 2001-2006, Dr. Christian Stratowa, Vienna, Austria.            *
0014 * Author: Christian Stratowa with help from Rene Brun.                        *
0015 *                                                                             *
0016 * Algorithms for smooth regression adapted from:                              *
0017 * R: A Computer Language for Statistical Data Analysis                        *
0018 ******************************************************************************/
0019 
0020 #ifndef ROOT_TGraphSmooth
0021 #define ROOT_TGraphSmooth
0022 
0023 //////////////////////////////////////////////////////////////////////////
0024 //                                                                      //
0025 // TGraphSmooth                                                         //
0026 //                                                                      //
0027 // Class for different regression smoothers                             //
0028 //                                                                      //
0029 //////////////////////////////////////////////////////////////////////////
0030 
0031 #include "TGraph.h"
0032 
0033 
0034 class TGraphSmooth: public TNamed {
0035 
0036 private:
0037    TGraphSmooth(const TGraphSmooth&); // Not implented
0038    TGraphSmooth& operator=(const TGraphSmooth&); // Not implented
0039 
0040 protected:
0041    Int_t       fNin;        ///< Number of input points
0042    Int_t       fNout;       ///< Number of output points
0043    TGraph     *fGin;        ///< Input graph
0044    TGraph     *fGout;       ///< Output graph
0045    Double_t    fMinX;       ///< Minimum value of array X
0046    Double_t    fMaxX;       ///< Maximum value of array X
0047 
0048 public :
0049    TGraphSmooth();
0050    TGraphSmooth(const char *name);
0051 //      TGraphSmooth(const TGraphSmooth &smoothReg);   //??
0052    ~TGraphSmooth() override;
0053 
0054    TGraph         *Approx(TGraph *grin, Option_t *option="linear", Int_t nout=50, Double_t *xout=nullptr,
0055                           Double_t yleft=0, Double_t yright=0, Int_t rule=0, Double_t f=0, Option_t *ties="mean");
0056    TGraph         *SmoothKern(TGraph *grin, Option_t *option="normal", Double_t bandwidth=0.5, Int_t nout=100, Double_t *xout=nullptr);
0057    TGraph         *SmoothLowess(TGraph *grin, Option_t *option="",Double_t span=0.67, Int_t iter = 3, Double_t delta = 0);
0058    TGraph         *SmoothSuper(TGraph *grin, Option_t *option="", Double_t bass = 0, Double_t span=0, Bool_t isPeriodic = kFALSE, Double_t *w=nullptr);
0059 
0060    void            Approxin(TGraph *grin, Int_t iKind, Double_t &Ylow, Double_t &Yhigh, Int_t rule, Int_t iTies);
0061    void            Smoothin(TGraph *grin);
0062    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);
0063    void            Lowess(Double_t *x, Double_t *y, Int_t n, Double_t *ys, Double_t span, Int_t iter, Double_t delta);
0064    static void     Lowest(Double_t *x, Double_t *y, Int_t n, Double_t &xs,
0065                           Double_t &ys, Int_t nleft, Int_t nright, Double_t *w, Bool_t userw, Double_t *rw, Bool_t &ok);
0066    static Int_t    Rcmp(Double_t x, Double_t y);
0067    static void     Psort(Double_t *x, Int_t n, Int_t k);
0068    static void     Rank(Int_t n, Double_t *a, Int_t *index, Int_t *rank, Bool_t down=kTRUE);
0069    static void     BDRksmooth(Double_t *x, Double_t *y, Int_t n,
0070                               Double_t *xp, Double_t *yp, Int_t np, Int_t kernel, Double_t bw);
0071    static void     BDRsupsmu(Int_t n, Double_t *x, Double_t *y, Double_t *w, Int_t iper,
0072                              Double_t span, Double_t alpha, Double_t *smo, Double_t *sc);
0073    static void     BDRsmooth(Int_t n, Double_t *x, Double_t *y, Double_t *w,
0074                              Double_t span, Int_t iper, Double_t vsmlsq, Double_t *smo, Double_t *acvr);
0075 
0076    ClassDefOverride(TGraphSmooth,1) //Graph Smoother
0077 };
0078 
0079 #endif