Class

NumCosmoMathStatsDistKernelST

Description [src]

final class NumCosmoMath.StatsDistKernelST : NumCosmoMath.StatsDistKernel
{
  /* No available fields */
}

An N-dimensional Student’s t kernel used to compute the kernel density estimation function (KDE) in the NcmStatsDist class.

This object defines a multivariate Student’s t kernel to be used in the NcmStatsDistKernel class. Also, this object implements the virtual methods of the NcmStatsDistKernel class. For more information about the class, check the documentation of NcmStatsDistKernel. Below, there are some definitions of the multivariate Student t distribution. For more information, check [On Sampling from the Multivariate t Distribution, Marius Hofert].

The multivariate t distribution with $\nu$ degrees of freedom has its stochastic representation as \begin{align} \label{st} \textbf{X} &= \mu + \sqrt{W} A \textbf{Z} ,\end{align} where $\textbf{Z}=(Z_1,Z_2,…,Z_n)$ is a $n$-dimension random vector whose components are independent normal random variables. $A$ is a $d \times n$ matrix, $\mu$ is a $d$-dimensional random vector that defines the mean of the distribution and $W=\frac{\nu}{\chi^2}$, being $\chi^2$ a random variable following a chi-squared distribution with $\nu > 0$ degrees of freedom. The covariance matrix is defined as $\Sigma = AA^T$, such that the distribution of $\textbf{X}$ is uniquely defined by its covariance matrix and the mean vector, that is, $\textbf{X} \sim t(\mu, \Sigma)$.

Assuming that $n=d$, the probability density function (pdf) of $\textbf{X}$ is \begin{align} \label{pdfst} f_{\textbf{X}(x)} = \frac{\Gamma\left(\frac{\nu + d}{2}\right)}{\Gamma\left(\frac{\nu}{2}\right)(2\pi)^{\frac{d}{2}} \sqrt{det \Sigma}} \left[1+\frac{(x-\mu)^T \Sigma^-1 (x-\mu)}{\nu}\right]^{-\frac{\nu + d}{2}} ,\end{align} considering that the covariance matrix is positive definite and $x \in \mathbb{R^d}$. Also, the covariance matrix can be decomposed in its Cholesky decomposition, \begin{align} \Sigma = LL^t ,\end{align} where $L$ is a triangular matrix with positive definite values. This decomposition can facilitate some computational calculations.

The $\sqrt{W}$ factor makes the multivariate t distribution more flexible than the multivariate Gaussian distribution, especially on its tails. Therefore, for problems that require a smoother function, the multivariate t kernell shall be used. Also, as seen in equation \eqref{st}, the Student’s t distribtuion can be generated using normal random variables, which makes the distribution easier to be generated. For the case $\nu \rightarrow \infty$, the multivariate t distribution becomes the Gaussian distribution.

This object uses the pdf given by equation \eqref{pdfst} to define a Student’s t kernel, such that it can generate points distributed by multivariate t distributions.

The user must provide the following input value: dim - ncm_stats_dist_kernel_st_new(). Once this object is initialized, the user can use the methods in the NcmStatsDistKernel class with this object.

Constructors

ncm_stats_dist_kernel_st_new

Creates a new NcmStatsDistKernelST object with sample dimension dim and $\nu$ = nu.

Functions

ncm_stats_dist_kernel_st_clear

Decrease the reference count of stats_dist_kernel_st by one, and sets the pointer *stats_dist_kernel_st to NULL.

Instance methods

ncm_stats_dist_kernel_st_free

Decrease the reference count of stats_dist_kernel_st by one.

ncm_stats_dist_kernel_st_get_nu
No description available.

ncm_stats_dist_kernel_st_ref

Increase the reference of stats_dist_kernel_st by one.

ncm_stats_dist_kernel_st_set_nu

Sets the over-smooth factor to nu.

Methods inherited from NcmStatsDistKernel (10)
ncm_stats_dist_kernel_eval_sum0_gamma_lambda

Computes the weighted sum of kernels at $\chi^2=$chi2 (the density estimator function), $$ e^\gamma (1+\lambda) = \sum_i w_i\bar{K} (\chi^2_i) / u_i,$$ where $\gamma = \ln(w_a\bar{K} (\chi^2_a) / u_a)$ and $a$ labels is the largest term of the sum. This function shall be used when each kernel has a different normalization factor.

ncm_stats_dist_kernel_eval_sum1_gamma_lambda

Computes the weighted sum of kernels at $\chi^2=$chi2 (the density estimator function), $$ e^\gamma (1+\lambda) = \sum_i w_i\bar{K} (\chi^2_i) / u,$$ where $\gamma = \ln(w_a\bar{K} (\chi^2_a) / u)$ and $a$ labels is the largest term of the sum. This function shall be used when all the kernels have the same normalization factor.

ncm_stats_dist_kernel_eval_unnorm

Computes the unnormalized kernel at $\chi^2=$chi2.

ncm_stats_dist_kernel_eval_unnorm_vec

Computes the unnormalized kernel at $\chi^2=$chi2 for all elements of chi2 and store the results at Ku.

ncm_stats_dist_kernel_free

Decrease the reference count of sdk by one.

ncm_stats_dist_kernel_get_dim

Gets current kernel dimension.

ncm_stats_dist_kernel_get_lnnorm

Computes the kernel normalization for a given covariance cov_decomp.

ncm_stats_dist_kernel_get_rot_bandwidth

Computes the rule-of-thumb bandwidth for a interpolation using n kernels.

ncm_stats_dist_kernel_ref

Increase the reference of sdk by one.

ncm_stats_dist_kernel_sample

Generates a random vector from the kernel distribution using the covariance cov_decomp, bandwidth href and location vector mu. The result is stored in y.

Methods inherited from GObject (43)

Please see GObject for a full list of methods.

Properties

NumCosmoMath.StatsDistKernelST:nu
No description available.

Properties inherited from NcmStatsDistKernel (1)
NumCosmoMath.StatsDistKernel:dimension
No description available.

Signals

Signals inherited from GObject (1)
GObject::notify

The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

Class structure

struct NumCosmoMathStatsDistKernelSTClass {
  NcmStatsDistKernelClass parent_class;
  
}

No description available.

Class members
parent_class: NcmStatsDistKernelClass

No description available.