From f5ce4354abb4645f7c0b9995bb495be4073e616c Mon Sep 17 00:00:00 2001 From: Sebastian Kosch Date: Fri, 26 Jun 2020 23:48:54 -0700 Subject: [PATCH] Move to point-mass-based convolution for the continuous-continuous case --- src/distPlus/distribution/Distributions.re | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/distPlus/distribution/Distributions.re b/src/distPlus/distribution/Distributions.re index 37823fa3..81b16cd8 100644 --- a/src/distPlus/distribution/Distributions.re +++ b/src/distPlus/distribution/Distributions.re @@ -173,10 +173,6 @@ module Continuous = { (); }; - Js.log2("Previous xyshape:", t |> getShape); - Js.log2("new pointmasssex", pointMassesX); - Js.log2("new pointmasssey", pointMassesY); - { xyShape: { xs: pointMassesX, @@ -364,7 +360,14 @@ module Continuous = { let t1d = downsampleIfTooLarge(t1); let t2d = downsampleIfTooLarge(t2); - convolveWithDiscrete(~downsample=false, fn, t1, toDiscretePointMasses(t2)); + let t1m = toDiscretePointMasses(t1); + let t2m = toDiscretePointMasses(t2); + + // then convolve the two as discrete distributions + let c = Discrete.convolve(fn, t1m, t2m); + + // then convert back to an approximate pdf + // TODO: find an efficient way to do this (kernel densities? trapezoids?) }; };