Example of using the TKDE class (kernel density estimator)
void exampleTKDE(int n = 1000) {
int nbin = 100;
double xmin = 0;
double xmax = 10;
TH1D * h1 =
new TH1D(
"h1",
"h1",nbin,xmin,xmax);
std::vector<double>
data(n);
for (
int i = 0; i <
n; ++i) {
if (i < 0.4*n) {
}
else {
}
}
TF1 * f1 =
new TF1(
"f1",
"0.4*ROOT::Math::normal_pdf(x,1,2)+0.6*ROOT::Math::normal_pdf(x,1.5,7)",xmin,xmax);
double rho = 1.0;
TKDE * kde =
new TKDE(n, &data[0], xmin,xmax,
"", rho);
}
- Authors
- Lorenzo Moneta, Bartolomeu Rabacal (Dec 2010)
Definition in file exampleTKDE.C.