I have a problem where I heavily need to restrict the number of points at which I sample a function based on the values of a different function.

I have two functions:

  • $f:{\mathbb{R}\times [0,\infty)\times[0,\infty) }\rightarrow\mathbb{R}$, which is a probability density, generated on a set of data, using Gaussian kernels
  • $\sigma:\mathbb{R}^3\rightarrow\mathbb{R}$, which contains information about the quality of my model.

I try to evaluate to total quality of my model, by sampling points from the space $[a,b] \times [c,d] \times[e,f]$ and integrating over the product $f \cdot \sigma$. The intervals correspond to the natural boundaries of my data.
$f$ has at least two peaks, but could contain more interesting points, yet $f([a,b] \times [c,d] \times[e,f])$ evaluates to $0$ in most points. Now to the problem:
$f$ is relativeley easy to compute for a big amount of points, while $\sigma$ is computationally quite heavy. Therefore I try to find a way to sample $\sigma$ (or both functions) at fewer points, by using $f$ as a literal "density", sampling more points in regions of local extremes, or a higher probability density, while sampling fewer points in the regions where $f$ is $0$ or near $0$ anyway.

Is there a good/efficient way to do so? Main goal is avoiding skipping over intersting regions in $f$ while keeping the number of samples as low as possible. Bonus points: Is there MATLAB funtionality to do so, already?

  • 1
    $\begingroup$ This sounds to me like you want to do Monte Carlo integration. The way to do this is to run a Markov Chain with samples drawn from $f$, which will not contain any points where $f$ is zero and so you only have to evaluate $\sigma$ at points that actually matter. $\endgroup$ Commented Dec 21, 2022 at 2:56
  • $\begingroup$ I agree with @WolfgangBangerth. You are looking for some variant of Monte Carlo Integration where the sampling strategy adapts to a given distribution (en.wikipedia.org/wiki/VEGAS_algorithm ? ). $\endgroup$
    – MPIchael
    Commented Dec 21, 2022 at 7:47
  • $\begingroup$ My first intuition was to only sample from points where $f$ is not zero, too. Unfortunately I need $\sigma$ to calculate a prediction for my model, which should have at least some points in less dense regions. $s\sigma$ comes from a Gaussian process regression and is needed to calculate the a posteriori mean of the regression. $\endgroup$ Commented Dec 21, 2022 at 10:57
  • $\begingroup$ Would it be possible to create a 3D mesh of $[a,b] \times [c,d] \times[e,f]$, where the mesh density is adapted based on $f$ (with respect to a user-defined criterion that leaves the zone where $f$ is close to zero coarsely meshed), and then evaluated sigma in each of these adapted cells ? Maybe there are better adaptive quadrature techniques from which you can get sensible mesh points for $f$ and then use them for $\sigma$. $\endgroup$
    – Laurent90
    Commented Dec 21, 2022 at 14:21


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.