Unit Disk and 2D Bounded KDE. The way to lengthen Bounded Kernel Density… | by Thomas Rouch | Jul, 2024

Photograph by SpaceX on Unsplash

KDE in remodeled area

The transformation trick maps the bounded knowledge to an unbounded area, the place the vanilla KDE might be safely utilized. This ends in utilizing a unique kernel perform for every enter pattern.

Nevertheless, as seen in earlier article Bounded Kernel Density Estimation, , when the density is non-zero on the boundary and doesn’t are inclined to infinity, it typically ends in undesirable artifacts.

Transformation

Building upon our strategy from the earlier part, we are going to once more use central symmetry and select a change f that alters solely the radius. Remodeled variables will likely be indicated with a tilde ~.

Nevertheless, in contrast to the reflection case, the place we preserved the unit disk and used the transformation solely so as to add new factors, right here we straight rework and use the factors from throughout the unit disk.

Thus the boundary situations are totally different and implement as a substitute to left the origin untouched and to dilate the disk to infinity.

Density Transformation

When making use of a change T to a multi-dimensional random variable U, the ensuing density is discovered by dividing by absolutely the worth of the determinant of the Jacobian matrix of T.

For example, the polar transformation provides us the next density.

Based mostly on the 2 earlier properties, we are able to derive the connection between the density earlier than and after the transformation. It will allow us to get well the true density from the density estimated on the remodeled factors.

Which transformation to decide on? Log, Inverse ?

Tlisted below are loads of features that begin from zero and enhance to infinity as they strategy 1. There isn’t any one-size-fits-all reply.

The determine beneath showcases potential candidate features created utilizing logarithmic and inverse transformations to introduce a singularity at r=-1 and r=1.

Examples of features that equal zero on the origin and have a tendency to infinity as they strategy +/-1 — Determine by the creator

Based mostly on the equation describing the remodeled density, we purpose to discover a transformation that maps the uniform distribution to a kind simply estimable by vanilla KDE. If we have now a uniform distribution p(x,y), the density in remodeled area is thus proportional to the perform g beneath.

Logarithmic and inverse candidates give the next g features.

They’re each equal when r approaches zero and solely converge to a significant worth when α is the same as one.

The determine beneath illustrates the three circumstances, with every column comparable to the log rework with alpha values of 0.5, 1 and a couple of.

The primary row exhibits the remodeled area, evaluating the density alongside the diagonal as estimated by the KDE on the remodeled factors (blue) towards the anticipated density profile comparable to the uniform distribution within the unique area (crimson). The second row shows these identical curves, however mapped again to the unique area.

Take into account that the transformation and KDE are nonetheless carried out in 2D on the disk. The one-dimensional curves proven beneath are extracted from the 2D outcomes.

Leave a Reply