Search code examples
root-framework

Smooth TGraph2D with kernel regression or similar?


I see that TGraphSmoother has Nadaraya-Watson kernel regression smoothing (and other forms of kernel-based smoothing). However, it looks to me like this will only work properly on a TGraph, not a TGraph2D.

Are there any tools appropriate for smoothing a TGraph2D? The data in my TGraph2D is noisy, so I need more than just interpolation. Or is the best choice to develop my own adaptation of the TGraphSmoother algorithm with support for TGraph2Ds?


Solution

  • There are some tool that can handle multi-dimensional pdf smoothing in RooFit, for example RooNDKeysPdf - see https://root.cern.ch/doc/master/classRooNDKeysPdf.html . To use it with a TGraph2D, the procedure would be to make a RooDataSet with a data point corresponding to each point in your graph, then use the createHistogram method to get a 2d histogram (TH2) of the smoothed distribution, from which you could re-create your graph. This might be overkill for your problem though..