NcmStatsDistKDE

NcmStatsDistKDE — Abstract class for implementing N-dimensional probability distributions with a fixed density estimator kernel.

Properties

guint nearPD-maxiter Read / Write / Construct

Object Hierarchy

    GObject
    ╰── NcmStatsDist
        ╰── NcmStatsDistKDE
            ╰── NcmStatsDistVKDE

Description

Abstract object to reconstruct an arbitrary N-dimensional probability distribution. This object provides the complementary tools to perform a radial basis interpolation in a multidimensional function using the NcmStatsDist class.

This object sets the kernel $\phi$ to be used in the radial basis interpolation. This object also implements some calculations needed in the NcmStatsDist class, such as the covariance matrix of the whole sample and its Cholesky decomposition, the preparation of the interpolation matrix $IM$, the kernel normalization factor, and given a sample vector $\vec{x}$, the distribution evaluated in these points. Some of these calculations are explained below.

The NcmStatsDistKDE class uses one covariance matrix for all the sample points. So, given $n$ points, there is only one covariance matrix $\Sigma$ that is used for all the $i$-th kernels $\phi(|x-x_i|, \Sigma)$. After the covariance matrix is computed, the algorithm computes the Cholesky decomposition, that is \begin{align} \Sigma &= AA^T ,\end{align} where $A$ is a triangular positive defined matrix and $A^T$ is its transpose. The $A$ matrix is used in the least square squares calculation method that is called in the NcmStatsDist class.

The object also prepares the interpolation matrix to be implemented in the least-squares problem, that is, given the relation

$\left[\begin{array}{cccc} \phi\left(\left\|\mathbf{x}_{1}-\mathbf{x}_{1}\right\|\right) & \phi\left(\left\|\mathbf{x}_{2}-\mathbf{x}_{1}\right\|\right) & \ldots & \phi\left(\left\|\mathbf{x}_{n}-\mathbf{x}_{1}\right\|\right) \newline \phi\left(\left\|\mathbf{x}_{1}-\mathbf{x}_{2}\right\|\right) & \phi\left(\left\|\mathbf{x}_{2}-\mathbf{x}_{2}\right\|\right) & \ldots & \phi\left(\left\|\mathbf{x}_{n}-\mathbf{x}_{2}\right\|\right) \newline \vdots & \vdots & & \vdots \newline \phi\left(\left\|\mathbf{x}_{1}-\mathbf{x}_{n}\right\|\right) & \phi\left(\left\|\mathbf{x}_{2}-\mathbf{x}_{n}\right\|\right) & \ldots & \phi\left(\left\|\mathbf{x}_{n}-\mathbf{x}_{n}\right\|\right) \end{array}\right]\left[\begin{array}{c} \lambda_{1} \newline \lambda_{2} \newline \vdots \newline \lambda_{n} \end{array}\right]=\left[\begin{array}{c} g_{1} \newline g_{2} \newline \vdots \newline g_{n} ,\end{array}\right]$

which is explained in the NcmStatsDist class, this object prepares the first matrix for all the $n$ points in the sample, using the covariance matrix and the defined kernel. The NcmStatsDist class implements the solution for this relation and then one can compute the distribution for a given vector $\vec{x}$ using a method of the NcmStatsDist class but that is implemented in this object.

The user must provide input the values: sdk , CV_type - ncm_stats_dist_kde_new(), y - ncm_stats_dist_add_obs(), split_frac - ncm_stats_dist_set_split_frac(), over_smooth - ncm_stats_dist_set_over_smooth(), $v(x)$ - ncm_stats_dist_prepare_interp(). To see an example of how to use this object and the main functions that are called within each function, check the fluxogram at the end of this documentation, where the order of the functions that should be called by the user and some of the functions that the algorithm calls.

kde_sketch

Functions

ncm_stats_dist_kde_new ()

NcmStatsDistKDE *
ncm_stats_dist_kde_new (NcmStatsDistKernel *sdk,
                        NcmStatsDistCV CV_type);

Creates a new NcmStatsDistKDE object using sdk as kernel and CV_type as cross-validation method.

Parameters

sdk

a NcmStatsDistKernel

 

CV_type

a NcmStatsDistCV

 

Returns

the newly created NcmStatsDistKDE object.

[transfer full]


ncm_stats_dist_kde_ref ()

NcmStatsDistKDE *
ncm_stats_dist_kde_ref (NcmStatsDistKDE *sdkde);

Increases the reference count of sdkde .

Parameters

sdkde

a NcmStatsDistKDE

 

Returns

sdkde .

[transfer full]


ncm_stats_dist_kde_free ()

void
ncm_stats_dist_kde_free (NcmStatsDistKDE *sdkde);

Decreases the reference count of sdkde .

Parameters

sdkde

a NcmStatsDistKDE

 

ncm_stats_dist_kde_clear ()

void
ncm_stats_dist_kde_clear (NcmStatsDistKDE **sdkde);

Decreases the reference count of *sdkde and sets the pointer *sdkde to NULL.

Parameters

sdkde

a NcmStatsDistKDE

 

ncm_stats_dist_kde_set_nearPD_maxiter ()

void
ncm_stats_dist_kde_set_nearPD_maxiter (NcmStatsDistKDE *sdkde,
                                       const guint maxiter);

Sets the maximum number of iterations when finding the nearest positive definite covariance matrix to maxiter . This function is implemented as a property and is called in the _cholesky_decomp and in the ncm_stats_dist_kde_prepare_kernel function.

Parameters

sdkde

a NcmStatsDistKDE

 

maxiter

maximum number of iterations

 

ncm_stats_dist_kde_get_nearPD_maxiter ()

guint
ncm_stats_dist_kde_get_nearPD_maxiter (NcmStatsDistKDE *sdkde);

Parameters

sdkde

a NcmStatsDistKDE

 

Returns

an int nearPD_maxiter, the maximum number of iterations when finding the nearest positive definite covariance matrix.

Property Details

The “nearPD-maxiter” property

  “nearPD-maxiter”           guint

Maximum number of iterations in the nearPD call.

Owner: NcmStatsDistKDE

Flags: Read / Write / Construct

Allowed values: >= 1

Default value: 200