ROOT
6.06/09
Reference Guide
|
Definition at line 23 of file TRobustEstimator.h.
Public Member Functions | |
TRobustEstimator () | |
this constructor should be used in a univariate case: first call this constructor, then - the EvaluateUni(..) function More... | |
TRobustEstimator (Int_t nvectors, Int_t nvariables, Int_t hh=0) | |
constructor More... | |
virtual | ~TRobustEstimator () |
void | AddColumn (Double_t *col) |
adds a column to the data matrix it is assumed that the column has size fN variable fVarTemp keeps the number of columns l already added More... | |
void | AddRow (Double_t *row) |
adds a vector to the data matrix it is supposed that the vector is of size fNvar More... | |
void | Evaluate () |
Finds the estimate of multivariate mean and variance. More... | |
void | EvaluateUni (Int_t nvectors, Double_t *data, Double_t &mean, Double_t &sigma, Int_t hh=0) |
for the univariate case estimates of location and scatter are returned in mean and sigma parameters the algorithm works on the same principle as in multivariate case - it finds a subset of size hh with smallest sigma, and then returns mean and sigma of this subset More... | |
Int_t | GetBDPoint () |
returns the breakdown point of the algorithm More... | |
void | GetCovariance (TMatrixDSym &matr) |
returns the covariance matrix More... | |
const TMatrixDSym * | GetCovariance () const |
void | GetCorrelation (TMatrixDSym &matr) |
returns the correlation matrix More... | |
const TMatrixDSym * | GetCorrelation () const |
void | GetHyperplane (TVectorD &vec) |
if the points are on a hyperplane, returns this hyperplane More... | |
const TVectorD * | GetHyperplane () const |
if the points are on a hyperplane, returns this hyperplane More... | |
Int_t | GetNHyp () |
void | GetMean (TVectorD &means) |
return the estimate of the mean More... | |
const TVectorD * | GetMean () const |
void | GetRDistances (TVectorD &rdist) |
returns the robust distances (helps to find outliers) More... | |
const TVectorD * | GetRDistances () const |
Int_t | GetNumberObservations () const |
Int_t | GetNvar () const |
const TArrayI * | GetOuliers () const |
Int_t | GetNOut () |
returns the number of outliers More... | |
Double_t | GetChiQuant (Int_t i) const |
returns the chi2 quantiles More... | |
Public Member Functions inherited from TObject | |
TObject () | |
TObject (const TObject &object) | |
TObject copy ctor. More... | |
TObject & | operator= (const TObject &rhs) |
TObject assignment operator. More... | |
virtual | ~TObject () |
TObject destructor. More... | |
virtual void | AppendPad (Option_t *option="") |
Append graphics object to current pad. More... | |
virtual void | Browse (TBrowser *b) |
Browse object. May be overridden for another default action. More... | |
virtual const char * | ClassName () const |
Returns name of class to which the object belongs. More... | |
virtual void | Clear (Option_t *="") |
virtual TObject * | Clone (const char *newname="") const |
Make a clone of an object using the Streamer facility. More... | |
virtual Int_t | Compare (const TObject *obj) const |
Compare abstract method. More... | |
virtual void | Copy (TObject &object) const |
Copy this to obj. More... | |
virtual void | Delete (Option_t *option="") |
Delete this object. More... | |
virtual Int_t | DistancetoPrimitive (Int_t px, Int_t py) |
Computes distance from point (px,py) to the object. More... | |
virtual void | Draw (Option_t *option="") |
Default Draw method for all objects. More... | |
virtual void | DrawClass () const |
Draw class inheritance tree of the class to which this object belongs. More... | |
virtual TObject * | DrawClone (Option_t *option="") const |
Draw a clone of this object in the current pad. More... | |
virtual void | Dump () const |
Dump contents of object on stdout. More... | |
virtual void | Execute (const char *method, const char *params, Int_t *error=0) |
Execute method on this object with the given parameter string, e.g. More... | |
virtual void | Execute (TMethod *method, TObjArray *params, Int_t *error=0) |
Execute method on this object with parameters stored in the TObjArray. More... | |
virtual void | ExecuteEvent (Int_t event, Int_t px, Int_t py) |
Execute action corresponding to an event at (px,py). More... | |
virtual TObject * | FindObject (const char *name) const |
Must be redefined in derived classes. More... | |
virtual TObject * | FindObject (const TObject *obj) const |
Must be redefined in derived classes. More... | |
virtual Option_t * | GetDrawOption () const |
Get option used by the graphics system to draw this object. More... | |
virtual UInt_t | GetUniqueID () const |
Return the unique object id. More... | |
virtual const char * | GetName () const |
Returns name of object. More... | |
virtual const char * | GetIconName () const |
Returns mime type name of object. More... | |
virtual Option_t * | GetOption () const |
virtual char * | GetObjectInfo (Int_t px, Int_t py) const |
Returns string containing info about the object at position (px,py). More... | |
virtual const char * | GetTitle () const |
Returns title of object. More... | |
virtual Bool_t | HandleTimer (TTimer *timer) |
Execute action in response of a timer timing out. More... | |
virtual ULong_t | Hash () const |
Return hash value for this object. More... | |
virtual Bool_t | InheritsFrom (const char *classname) const |
Returns kTRUE if object inherits from class "classname". More... | |
virtual Bool_t | InheritsFrom (const TClass *cl) const |
Returns kTRUE if object inherits from TClass cl. More... | |
virtual void | Inspect () const |
Dump contents of this object in a graphics canvas. More... | |
virtual Bool_t | IsFolder () const |
Returns kTRUE in case object contains browsable objects (like containers or lists of other objects). More... | |
virtual Bool_t | IsEqual (const TObject *obj) const |
Default equal comparison (objects are equal if they have the same address in memory). More... | |
virtual Bool_t | IsSortable () const |
Bool_t | IsOnHeap () const |
Bool_t | IsZombie () const |
virtual Bool_t | Notify () |
This method must be overridden to handle object notification. More... | |
virtual void | ls (Option_t *option="") const |
The ls function lists the contents of a class on stdout. More... | |
virtual void | Paint (Option_t *option="") |
This method must be overridden if a class wants to paint itself. More... | |
virtual void | Pop () |
Pop on object drawn in a pad to the top of the display list. More... | |
virtual void | Print (Option_t *option="") const |
This method must be overridden when a class wants to print itself. More... | |
virtual Int_t | Read (const char *name) |
Read contents of object with specified name from the current directory. More... | |
virtual void | RecursiveRemove (TObject *obj) |
Recursively remove this object from a list. More... | |
virtual void | SaveAs (const char *filename="", Option_t *option="") const |
Save this object in the file specified by filename. More... | |
virtual void | SavePrimitive (std::ostream &out, Option_t *option="") |
Save a primitive as a C++ statement(s) on output stream "out". More... | |
virtual void | SetDrawOption (Option_t *option="") |
Set drawing option for object. More... | |
virtual void | SetUniqueID (UInt_t uid) |
Set the unique object id. More... | |
virtual void | UseCurrentStyle () |
Set current style settings in this object This function is called when either TCanvas::UseCurrentStyle or TROOT::ForceStyle have been invoked. More... | |
virtual Int_t | Write (const char *name=0, Int_t option=0, Int_t bufsize=0) |
Write this object to the current directory. More... | |
virtual Int_t | Write (const char *name=0, Int_t option=0, Int_t bufsize=0) const |
Write this object to the current directory. More... | |
void * | operator new (size_t sz) |
void * | operator new[] (size_t sz) |
void * | operator new (size_t sz, void *vp) |
void * | operator new[] (size_t sz, void *vp) |
void | operator delete (void *ptr) |
Operator delete. More... | |
void | operator delete[] (void *ptr) |
Operator delete []. More... | |
void | SetBit (UInt_t f, Bool_t set) |
Set or unset the user status bits as specified in f. More... | |
void | SetBit (UInt_t f) |
void | ResetBit (UInt_t f) |
Bool_t | TestBit (UInt_t f) const |
Int_t | TestBits (UInt_t f) const |
void | InvertBit (UInt_t f) |
virtual void | Info (const char *method, const char *msgfmt,...) const |
Issue info message. More... | |
virtual void | Warning (const char *method, const char *msgfmt,...) const |
Issue warning message. More... | |
virtual void | Error (const char *method, const char *msgfmt,...) const |
Issue error message. More... | |
virtual void | SysError (const char *method, const char *msgfmt,...) const |
Issue system error message. More... | |
virtual void | Fatal (const char *method, const char *msgfmt,...) const |
Issue fatal error message. More... | |
void | AbstractMethod (const char *method) const |
Use this method to implement an "abstract" method that you don't want to leave purely abstract. More... | |
void | MayNotUse (const char *method) const |
Use this method to signal that a method (defined in a base class) may not be called in a derived class (in principle against good design since a child class should not provide less functionality than its parent, however, sometimes it is necessary). More... | |
void | Obsolete (const char *method, const char *asOfVers, const char *removedFromVers) const |
Use this method to declare a method obsolete. More... | |
Protected Member Functions | |
void | AddToSscp (TMatrixD &sscp, TVectorD &vec) |
update the sscp matrix with vector vec More... | |
void | ClearSscp (TMatrixD &sscp) |
clear the sscp matrix, used for covariance and mean calculation More... | |
void | Classic () |
called when h=n. More... | |
void | Covar (TMatrixD &sscp, TVectorD &m, TMatrixDSym &cov, TVectorD &sd, Int_t nvec) |
calculates mean and covariance More... | |
void | Correl () |
transforms covariance matrix into correlation matrix More... | |
void | CreateSubset (Int_t ntotal, Int_t htotal, Int_t p, Int_t *index, TMatrixD &data, TMatrixD &sscp, Double_t *ndist) |
creates a subset of htotal elements from ntotal elements first, p+1 elements are drawn randomly(without repetitions) if their covariance matrix is singular, more elements are added one by one, until their covariance matrix becomes regular or it becomes clear that htotal observations lie on a hyperplane If covariance matrix determinant!=0, distances of all ntotal elements are calculated, using formula d_i=Sqrt((x_i-M)*S_inv*(x_i-M)), where M is mean and S_inv is the inverse of the covariance matrix htotal points with smallest distances are included in the returned subset. More... | |
void | CreateOrtSubset (TMatrixD &dat, Int_t *index, Int_t hmerged, Int_t nmerged, TMatrixD &sscp, Double_t *ndist) |
creates a subset of hmerged vectors with smallest orthogonal distances to the hyperplane hyp[1]*(x1-mean[1])+...+hyp[nvar]*(xnvar-mean[nvar])=0 This function is called in case when less than fH samples lie on a hyperplane. More... | |
Double_t | CStep (Int_t ntotal, Int_t htotal, Int_t *index, TMatrixD &data, TMatrixD &sscp, Double_t *ndist) |
from the input htotal-subset constructs another htotal subset with lower determinant More... | |
Int_t | Exact (Double_t *ndist) |
for the exact fit situaions returns number of observations on the hyperplane More... | |
Int_t | Exact2 (TMatrixD &mstockbig, TMatrixD &cstockbig, TMatrixD &hyperplane, Double_t *deti, Int_t nbest, Int_t kgroup, TMatrixD &sscp, Double_t *ndist) |
This function is called if determinant of the covariance matrix of a subset=0. More... | |
Int_t | Partition (Int_t nmini, Int_t *indsubdat) |
divides the elements into approximately equal subgroups number of elements in each subgroup is stored in indsubdat number of subgroups is returned More... | |
Int_t | RDist (TMatrixD &sscp) |
Calculates robust distances.Then the samples with robust distances greater than a cutoff value (0.975 quantile of chi2 distribution with fNvar degrees of freedom, multiplied by a correction factor), are given weiht=0, and new, reweighted estimates of location and scatter are calculated The function returns the number of outliers. More... | |
void | RDraw (Int_t *subdat, Int_t ngroup, Int_t *indsubdat) |
Draws ngroup nonoverlapping subdatasets out of a dataset of size n such that the selected case numbers are uniformly distributed from 1 to n. More... | |
Double_t | KOrdStat (Int_t ntotal, Double_t *arr, Int_t k, Int_t *work) |
because I need an Int_t work array More... | |
Protected Member Functions inherited from TObject | |
void | MakeZombie () |
virtual void | DoError (int level, const char *location, const char *fmt, va_list va) const |
Interface to ErrorHandler (protected). More... | |
Additional Inherited Members | |
Public Types inherited from TObject | |
enum | EStatusBits { kCanDelete = BIT(0), kMustCleanup = BIT(3), kObjInCanvas = BIT(3), kIsReferenced = BIT(4), kHasUUID = BIT(5), kCannotPick = BIT(6), kNoContextMenu = BIT(8), kInvalidObject = BIT(13) } |
enum | { kIsOnHeap = 0x01000000, kNotDeleted = 0x02000000, kZombie = 0x04000000, kBitMask = 0x00ffffff } |
enum | { kSingleKey = BIT(0), kOverwrite = BIT(1), kWriteDelete = BIT(2) } |
Static Public Member Functions inherited from TObject | |
static Long_t | GetDtorOnly () |
Return destructor only flag. More... | |
static void | SetDtorOnly (void *obj) |
Set destructor only flag. More... | |
static Bool_t | GetObjectStat () |
Get status of object stat flag. More... | |
static void | SetObjectStat (Bool_t stat) |
Turn on/off tracking of objects in the TObjectTable. More... | |
#include <TRobustEstimator.h>
TRobustEstimator::TRobustEstimator | ( | ) |
this constructor should be used in a univariate case: first call this constructor, then - the EvaluateUni(..) function
Definition at line 130 of file TRobustEstimator.cxx.
constructor
Definition at line 136 of file TRobustEstimator.cxx.
|
inlinevirtual |
Definition at line 78 of file TRobustEstimator.h.
adds a column to the data matrix it is assumed that the column has size fN variable fVarTemp keeps the number of columns l already added
Definition at line 176 of file TRobustEstimator.cxx.
adds a vector to the data matrix it is supposed that the vector is of size fNvar
Definition at line 197 of file TRobustEstimator.cxx.
update the sscp matrix with vector vec
Definition at line 784 of file TRobustEstimator.cxx.
Referenced by Classic(), CreateOrtSubset(), CreateSubset(), CStep(), Evaluate(), Exact2(), and RDist().
|
protected |
called when h=n.
Returns classic covariance matrix and mean
Definition at line 814 of file TRobustEstimator.cxx.
Referenced by Evaluate().
clear the sscp matrix, used for covariance and mean calculation
Definition at line 801 of file TRobustEstimator.cxx.
Referenced by Classic(), CreateOrtSubset(), CreateSubset(), CStep(), Evaluate(), Exact2(), and RDist().
|
protected |
transforms covariance matrix into correlation matrix
Definition at line 855 of file TRobustEstimator.cxx.
Referenced by Classic().
|
protected |
calculates mean and covariance
Definition at line 832 of file TRobustEstimator.cxx.
Referenced by Classic(), CreateOrtSubset(), CreateSubset(), CStep(), Evaluate(), Exact2(), and RDist().
|
protected |
creates a subset of hmerged vectors with smallest orthogonal distances to the hyperplane hyp[1]*(x1-mean[1])+...+hyp[nvar]*(xnvar-mean[nvar])=0 This function is called in case when less than fH samples lie on a hyperplane.
Definition at line 973 of file TRobustEstimator.cxx.
Referenced by Evaluate().
|
protected |
creates a subset of htotal elements from ntotal elements first, p+1 elements are drawn randomly(without repetitions) if their covariance matrix is singular, more elements are added one by one, until their covariance matrix becomes regular or it becomes clear that htotal observations lie on a hyperplane If covariance matrix determinant!=0, distances of all ntotal elements are calculated, using formula d_i=Sqrt((x_i-M)*S_inv*(x_i-M)), where M is mean and S_inv is the inverse of the covariance matrix htotal points with smallest distances are included in the returned subset.
Definition at line 883 of file TRobustEstimator.cxx.
Referenced by Evaluate().
|
protected |
from the input htotal-subset constructs another htotal subset with lower determinant
As proven by Peter J.Rousseeuw and Katrien Van Driessen, if distances for all elements are calculated, using the formula:d_i=Sqrt((x_i-M)*S_inv*(x_i-M)), where M is the mean of the input htotal-subset, and S_inv - the inverse of its covariance matrix, then htotal elements with smallest distances will have covariance matrix with determinant less or equal to the determinant of the input subset covariance matrix.
determinant for this htotal-subset with smallest distances is returned
Definition at line 1005 of file TRobustEstimator.cxx.
Referenced by Evaluate().
void TRobustEstimator::Evaluate | ( | ) |
Finds the estimate of multivariate mean and variance.
Definition at line 214 of file TRobustEstimator.cxx.
void TRobustEstimator::EvaluateUni | ( | Int_t | nvectors, |
Double_t * | data, | ||
Double_t & | mean, | ||
Double_t & | sigma, | ||
Int_t | hh = 0 |
||
) |
for the univariate case estimates of location and scatter are returned in mean and sigma parameters the algorithm works on the same principle as in multivariate case - it finds a subset of size hh with smallest sigma, and then returns mean and sigma of this subset
Definition at line 614 of file TRobustEstimator.cxx.
for the exact fit situaions returns number of observations on the hyperplane
Definition at line 1042 of file TRobustEstimator.cxx.
Referenced by Evaluate(), and Exact2().
|
protected |
This function is called if determinant of the covariance matrix of a subset=0.
If there are more then fH vectors on a hyperplane, returns this hyperplane and stops else stores the hyperplane coordinates in hyperplane matrix
Definition at line 1077 of file TRobustEstimator.cxx.
Referenced by Evaluate().
Int_t TRobustEstimator::GetBDPoint | ( | ) |
returns the breakdown point of the algorithm
Definition at line 680 of file TRobustEstimator.cxx.
returns the chi2 quantiles
Definition at line 690 of file TRobustEstimator.cxx.
void TRobustEstimator::GetCorrelation | ( | TMatrixDSym & | matr | ) |
returns the correlation matrix
Definition at line 711 of file TRobustEstimator.cxx.
|
inline |
Definition at line 91 of file TRobustEstimator.h.
void TRobustEstimator::GetCovariance | ( | TMatrixDSym & | matr | ) |
returns the covariance matrix
Definition at line 699 of file TRobustEstimator.cxx.
|
inline |
Definition at line 89 of file TRobustEstimator.h.
if the points are on a hyperplane, returns this hyperplane
Definition at line 736 of file TRobustEstimator.cxx.
const TVectorD * TRobustEstimator::GetHyperplane | ( | ) | const |
if the points are on a hyperplane, returns this hyperplane
Definition at line 723 of file TRobustEstimator.cxx.
return the estimate of the mean
Definition at line 752 of file TRobustEstimator.cxx.
|
inline |
Definition at line 96 of file TRobustEstimator.h.
|
inline |
Definition at line 94 of file TRobustEstimator.h.
Int_t TRobustEstimator::GetNOut | ( | ) |
returns the number of outliers
Definition at line 776 of file TRobustEstimator.cxx.
|
inline |
Definition at line 99 of file TRobustEstimator.h.
|
inline |
Definition at line 100 of file TRobustEstimator.h.
|
inline |
Definition at line 101 of file TRobustEstimator.h.
returns the robust distances (helps to find outliers)
Definition at line 764 of file TRobustEstimator.cxx.
|
inline |
Definition at line 98 of file TRobustEstimator.h.
|
protected |
because I need an Int_t work array
Definition at line 1273 of file TRobustEstimator.cxx.
Referenced by CreateOrtSubset(), CreateSubset(), and CStep().
divides the elements into approximately equal subgroups number of elements in each subgroup is stored in indsubdat number of subgroups is returned
Definition at line 1124 of file TRobustEstimator.cxx.
Referenced by Evaluate().
Calculates robust distances.Then the samples with robust distances greater than a cutoff value (0.975 quantile of chi2 distribution with fNvar degrees of freedom, multiplied by a correction factor), are given weiht=0, and new, reweighted estimates of location and scatter are calculated The function returns the number of outliers.
Definition at line 1178 of file TRobustEstimator.cxx.
Referenced by Evaluate().
Draws ngroup nonoverlapping subdatasets out of a dataset of size n such that the selected case numbers are uniformly distributed from 1 to n.
Definition at line 1241 of file TRobustEstimator.cxx.
Referenced by Evaluate().
|
protected |
Definition at line 39 of file TRobustEstimator.h.
Referenced by AddColumn(), Correl(), and GetCorrelation().
|
protected |
Definition at line 37 of file TRobustEstimator.h.
Referenced by AddColumn(), Classic(), Correl(), CreateOrtSubset(), CreateSubset(), CStep(), Evaluate(), Exact(), Exact2(), GetCovariance(), and RDist().
|
protected |
Definition at line 46 of file TRobustEstimator.h.
Referenced by AddColumn(), AddRow(), Classic(), Evaluate(), Exact(), Exact2(), and RDist().
|
protected |
Definition at line 34 of file TRobustEstimator.h.
Referenced by Evaluate(), Exact2(), GetHyperplane(), GetNHyp(), and TRobustEstimator().
|
protected |
Definition at line 28 of file TRobustEstimator.h.
Referenced by Evaluate(), Exact2(), GetBDPoint(), and TRobustEstimator().
|
protected |
Definition at line 43 of file TRobustEstimator.h.
Referenced by AddColumn(), CreateOrtSubset(), Evaluate(), Exact(), Exact2(), and GetHyperplane().
|
protected |
Definition at line 38 of file TRobustEstimator.h.
Referenced by AddColumn(), CreateSubset(), CStep(), and RDist().
|
protected |
Definition at line 36 of file TRobustEstimator.h.
Referenced by AddColumn(), Classic(), CreateOrtSubset(), CreateSubset(), CStep(), Evaluate(), Exact(), Exact2(), GetMean(), and RDist().
|
protected |
Definition at line 29 of file TRobustEstimator.h.
Referenced by AddColumn(), AddRow(), Classic(), Evaluate(), Exact(), Exact2(), GetBDPoint(), GetNumberObservations(), GetRDistances(), Partition(), RDist(), RDraw(), and TRobustEstimator().
|
protected |
Definition at line 27 of file TRobustEstimator.h.
Referenced by AddColumn(), AddRow(), AddToSscp(), Classic(), ClearSscp(), Correl(), Covar(), CreateOrtSubset(), CreateSubset(), CStep(), Evaluate(), Exact(), Exact2(), GetCorrelation(), GetCovariance(), GetHyperplane(), GetMean(), GetNvar(), RDist(), and TRobustEstimator().
|
protected |
Definition at line 42 of file TRobustEstimator.h.
Referenced by Evaluate(), GetNOut(), and GetOuliers().
|
protected |
Definition at line 40 of file TRobustEstimator.h.
Referenced by AddRow(), Evaluate(), GetRDistances(), and RDist().
|
protected |
Definition at line 41 of file TRobustEstimator.h.
Referenced by AddRow(), Classic(), CreateOrtSubset(), CreateSubset(), CStep(), Evaluate(), Exact2(), and RDist().
|
protected |
Definition at line 31 of file TRobustEstimator.h.
Referenced by AddColumn(), and TRobustEstimator().
|
protected |
Definition at line 32 of file TRobustEstimator.h.
Referenced by AddRow(), and TRobustEstimator().