Direct Space Interface

This module contains low level functions for operating on arrays in the original (spatial) domain. These include:

ParallelKDE.DirectSpace.initialize_dirac_sequenceFunction
initialize_dirac_sequence(data; kwargs...)

Create a Dirac sequence based on the provided data points.

Arguments

  • data: A matrix or vector of data points, where each column represents a sample.
  • grid: (optional) A grid object defining the grid on which the Dirac sequence is initialized.
  • bootstrap_idxs: (optional) A matrix of indices for bootstrap resampling.
  • device: (optional) The device type to use for computation, default is :cpu.
  • method: (optional) The method to use for computation, default is determined by the device.
  • include_var: (optional) If true, includes variance in the Dirac sequence, default is false.
  • T: (optional) The type of the elements in the Dirac sequence, default is Float64 for CPU and Float32 for CUDA.
ParallelKDE.DirectSpace.calculate_scaled_vmr!Function
calculate_scaled_vmr!(
  method::Val{device},
  sk::AbstractArray{Complex{T},M},
  s2k::AbstractArray{Complex{T},M},
  time::AbstractVector{<:Real},
  time_initial::AbstractVector{<:Real},
  n_samples::Integer
)

Calculate the scaled variance-to-mean ratio (VMR) for an array of kernel means and kernel variances.

ParallelKDE.DirectSpace.identify_convergence!Function
identify_convergence!

Identify the points in the grid that have converged based on the variance-to-mean ratio (VMR) and update the density accordingly.

Arguments

  • Val(Symbol): The method type, e.g., :serial, :threaded, or :cuda.
  • density: The density array to be updated.
  • means: The means array corresponding to the density.
  • vmrs_current: The current VMR values.
  • vmrs_prev1: The previous VMR values.
  • vmrs_prev2: The VMR values from two steps back.
  • dlogt: The logarithmic time step.
  • tol_low_id: The tolerance to identify low density regions.
  • steps_low: The number of steps to consider for threshold crossing to avoid effects of noise.
  • steps_over: The number of steps to consider without updates to declare convergence.
  • current_minima: The current minima array to be updated.
  • counters_low: The counter to identify low density regions.
  • counters_over: The counter to identify over-smoothing of high density regions.
  • low_density_flags: Flags indicating low density regions.