densities_tt = {
const a = [];
["Talk type A", "Talk type B"].forEach((d, i) => {
const raw = talk_type
.filter((f) => f["Talk_Type"] === d)
.map((g) => parseInt(g["Honoraria_Value"]))
.sort((a, b) => a - b);
const data2 = kde(epanechnikov(bwEstimate(raw)), raw)(raw);
data2.forEach((f) =>
a.push({
value: f[0],
weight: f[1],
"Honoraria Type": d,
index: i,
resp: talk_type.filter(
(item) =>
item["Talk_Type"] === d &&
parseInt(item["Honoraria_Value"]) === f[0]
).length,
m: d3.median(raw)
})
);
});
return a;
}