Top |
NcmStatsDistKernelSTNcmStatsDistKernelST — An N-dimensional Student's t kernel used to compute the kernel density estimation function (KDE) in the NcmStatsDist class. |
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.
NcmStatsDistKernelST * ncm_stats_dist_kernel_st_new (const guint dim
,const gdouble nu
);
Creates a new NcmStatsDistKernelST object with sample dimension dim
and $\nu$ = nu
.
NcmStatsDistKernelST *
ncm_stats_dist_kernel_st_ref (NcmStatsDistKernelST *sdkst
);
Increase the reference of stats_dist_kernel_st
by one.
void
ncm_stats_dist_kernel_st_free (NcmStatsDistKernelST *sdkst
);
Decrease the reference count of stats_dist_kernel_st
by one.
void
ncm_stats_dist_kernel_st_clear (NcmStatsDistKernelST **sdkst
);
Decrease the reference count of stats_dist_kernel_st
by one, and sets the pointer *stats_dist_kernel_st
to
NULL.
void ncm_stats_dist_kernel_st_set_nu (NcmStatsDistKernelST *sdkst
,const gdouble nu
);
Sets the over-smooth factor to nu
.
gdouble
ncm_stats_dist_kernel_st_get_nu (NcmStatsDistKernelST *sdkst
);