%% Generated by Sphinx.
\def\sphinxdocclass{report}
\documentclass[letterpaper,10pt,english,openany,oneside]{sphinxmanual}
\ifdefined\pdfpxdimen
   \let\sphinxpxdimen\pdfpxdimen\else\newdimen\sphinxpxdimen
\fi \sphinxpxdimen=.75bp\relax
\ifdefined\pdfimageresolution
    \pdfimageresolution= \numexpr \dimexpr1in\relax/\sphinxpxdimen\relax
\fi
%% let collapsible pdf bookmarks panel have high depth per default
\PassOptionsToPackage{bookmarksdepth=5}{hyperref}

\PassOptionsToPackage{booktabs}{sphinx}
\PassOptionsToPackage{colorrows}{sphinx}

\PassOptionsToPackage{warn}{textcomp}
\usepackage[utf8]{inputenc}
\ifdefined\DeclareUnicodeCharacter
% support both utf8 and utf8x syntaxes
  \ifdefined\DeclareUnicodeCharacterAsOptional
    \def\sphinxDUC#1{\DeclareUnicodeCharacter{"#1}}
  \else
    \let\sphinxDUC\DeclareUnicodeCharacter
  \fi
  \sphinxDUC{00A0}{\nobreakspace}
  \sphinxDUC{2500}{\sphinxunichar{2500}}
  \sphinxDUC{2502}{\sphinxunichar{2502}}
  \sphinxDUC{2514}{\sphinxunichar{2514}}
  \sphinxDUC{251C}{\sphinxunichar{251C}}
  \sphinxDUC{2572}{\textbackslash}
\fi
\usepackage{cmap}
\usepackage[T1]{fontenc}
\usepackage{amsmath,amssymb,amstext}
\usepackage{babel}



\usepackage{tgtermes}
\usepackage{tgheros}
\renewcommand{\ttdefault}{txtt}



\usepackage[Bjarne]{fncychap}
\usepackage{sphinx}

\fvset{fontsize=auto}
\usepackage{geometry}

\usepackage{nbsphinx}

% Include hyperref last.
\usepackage{hyperref}
% Fix anchor placement for figures with captions.
\usepackage{hypcap}% it must be loaded after hyperref.
% Set up styles of URL: it should be placed after hyperref.
\urlstyle{same}


\usepackage{sphinxmessages}
\setcounter{tocdepth}{3}
\setcounter{secnumdepth}{3}


\title{QuadratiK}
\date{Jan 31, 2024}
\release{1.0.0}
\author{Giovanni Saraceno, Marianthi Markatou, \and Raktim Mukhopadhyay, Mojgan Golzy}
\newcommand{\sphinxlogo}{\vbox{}}
\renewcommand{\releasename}{Release}
\makeindex
\begin{document}

\ifdefined\shorthandoff
  \ifnum\catcode`\=\string=\active\shorthandoff{=}\fi
  \ifnum\catcode`\"=\active\shorthandoff{"}\fi
\fi

\pagestyle{empty}
\sphinxmaketitle
\pagestyle{plain}
\sphinxtableofcontents
\pagestyle{normal}
\phantomsection\label{\detokenize{index::doc}}



\chapter{Introduction}
\label{\detokenize{index:introduction}}
\sphinxAtStartPar
The QuadratiK package is implemented in both \sphinxstylestrong{R} and \sphinxstylestrong{Python}, providing a comprehensive set of goodness\sphinxhyphen{}of\sphinxhyphen{}fit tests and a clustering technique using kernel\sphinxhyphen{}based quadratic distances. This framework aims to bridge the gap between the statistical and machine learning literatures. It includes:
\begin{itemize}
\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Goodness\sphinxhyphen{}of\sphinxhyphen{}Fit Tests} : The software implements one, two, and k\sphinxhyphen{}sample tests for goodness of fit, offering an efficient and mathematically sound way to assess the fit of probability distributions. Expanded capabilities include supporting tests for uniformity on the \(d\)\sphinxhyphen{}dimensional Sphere based on Poisson kernel densities.

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Clustering Algorithm for Spherical Data}: the package incorporates a unique clustering algorithm specifically tailored for spherical data. This algorithm leverages a mixture of Poisson\sphinxhyphen{}kernel\sphinxhyphen{}based densities on the sphere, enabling effective clustering of spherical data or data that has been spherically transformed. This facilitates the uncovering of underlying patterns and relationships in the data.

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Additional Features}: Alongside these functionalities, the software includes additional graphical functions, aiding users in validating cluster results as well as visualizing and representing clustering results. This enhances the interpretability and usability of the analysis.

\end{itemize}


\section{Funding Information}
\label{\detokenize{index:funding-information}}
\sphinxAtStartPar
The work has been supported by Kaleida Health Foundation, Food and Drug Administration, and Department of Biostatistics, University at Buffalo.


\section{Authors}
\label{\detokenize{index:authors}}
\sphinxAtStartPar
Giovanni Saraceno \textless{}\sphinxhref{mailto:gsaracen@buffalo.edu}{gsaracen@buffalo.edu}\textgreater{}, Marianthi Markatou \textless{}\sphinxhref{mailto:markatou@buffalo.edu}{markatou@buffalo.edu}\textgreater{}, Raktim Mukhopadhyay \textless{}\sphinxhref{mailto:raktimmu@buffalo.edu}{raktimmu@buffalo.edu}\textgreater{}, Mojgan Golzy \textless{}\sphinxhref{mailto:golzym@health.missouri.edu}{golzym@health.missouri.edu}\textgreater{}

\sphinxAtStartPar
Mantainer: Raktim Mukhopadhyay \textless{}\sphinxhref{mailto:raktimmu@buffalo.edu}{raktimmu@buffalo.edu}\textgreater{}


\section{References}
\label{\detokenize{index:references}}
\sphinxAtStartPar
Saraceno G., Markatou M., Mukhopadhyay R., Golzy M. (2023). Goodness of\sphinxhyphen{}
fit and clustering of spherical data: The QuadratiK package in R and Python. Technical Report,
Department of Biostatistics, University at Buffalo.

\sphinxAtStartPar
Ding Y., Markatou M., Saraceno G. (2023). “Poisson Kernel\sphinxhyphen{}Based Tests for
Uniformity on the d\sphinxhyphen{}Dimensional Sphere.” Statistica Sinica. doi: doi:10.5705/ss.202022.0347.

\sphinxAtStartPar
Golzy M. \& Markatou M. (2020) Poisson Kernel\sphinxhyphen{}Based Clustering on the Sphere:
Convergence Properties, Identifiability, and a Method of Sampling, Journal of Computational and
Graphical Statistics, 29:4, 758\sphinxhyphen{}770, DOI: 10.1080/10618600.2020.1740713.

\sphinxAtStartPar
Markatou M, Saraceno G, Chen Y (2023). “Two\sphinxhyphen{} and k\sphinxhyphen{}Sample Tests Based on Quadratic Distances.”
Manuscript, (Department of Biostatistics, University at Buffalo).


\chapter{Getting started}
\label{\detokenize{index:id1}}
\sphinxstepscope


\section{Getting Started}
\label{\detokenize{getting_started/index:getting-started}}\label{\detokenize{getting_started/index::doc}}
\sphinxstepscope


\subsection{Installation}
\label{\detokenize{getting_started/installation:installation}}\label{\detokenize{getting_started/installation::doc}}

\subsubsection{Which Python?}
\label{\detokenize{getting_started/installation:which-python}}\label{\detokenize{getting_started/installation:id1}}
\sphinxAtStartPar
You’ll need \sphinxstylestrong{Python 3.9 (except 3.9.7) or greater}.


\subsubsection{Install using \sphinxstyleliteralintitle{\sphinxupquote{pip}}}
\label{\detokenize{getting_started/installation:install-using-pip}}
\sphinxAtStartPar
\sphinxcode{\sphinxupquote{pip install /path/to/package}}


\subsubsection{Dependencies}
\label{\detokenize{getting_started/installation:dependencies}}
\sphinxAtStartPar
QuadratiK requires the following (arranged alphabetically):
\begin{itemize}
\item {} 
\sphinxAtStartPar
\sphinxhref{https://peps.python.org/pep-3156/}{asyncio} (\textgreater{}=3.4)

\item {} 
\sphinxAtStartPar
\sphinxhref{https://matplotlib.org/}{matplotlib} (\textgreater{}=3.8.2)

\item {} 
\sphinxAtStartPar
\sphinxhref{https://github.com/erdewit/nest\_asyncio}{nest\sphinxhyphen{}asyncio} (\textgreater{}=1.5)

\item {} 
\sphinxAtStartPar
\sphinxhref{https://numpy.org/}{numpy}  (\textgreater{}= 1.26.2)

\item {} 
\sphinxAtStartPar
\sphinxhref{https://pandas.pydata.org/docs/index.html}{pandas} (\textgreater{}= 2.1.3)

\item {} 
\sphinxAtStartPar
\sphinxhref{https://plotly.com/python/}{plotly} (\textgreater{}=5.15.0)

\item {} 
\sphinxAtStartPar
\sphinxhref{https://scikit-learn.org/stable/}{scikit\sphinxhyphen{}learn} (\textgreater{}= 1.3)

\item {} 
\sphinxAtStartPar
\sphinxhref{https://docs.scipy.org/doc/scipy/reference/}{scipy} (\textgreater{}= 1.11)

\item {} 
\sphinxAtStartPar
\sphinxhref{https://streamlit.io/}{streamlit} (\textgreater{}=1.29.0)

\item {} 
\sphinxAtStartPar
\sphinxhref{https://github.com/astanin/python-tabulate}{tabulate} (\textgreater{}= 0.8)

\end{itemize}


\subsubsection{Testing}
\label{\detokenize{getting_started/installation:testing}}
\sphinxAtStartPar
QuadratiK uses the Python \sphinxcode{\sphinxupquote{pytest}} package.
To install \sphinxcode{\sphinxupquote{pytest}}, please go \sphinxhref{https://docs.pytest.org/en/latest/getting-started.html\#}{here}.
To run the tests using \sphinxcode{\sphinxupquote{pytest}}, please follow these \sphinxhref{https://docs.pytest.org/en/latest/how-to/usage.html}{instructions}.
Navigate to the tests folder to run the tests.


\chapter{API Reference}
\label{\detokenize{index:id2}}
\sphinxstepscope


\section{API Reference}
\label{\detokenize{api_reference/index:module-QuadratiK.kernel_test}}\label{\detokenize{api_reference/index:id1}}\label{\detokenize{api_reference/index:api-reference}}\label{\detokenize{api_reference/index::doc}}\index{module@\spxentry{module}!QuadratiK.kernel\_test@\spxentry{QuadratiK.kernel\_test}}\index{QuadratiK.kernel\_test@\spxentry{QuadratiK.kernel\_test}!module@\spxentry{module}}

\subsection{Kernel Test}
\label{\detokenize{api_reference/index:kernel-test}}

\begin{savenotes}\sphinxattablestart
\sphinxthistablewithglobalstyle
\sphinxthistablewithnovlinesstyle
\centering
\begin{tabulary}{\linewidth}[t]{\X{1}{2}\X{1}{2}}
\sphinxtoprule
\sphinxtableatstartofbodyhook
\sphinxAtStartPar
{\hyperref[\detokenize{api_reference/generated/QuadratiK.kernel_test.KernelTest:QuadratiK.kernel_test.KernelTest}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{KernelTest}}}}}({[}h, method, num\_iter, b, ...{]})
&
\sphinxAtStartPar
Class for performing the kernel\sphinxhyphen{}based quadratic distance Goodness\sphinxhyphen{}of\sphinxhyphen{}fit tests using  the Gaussian kernel with tuning parameter h.
\\
\sphinxhline
\sphinxAtStartPar
{\hyperref[\detokenize{api_reference/generated/QuadratiK.kernel_test.select_h:QuadratiK.kernel_test.select_h}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{select\_h}}}}}(x{[}, y, alternative, method, b, ...{]})
&
\sphinxAtStartPar
This function computes the kernel bandwidth of the Gaussian kernel for the  one sample, two\sphinxhyphen{}sample and ksample kernel\sphinxhyphen{}based quadratic distance (KBQD) tests.
\\
\sphinxbottomrule
\end{tabulary}
\sphinxtableafterendhook\par
\sphinxattableend\end{savenotes}

\sphinxstepscope


\subsubsection{KernelTest}
\label{\detokenize{api_reference/generated/QuadratiK.kernel_test.KernelTest:kerneltest}}\label{\detokenize{api_reference/generated/QuadratiK.kernel_test.KernelTest::doc}}\index{KernelTest (class in QuadratiK.kernel\_test)@\spxentry{KernelTest}\spxextra{class in QuadratiK.kernel\_test}}

\begin{fulllineitems}
\phantomsection\label{\detokenize{api_reference/generated/QuadratiK.kernel_test.KernelTest:QuadratiK.kernel_test.KernelTest}}
\pysigstartsignatures
\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class\DUrole{w}{ }}}\sphinxcode{\sphinxupquote{QuadratiK.kernel\_test.}}\sphinxbfcode{\sphinxupquote{KernelTest}}}{\sphinxparam{\DUrole{n}{h}\DUrole{o}{=}\DUrole{default_value}{None}}\sphinxparamcomma \sphinxparam{\DUrole{n}{method}\DUrole{o}{=}\DUrole{default_value}{\textquotesingle{}subsampling\textquotesingle{}}}\sphinxparamcomma \sphinxparam{\DUrole{n}{num\_iter}\DUrole{o}{=}\DUrole{default_value}{150}}\sphinxparamcomma \sphinxparam{\DUrole{n}{b}\DUrole{o}{=}\DUrole{default_value}{0.9}}\sphinxparamcomma \sphinxparam{\DUrole{n}{quantile}\DUrole{o}{=}\DUrole{default_value}{0.95}}\sphinxparamcomma \sphinxparam{\DUrole{n}{mu\_hat}\DUrole{o}{=}\DUrole{default_value}{None}}\sphinxparamcomma \sphinxparam{\DUrole{n}{sigma\_hat}\DUrole{o}{=}\DUrole{default_value}{None}}\sphinxparamcomma \sphinxparam{\DUrole{n}{centering\_type}\DUrole{o}{=}\DUrole{default_value}{\textquotesingle{}nonparam\textquotesingle{}}}\sphinxparamcomma \sphinxparam{\DUrole{n}{alternative}\DUrole{o}{=}\DUrole{default_value}{None}}\sphinxparamcomma \sphinxparam{\DUrole{n}{k\_threshold}\DUrole{o}{=}\DUrole{default_value}{10}}\sphinxparamcomma \sphinxparam{\DUrole{n}{random\_state}\DUrole{o}{=}\DUrole{default_value}{None}}\sphinxparamcomma \sphinxparam{\DUrole{n}{n\_jobs}\DUrole{o}{=}\DUrole{default_value}{8}}}{}
\pysigstopsignatures
\sphinxAtStartPar
Class for performing the kernel\sphinxhyphen{}based quadratic distance goodness\sphinxhyphen{}of\sphinxhyphen{}fit tests using 
the Gaussian kernel with tuning parameter h. Depending on the input \sphinxtitleref{y} the function performs
the test of multivariate normality, the non\sphinxhyphen{}parametric two\sphinxhyphen{}sample tests or the k\sphinxhyphen{}sample tests.


\paragraph{Parameters}
\label{\detokenize{api_reference/generated/QuadratiK.kernel_test.KernelTest:parameters}}\begin{quote}
\begin{description}
\sphinxlineitem{h}{[}float, optional{]}
\sphinxAtStartPar
Bandwidth for the kernel function.

\sphinxlineitem{method}{[}str, optional{]}
\sphinxAtStartPar
The method used for critical value estimation (“subsampling”, “bootstrap”, 
or “permutation”).

\sphinxlineitem{num\_iter}{[}int, optional{]}
\sphinxAtStartPar
The number of iterations to use for critical value estimation. Defaults to 150.

\sphinxlineitem{b}{[}float, optional{]}
\sphinxAtStartPar
The size of the subsamples used in the subsampling algorithm. Defaults to 0.9.

\sphinxlineitem{quantile}{[}float, optional{]}
\sphinxAtStartPar
The quantile to use for critical value estimation. Defaults to 0.95.

\sphinxlineitem{mu\_hat}{[}numpy.ndarray, optional{]}
\sphinxAtStartPar
Mean vector for the reference distribution. Defaults to None.

\sphinxlineitem{sigma\_hat}{[}numpy.ndarray, optional{]}
\sphinxAtStartPar
Covariance matrix of the reference distribution. Defaults to None.

\sphinxlineitem{alternative}{[}str, optional{]}
\sphinxAtStartPar
String indicating the type of alternative to be used for calculating “h” 
by the tuning parameter selection algorithm when h is not provided.
Defaults to ‘None’

\sphinxlineitem{k\_threshold}{[}int, optional{]}
\sphinxAtStartPar
Maximum number of groups allowed. Defaults to 10. Change in case of more than 10 groups.

\sphinxlineitem{random\_state}{[}int, None, optional. {]}
\sphinxAtStartPar
Seed for random number generation. Defaults to None

\sphinxlineitem{n\_jobs}{[}int, optional. {]}
\sphinxAtStartPar
n\_jobs specifies the maximum number of concurrently 
running workers. If 1 is given, no joblib parallelism 
is used at all, which is useful for debugging. For more 
information on joblib n\_jobs refer to \sphinxhyphen{} 
\sphinxurl{https://joblib.readthedocs.io/en/latest/generated/joblib.Parallel.html}.
Defaults to 8.

\end{description}
\end{quote}


\paragraph{Attributes}
\label{\detokenize{api_reference/generated/QuadratiK.kernel_test.KernelTest:attributes}}\begin{quote}
\begin{description}
\sphinxlineitem{test\_type\_}{[}str{]}
\sphinxAtStartPar
The type of test performed on the data

\sphinxlineitem{execution\_time}{[}float{]}
\sphinxAtStartPar
Time taken for the test method to execute

\sphinxlineitem{h0\_rejected\_}{[}boolean{]}
\sphinxAtStartPar
Whether the null hypothesis is rejected (True) or not (False)

\sphinxlineitem{test\_statistic\_}{[}float{]}
\sphinxAtStartPar
Test statistic of the perfomed test type

\sphinxlineitem{cv\_}{[}float{]}
\sphinxAtStartPar
Critical value

\sphinxlineitem{cv\_method\_}{[}str{]}
\sphinxAtStartPar
Critical value method used for performing the test

\end{description}
\end{quote}


\paragraph{References}
\label{\detokenize{api_reference/generated/QuadratiK.kernel_test.KernelTest:references}}\begin{quote}

\sphinxAtStartPar
Markatou M., Saraceno G., Chen Y (2023). “Two\sphinxhyphen{} and k\sphinxhyphen{}Sample Tests Based on Quadratic Distances.
”Manuscript, (Department of Biostatistics, University at Buffalo)

\sphinxAtStartPar
Lindsay BG, Markatou M. \& Ray S. (2014) Kernels, Degrees of Freedom, and 
Power Properties of Quadratic Distance Goodness\sphinxhyphen{}of\sphinxhyphen{}Fit Tests, Journal of the American Statistical
Association, 109:505, 395\sphinxhyphen{}410, DOI: 10.1080/01621459.2013.836972
\end{quote}


\paragraph{Examples}
\label{\detokenize{api_reference/generated/QuadratiK.kernel_test.KernelTest:examples}}
\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{c+c1}{\PYGZsh{} Example for normality test}
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{k+kn}{import} \PYG{n+nn}{numpy} \PYG{k}{as} \PYG{n+nn}{np}
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{k+kn}{from} \PYG{n+nn}{QuadratiK}\PYG{n+nn}{.}\PYG{n+nn}{kernel\PYGZus{}test} \PYG{k+kn}{import} \PYG{n}{KernelTest}
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{np}\PYG{o}{.}\PYG{n}{random}\PYG{o}{.}\PYG{n}{seed}\PYG{p}{(}\PYG{l+m+mi}{42}\PYG{p}{)}
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{data} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{random}\PYG{o}{.}\PYG{n}{randn}\PYG{p}{(}\PYG{l+m+mi}{100}\PYG{p}{,}\PYG{l+m+mi}{5}\PYG{p}{)}
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{normality\PYGZus{}test} \PYG{o}{=} \PYG{n}{KernelTest}\PYG{p}{(}\PYG{n}{h}\PYG{o}{=}\PYG{l+m+mf}{0.4}\PYG{p}{,} \PYG{n}{centering\PYGZus{}type}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{param}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}\PYG{n}{random\PYGZus{}state}\PYG{o}{=}\PYG{l+m+mi}{42}\PYG{p}{)}\PYG{o}{.}\PYG{n}{test}\PYG{p}{(}\PYG{n}{data}\PYG{p}{)}
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n+nb}{print}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{Test : }\PYG{l+s+si}{\PYGZob{}\PYGZcb{}}\PYG{l+s+s2}{\PYGZdq{}}\PYG{o}{.}\PYG{n}{format}\PYG{p}{(}\PYG{n}{normality\PYGZus{}test}\PYG{o}{.}\PYG{n}{test\PYGZus{}type\PYGZus{}}\PYG{p}{)}\PYG{p}{)}
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n+nb}{print}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{Execution time: }\PYG{l+s+si}{\PYGZob{}:.3f\PYGZcb{}}\PYG{l+s+s2}{\PYGZdq{}}\PYG{o}{.}\PYG{n}{format}\PYG{p}{(}\PYG{n}{normality\PYGZus{}test}\PYG{o}{.}\PYG{n}{execution\PYGZus{}time}\PYG{p}{)}\PYG{p}{)}
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n+nb}{print}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{H0 is Rejected : }\PYG{l+s+si}{\PYGZob{}\PYGZcb{}}\PYG{l+s+s2}{\PYGZdq{}}\PYG{o}{.}\PYG{n}{format}\PYG{p}{(}\PYG{n}{normality\PYGZus{}test}\PYG{o}{.}\PYG{n}{h0\PYGZus{}rejected\PYGZus{}}\PYG{p}{)}\PYG{p}{)}
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n+nb}{print}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{Test Statistic : }\PYG{l+s+si}{\PYGZob{}\PYGZcb{}}\PYG{l+s+s2}{\PYGZdq{}}\PYG{o}{.}\PYG{n}{format}\PYG{p}{(}\PYG{n}{normality\PYGZus{}test}\PYG{o}{.}\PYG{n}{test\PYGZus{}statistic\PYGZus{}}\PYG{p}{)}\PYG{p}{)}
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n+nb}{print}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{Critical Value (CV) : }\PYG{l+s+si}{\PYGZob{}\PYGZcb{}}\PYG{l+s+s2}{\PYGZdq{}}\PYG{o}{.}\PYG{n}{format}\PYG{p}{(}\PYG{n}{normality\PYGZus{}test}\PYG{o}{.}\PYG{n}{cv\PYGZus{}}\PYG{p}{)}\PYG{p}{)}
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n+nb}{print}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{CV Method : }\PYG{l+s+si}{\PYGZob{}\PYGZcb{}}\PYG{l+s+s2}{\PYGZdq{}}\PYG{o}{.}\PYG{n}{format}\PYG{p}{(}\PYG{n}{normality\PYGZus{}test}\PYG{o}{.}\PYG{n}{cv\PYGZus{}method\PYGZus{}}\PYG{p}{)}\PYG{p}{)}
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n+nb}{print}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{Selected tuning parameter : }\PYG{l+s+si}{\PYGZob{}\PYGZcb{}}\PYG{l+s+s2}{\PYGZdq{}}\PYG{o}{.}\PYG{n}{format}\PYG{p}{(}\PYG{n}{normality\PYGZus{}test}\PYG{o}{.}\PYG{n}{h}\PYG{p}{)}\PYG{p}{)}
\PYG{g+gp}{... }\PYG{n}{Test} \PYG{p}{:} \PYG{n}{Kernel}\PYG{o}{\PYGZhy{}}\PYG{n}{based} \PYG{n}{quadratic} \PYG{n}{distance} \PYG{n}{Normality} \PYG{n}{test}
\PYG{g+gp}{... }\PYG{n}{Execution} \PYG{n}{time}\PYG{p}{:} \PYG{l+m+mf}{0.096}
\PYG{g+gp}{... }\PYG{n}{H0} \PYG{o+ow}{is} \PYG{n}{Rejected} \PYG{p}{:} \PYG{k+kc}{False}
\PYG{g+gp}{... }\PYG{n}{Test} \PYG{n}{Statistic} \PYG{p}{:} \PYG{o}{\PYGZhy{}}\PYG{l+m+mf}{8.588873037044384e\PYGZhy{}05}
\PYG{g+gp}{... }\PYG{n}{Critical} \PYG{n}{Value} \PYG{p}{(}\PYG{n}{CV}\PYG{p}{)} \PYG{p}{:} \PYG{l+m+mf}{0.0004464111809800183}
\PYG{g+gp}{... }\PYG{n}{CV} \PYG{n}{Method} \PYG{p}{:} \PYG{n}{Empirical}
\PYG{g+gp}{... }\PYG{n}{Selected} \PYG{n}{tuning} \PYG{n}{parameter} \PYG{p}{:} \PYG{l+m+mf}{0.4}
\end{sphinxVerbatim}

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{c+c1}{\PYGZsh{} Example for two sample test}
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{k+kn}{import} \PYG{n+nn}{numpy} \PYG{k}{as} \PYG{n+nn}{np}
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{k+kn}{from} \PYG{n+nn}{QuadratiK}\PYG{n+nn}{.}\PYG{n+nn}{kernel\PYGZus{}test} \PYG{k+kn}{import} \PYG{n}{KernelTest}
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{np}\PYG{o}{.}\PYG{n}{random}\PYG{o}{.}\PYG{n}{seed}\PYG{p}{(}\PYG{l+m+mi}{42}\PYG{p}{)}
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{X} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{random}\PYG{o}{.}\PYG{n}{randn}\PYG{p}{(}\PYG{l+m+mi}{100}\PYG{p}{,}\PYG{l+m+mi}{5}\PYG{p}{)}
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{np}\PYG{o}{.}\PYG{n}{random}\PYG{o}{.}\PYG{n}{seed}\PYG{p}{(}\PYG{l+m+mi}{42}\PYG{p}{)}
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{Y} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{random}\PYG{o}{.}\PYG{n}{randn}\PYG{p}{(}\PYG{l+m+mi}{100}\PYG{p}{,}\PYG{l+m+mi}{5}\PYG{p}{)}
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{two\PYGZus{}sample\PYGZus{}test} \PYG{o}{=} \PYG{n}{KernelTest}\PYG{p}{(}\PYG{n}{h}\PYG{o}{=}\PYG{l+m+mf}{0.4}\PYG{p}{,} \PYG{n}{centering\PYGZus{}type}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{param}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{)}\PYG{o}{.}\PYG{n}{test}\PYG{p}{(}\PYG{n}{X}\PYG{p}{,}\PYG{n}{Y}\PYG{p}{)}
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n+nb}{print}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{Test : }\PYG{l+s+si}{\PYGZob{}\PYGZcb{}}\PYG{l+s+s2}{\PYGZdq{}}\PYG{o}{.}\PYG{n}{format}\PYG{p}{(}\PYG{n}{two\PYGZus{}sample\PYGZus{}test}\PYG{o}{.}\PYG{n}{test\PYGZus{}type\PYGZus{}}\PYG{p}{)}\PYG{p}{)}
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n+nb}{print}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{Execution time: }\PYG{l+s+si}{\PYGZob{}:.3f\PYGZcb{}}\PYG{l+s+s2}{\PYGZdq{}}\PYG{o}{.}\PYG{n}{format}\PYG{p}{(}\PYG{n}{two\PYGZus{}sample\PYGZus{}test}\PYG{o}{.}\PYG{n}{execution\PYGZus{}time}\PYG{p}{)}\PYG{p}{)}
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n+nb}{print}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{H0 is Rejected : }\PYG{l+s+si}{\PYGZob{}\PYGZcb{}}\PYG{l+s+s2}{\PYGZdq{}}\PYG{o}{.}\PYG{n}{format}\PYG{p}{(}\PYG{n}{two\PYGZus{}sample\PYGZus{}test}\PYG{o}{.}\PYG{n}{h0\PYGZus{}rejected\PYGZus{}}\PYG{p}{)}\PYG{p}{)}
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n+nb}{print}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{Test Statistic : }\PYG{l+s+si}{\PYGZob{}\PYGZcb{}}\PYG{l+s+s2}{\PYGZdq{}}\PYG{o}{.}\PYG{n}{format}\PYG{p}{(}\PYG{n}{two\PYGZus{}sample\PYGZus{}test}\PYG{o}{.}\PYG{n}{test\PYGZus{}statistic\PYGZus{}}\PYG{p}{)}\PYG{p}{)}
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n+nb}{print}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{Critical Value (CV) : }\PYG{l+s+si}{\PYGZob{}\PYGZcb{}}\PYG{l+s+s2}{\PYGZdq{}}\PYG{o}{.}\PYG{n}{format}\PYG{p}{(}\PYG{n}{two\PYGZus{}sample\PYGZus{}test}\PYG{o}{.}\PYG{n}{cv\PYGZus{}}\PYG{p}{)}\PYG{p}{)}
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n+nb}{print}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{CV Method : }\PYG{l+s+si}{\PYGZob{}\PYGZcb{}}\PYG{l+s+s2}{\PYGZdq{}}\PYG{o}{.}\PYG{n}{format}\PYG{p}{(}\PYG{n}{two\PYGZus{}sample\PYGZus{}test}\PYG{o}{.}\PYG{n}{cv\PYGZus{}method\PYGZus{}}\PYG{p}{)}\PYG{p}{)}
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n+nb}{print}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{Selected tuning parameter : }\PYG{l+s+si}{\PYGZob{}\PYGZcb{}}\PYG{l+s+s2}{\PYGZdq{}}\PYG{o}{.}\PYG{n}{format}\PYG{p}{(}\PYG{n}{two\PYGZus{}sample\PYGZus{}test}\PYG{o}{.}\PYG{n}{h}\PYG{p}{)}\PYG{p}{)}
\PYG{g+gp}{... }\PYG{n}{Test} \PYG{p}{:} \PYG{n}{Kernel}\PYG{o}{\PYGZhy{}}\PYG{n}{based} \PYG{n}{quadratic} \PYG{n}{distance} \PYG{n}{two}\PYG{o}{\PYGZhy{}}\PYG{n}{sample} \PYG{n}{test}
\PYG{g+gp}{... }\PYG{n}{Execution} \PYG{n}{time}\PYG{p}{:} \PYG{l+m+mf}{0.092}
\PYG{g+gp}{... }\PYG{n}{H0} \PYG{o+ow}{is} \PYG{n}{Rejected} \PYG{p}{:} \PYG{k+kc}{False}
\PYG{g+gp}{... }\PYG{n}{Test} \PYG{n}{Statistic} \PYG{p}{:} \PYG{o}{\PYGZhy{}}\PYG{l+m+mf}{0.019707895277270022}
\PYG{g+gp}{... }\PYG{n}{Critical} \PYG{n}{Value} \PYG{p}{(}\PYG{n}{CV}\PYG{p}{)} \PYG{p}{:} \PYG{l+m+mf}{0.003842482597612725}
\PYG{g+gp}{... }\PYG{n}{CV} \PYG{n}{Method} \PYG{p}{:} \PYG{n}{subsampling}
\PYG{g+gp}{... }\PYG{n}{Selected} \PYG{n}{tuning} \PYG{n}{parameter} \PYG{p}{:} \PYG{l+m+mf}{0.4}
\end{sphinxVerbatim}

\end{fulllineitems}

\subsubsection*{Methods}


\begin{savenotes}\sphinxattablestart
\sphinxthistablewithglobalstyle
\sphinxthistablewithnovlinesstyle
\centering
\begin{tabulary}{\linewidth}[t]{\X{1}{2}\X{1}{2}}
\sphinxtoprule
\sphinxtableatstartofbodyhook
\sphinxAtStartPar
{\hyperref[\detokenize{api_reference/generated/QuadratiK.kernel_test.KernelTest:QuadratiK.kernel_test.KernelTest.stats}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{KernelTest.stats}}}}}()
&
\sphinxAtStartPar
Function to generate descriptive statistics per variable (and per group if available).
\\
\sphinxhline
\sphinxAtStartPar
{\hyperref[\detokenize{api_reference/generated/QuadratiK.kernel_test.KernelTest:QuadratiK.kernel_test.KernelTest.summary}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{KernelTest.summary}}}}}({[}print\_fmt{]})
&
\sphinxAtStartPar
Summary function generates a table for the kernel test results and the summary statistics.
\\
\sphinxhline
\sphinxAtStartPar
{\hyperref[\detokenize{api_reference/generated/QuadratiK.kernel_test.KernelTest:QuadratiK.kernel_test.KernelTest.test}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{KernelTest.test}}}}}(x{[}, y{]})
&
\sphinxAtStartPar
Function to perform the kernel\sphinxhyphen{}based quadratic distance tests using  the Gaussian kernel with bandwidth parameter h.
\\
\sphinxbottomrule
\end{tabulary}
\sphinxtableafterendhook\par
\sphinxattableend\end{savenotes}


\bigskip\hrule\bigskip

\index{stats() (QuadratiK.kernel\_test.KernelTest method)@\spxentry{stats()}\spxextra{QuadratiK.kernel\_test.KernelTest method}}

\begin{fulllineitems}
\phantomsection\label{\detokenize{api_reference/generated/QuadratiK.kernel_test.KernelTest:QuadratiK.kernel_test.KernelTest.stats}}
\pysigstartsignatures
\pysiglinewithargsret{\sphinxcode{\sphinxupquote{KernelTest.}}\sphinxbfcode{\sphinxupquote{stats}}}{}{}
\pysigstopsignatures
\sphinxAtStartPar
Function to generate descriptive statistics per variable (and per group if available).


\paragraph{Returns}
\label{\detokenize{api_reference/generated/QuadratiK.kernel_test.KernelTest:returns}}\begin{quote}
\begin{description}
\sphinxlineitem{summary\_stats\_df}{[}pandas.DataFrame{]}
\sphinxAtStartPar
Dataframe of descriptive statistics

\end{description}
\end{quote}

\end{fulllineitems}

\index{summary() (QuadratiK.kernel\_test.KernelTest method)@\spxentry{summary()}\spxextra{QuadratiK.kernel\_test.KernelTest method}}

\begin{fulllineitems}
\phantomsection\label{\detokenize{api_reference/generated/QuadratiK.kernel_test.KernelTest:QuadratiK.kernel_test.KernelTest.summary}}
\pysigstartsignatures
\pysiglinewithargsret{\sphinxcode{\sphinxupquote{KernelTest.}}\sphinxbfcode{\sphinxupquote{summary}}}{\sphinxparam{\DUrole{n}{print\_fmt}\DUrole{o}{=}\DUrole{default_value}{\textquotesingle{}simple\_grid\textquotesingle{}}}}{}
\pysigstopsignatures
\sphinxAtStartPar
Summary function generates a table for the kernel test results and the summary statistics.


\paragraph{Parameters}
\label{\detokenize{api_reference/generated/QuadratiK.kernel_test.KernelTest:id1}}\begin{quote}
\begin{description}
\sphinxlineitem{print\_fmt}{[}str, optional.{]}
\sphinxAtStartPar
Used for printing the output in the desired format. Defaults to “simple\_grid”.
Supports all available options in tabulate, see here: \sphinxurl{https://pypi.org/project/tabulate/}

\end{description}
\end{quote}


\paragraph{Returns}
\label{\detokenize{api_reference/generated/QuadratiK.kernel_test.KernelTest:id2}}\begin{quote}
\begin{description}
\sphinxlineitem{summary}{[}str{]}
\sphinxAtStartPar
A string formatted in the desired output 
format with the kernel test results and summary statistics.

\end{description}
\end{quote}

\end{fulllineitems}

\index{test() (QuadratiK.kernel\_test.KernelTest method)@\spxentry{test()}\spxextra{QuadratiK.kernel\_test.KernelTest method}}

\begin{fulllineitems}
\phantomsection\label{\detokenize{api_reference/generated/QuadratiK.kernel_test.KernelTest:QuadratiK.kernel_test.KernelTest.test}}
\pysigstartsignatures
\pysiglinewithargsret{\sphinxcode{\sphinxupquote{KernelTest.}}\sphinxbfcode{\sphinxupquote{test}}}{\sphinxparam{\DUrole{n}{x}}\sphinxparamcomma \sphinxparam{\DUrole{n}{y}\DUrole{o}{=}\DUrole{default_value}{None}}}{}
\pysigstopsignatures
\sphinxAtStartPar
Function to perform the kernel\sphinxhyphen{}based quadratic distance tests using 
the Gaussian kernel with bandwidth parameter h. 
Depending on the shape of the \sphinxtitleref{y}, the function performs the tests of 
multivariate normality, the non\sphinxhyphen{}parametric two\sphinxhyphen{}sample tests or the k\sphinxhyphen{}sample tests.


\paragraph{Parameters}
\label{\detokenize{api_reference/generated/QuadratiK.kernel_test.KernelTest:id3}}\begin{quote}
\begin{description}
\sphinxlineitem{x}{[}numpy.ndarray or pandas.DataFrame.{]}
\sphinxAtStartPar
A numeric array of data values.

\sphinxlineitem{y}{[}numpy.ndarray or pandas.DataFrame, optional{]}
\sphinxAtStartPar
A numeric array data values (for two\sphinxhyphen{}sample test) and a 1D array of class labels 
(for k\sphinxhyphen{}sample test). Defaults to None.

\end{description}
\end{quote}


\paragraph{Returns}
\label{\detokenize{api_reference/generated/QuadratiK.kernel_test.KernelTest:id4}}\begin{quote}
\begin{description}
\sphinxlineitem{self}{[}object{]}
\sphinxAtStartPar
Fitted estimator

\end{description}
\end{quote}

\end{fulllineitems}




\sphinxstepscope


\subsubsection{select\_h}
\label{\detokenize{api_reference/generated/QuadratiK.kernel_test.select_h:select-h}}\label{\detokenize{api_reference/generated/QuadratiK.kernel_test.select_h::doc}}\index{select\_h() (in module QuadratiK.kernel\_test)@\spxentry{select\_h()}\spxextra{in module QuadratiK.kernel\_test}}

\begin{fulllineitems}
\phantomsection\label{\detokenize{api_reference/generated/QuadratiK.kernel_test.select_h:QuadratiK.kernel_test.select_h}}
\pysigstartsignatures
\pysiglinewithargsret{\sphinxcode{\sphinxupquote{QuadratiK.kernel\_test.}}\sphinxbfcode{\sphinxupquote{select\_h}}}{\sphinxparam{\DUrole{n}{x}}\sphinxparamcomma \sphinxparam{\DUrole{n}{y}\DUrole{o}{=}\DUrole{default_value}{None}}\sphinxparamcomma \sphinxparam{\DUrole{n}{alternative}\DUrole{o}{=}\DUrole{default_value}{\textquotesingle{}location\textquotesingle{}}}\sphinxparamcomma \sphinxparam{\DUrole{n}{method}\DUrole{o}{=}\DUrole{default_value}{\textquotesingle{}subsampling\textquotesingle{}}}\sphinxparamcomma \sphinxparam{\DUrole{n}{b}\DUrole{o}{=}\DUrole{default_value}{0.8}}\sphinxparamcomma \sphinxparam{\DUrole{n}{num\_iter}\DUrole{o}{=}\DUrole{default_value}{150}}\sphinxparamcomma \sphinxparam{\DUrole{n}{delta\_dim}\DUrole{o}{=}\DUrole{default_value}{1}}\sphinxparamcomma \sphinxparam{\DUrole{n}{delta}\DUrole{o}{=}\DUrole{default_value}{None}}\sphinxparamcomma \sphinxparam{\DUrole{n}{h\_values}\DUrole{o}{=}\DUrole{default_value}{None}}\sphinxparamcomma \sphinxparam{\DUrole{n}{n\_rep}\DUrole{o}{=}\DUrole{default_value}{50}}\sphinxparamcomma \sphinxparam{\DUrole{n}{n\_jobs}\DUrole{o}{=}\DUrole{default_value}{8}}\sphinxparamcomma \sphinxparam{\DUrole{n}{quantile}\DUrole{o}{=}\DUrole{default_value}{0.95}}\sphinxparamcomma \sphinxparam{\DUrole{n}{k\_threshold}\DUrole{o}{=}\DUrole{default_value}{10}}\sphinxparamcomma \sphinxparam{\DUrole{n}{power\_plot}\DUrole{o}{=}\DUrole{default_value}{False}}\sphinxparamcomma \sphinxparam{\DUrole{n}{random\_state}\DUrole{o}{=}\DUrole{default_value}{None}}}{}
\pysigstopsignatures
\sphinxAtStartPar
This function computes the kernel bandwidth of the Gaussian kernel for the 
one sample, two\sphinxhyphen{}sample and k\sphinxhyphen{}sample kernel\sphinxhyphen{}based quadratic distance (KBQD) tests.

\sphinxAtStartPar
The function performs the selection of the optimal value for the tuning parameter h of the normal
kernel function, for the two\sphinxhyphen{}sample and k\sphinxhyphen{}sample KBQD tests. It performs a small simulation
study, generating samples according to the family of alternative specified, for the chosen values
of h\_values and delta.


\paragraph{Parameters}
\label{\detokenize{api_reference/generated/QuadratiK.kernel_test.select_h:parameters}}\begin{quote}
\begin{description}
\sphinxlineitem{x}{[}numpy.ndarray or pandas.DataFrame{]}
\sphinxAtStartPar
Data set of observations from X

\sphinxlineitem{y}{[}numpy.ndarray or pandas.DataFrame, optional{]}
\sphinxAtStartPar
Data set of observations from Y for two sample test
or set of labels in case of k\sphinxhyphen{}sample test

\sphinxlineitem{alternative}{[}str, optional{]}
\sphinxAtStartPar
Family of alternative chosen for selecting h,
must be one of “location”, “scale” and “skewness”.
Defaults to “location”

\sphinxlineitem{method}{[}str, optional. {]}
\sphinxAtStartPar
The method used for critical value estimation, 
must be one of “subsampling”, “bootstrap”, or “permutation”.
Defaults to “subsampling”.

\sphinxlineitem{b}{[}float, optional. {]}
\sphinxAtStartPar
The size of the subsamples used in the subsampling algorithm.
Defaults to 0.8.

\sphinxlineitem{num\_iter}{[}int, optional. {]}
\sphinxAtStartPar
The number of iterations to use for critical value estimation.
Defaults to 150.

\sphinxlineitem{delta\_dim}{[}int, numpy.ndarray, optional. {]}
\sphinxAtStartPar
Array of coefficient of alternative with respect to each dimension.
Defaults to 1.

\sphinxlineitem{delta}{[}numpy.ndarray, optional. {]}
\sphinxAtStartPar
Array of parameter values indicating chosen alternatives.
Defaults to None.

\sphinxlineitem{h\_values}{[}numpy.ndarray, optional. {]}
\sphinxAtStartPar
Values of the tuning parameter used for the selection.
Defaults to None.

\sphinxlineitem{n\_rep}{[}int, optional. Defaults to 50.{]}
\sphinxAtStartPar
Number of bootstrap replications

\sphinxlineitem{n\_jobs}{[}int, optional. {]}
\sphinxAtStartPar
n\_jobs specifies the maximum number of concurrently running workers. 
If 1 is given, no joblib parallelism is used at all, 
which is useful for debugging. For more information on joblib n\_jobs 
refer to \sphinxhyphen{} \sphinxurl{https://joblib.readthedocs.io/en/latest/generated/joblib.Parallel.html}.
Defaults to 8.

\sphinxlineitem{quantile}{[}float, optional. {]}
\sphinxAtStartPar
Quantile to use for critical value estimation. Defaults to 0.95.

\sphinxlineitem{k\_threshold}{[}int. {]}
\sphinxAtStartPar
Maximum number of groups allowed. Defaults to 10.

\sphinxlineitem{power\_plot}{[}boolean, optional. {]}
\sphinxAtStartPar
If True, plot is displayed the plot of power for 
values in h\_values and delta. Defaults to False.

\sphinxlineitem{random\_state}{[}int, None, optional. {]}
\sphinxAtStartPar
Seed for random number generation. Defaults to None

\end{description}
\end{quote}


\paragraph{Returns}
\label{\detokenize{api_reference/generated/QuadratiK.kernel_test.select_h:returns}}\begin{quote}
\begin{description}
\sphinxlineitem{h}{[}float{]}
\sphinxAtStartPar
The selected value of tuning parameter h

\sphinxlineitem{h vs Power table}{[}pandas.DataFrame{]}
\sphinxAtStartPar
A table containing the h, delta and corresponding powers

\end{description}
\end{quote}


\paragraph{References}
\label{\detokenize{api_reference/generated/QuadratiK.kernel_test.select_h:references}}\begin{quote}

\sphinxAtStartPar
Markatou M., Saraceno G., Chen Y. (2023). “Two\sphinxhyphen{} and k\sphinxhyphen{}Sample Tests Based on Quadratic Distances.
”Manuscript, (Department of Biostatistics, University at Buffalo)
\end{quote}


\paragraph{Examples}
\label{\detokenize{api_reference/generated/QuadratiK.kernel_test.select_h:examples}}
\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{k+kn}{import} \PYG{n+nn}{numpy} \PYG{k}{as} \PYG{n+nn}{np}
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{k+kn}{from} \PYG{n+nn}{QuadratiK}\PYG{n+nn}{.}\PYG{n+nn}{kernel\PYGZus{}test} \PYG{k+kn}{import} \PYG{n}{select\PYGZus{}h}
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{np}\PYG{o}{.}\PYG{n}{random}\PYG{o}{.}\PYG{n}{seed}\PYG{p}{(}\PYG{l+m+mi}{42}\PYG{p}{)}
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{X} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{random}\PYG{o}{.}\PYG{n}{randn}\PYG{p}{(}\PYG{l+m+mi}{200}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{p}{)}
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{np}\PYG{o}{.}\PYG{n}{random}\PYG{o}{.}\PYG{n}{seed}\PYG{p}{(}\PYG{l+m+mi}{42}\PYG{p}{)}
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{y} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{random}\PYG{o}{.}\PYG{n}{randint}\PYG{p}{(}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{p}{,} \PYG{l+m+mi}{200}\PYG{p}{)}
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{h\PYGZus{}selected}\PYG{p}{,} \PYG{n}{all\PYGZus{}values}\PYG{p}{,} \PYG{n}{power\PYGZus{}plot} \PYG{o}{=} \PYG{n}{select\PYGZus{}h}\PYG{p}{(}
\PYG{g+gp}{... }   \PYG{n}{X}\PYG{p}{,} \PYG{n}{y}\PYG{p}{,} \PYG{n}{alternative}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{location}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{power\PYGZus{}plot}\PYG{o}{=}\PYG{k+kc}{True}\PYG{p}{,} \PYG{n}{random\PYGZus{}state}\PYG{o}{=}\PYG{l+m+mi}{42}\PYG{p}{)}
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n+nb}{print}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{Selected h is: }\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{n}{h\PYGZus{}selected}\PYG{p}{)}
\PYG{g+gp}{... }\PYG{n}{Selected} \PYG{n}{h} \PYG{o+ow}{is}\PYG{p}{:}  \PYG{l+m+mf}{1.2}
\end{sphinxVerbatim}

\end{fulllineitems}



\index{module@\spxentry{module}!QuadratiK.poisson\_kernel\_test@\spxentry{QuadratiK.poisson\_kernel\_test}}\index{QuadratiK.poisson\_kernel\_test@\spxentry{QuadratiK.poisson\_kernel\_test}!module@\spxentry{module}}

\subsection{Poisson Kernel Test}
\label{\detokenize{api_reference/index:poisson-kernel-test}}\label{\detokenize{api_reference/index:module-QuadratiK.poisson_kernel_test}}

\begin{savenotes}\sphinxattablestart
\sphinxthistablewithglobalstyle
\sphinxthistablewithnovlinesstyle
\centering
\begin{tabulary}{\linewidth}[t]{\X{1}{2}\X{1}{2}}
\sphinxtoprule
\sphinxtableatstartofbodyhook
\sphinxAtStartPar
{\hyperref[\detokenize{api_reference/generated/QuadratiK.poisson_kernel_test.PoissonKernelTest:QuadratiK.poisson_kernel_test.PoissonKernelTest}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{PoissonKernelTest}}}}}({[}rho, num\_iter, quantile, ...{]})
&
\sphinxAtStartPar
Class for Poisson kernel\sphinxhyphen{}based quadratic distance  test of Uniformity on the Sphere
\\
\sphinxbottomrule
\end{tabulary}
\sphinxtableafterendhook\par
\sphinxattableend\end{savenotes}

\sphinxstepscope


\subsubsection{PoissonKernelTest}
\label{\detokenize{api_reference/generated/QuadratiK.poisson_kernel_test.PoissonKernelTest:poissonkerneltest}}\label{\detokenize{api_reference/generated/QuadratiK.poisson_kernel_test.PoissonKernelTest::doc}}\index{PoissonKernelTest (class in QuadratiK.poisson\_kernel\_test)@\spxentry{PoissonKernelTest}\spxextra{class in QuadratiK.poisson\_kernel\_test}}

\begin{fulllineitems}
\phantomsection\label{\detokenize{api_reference/generated/QuadratiK.poisson_kernel_test.PoissonKernelTest:QuadratiK.poisson_kernel_test.PoissonKernelTest}}
\pysigstartsignatures
\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class\DUrole{w}{ }}}\sphinxcode{\sphinxupquote{QuadratiK.poisson\_kernel\_test.}}\sphinxbfcode{\sphinxupquote{PoissonKernelTest}}}{\sphinxparam{\DUrole{n}{rho}}\sphinxparamcomma \sphinxparam{\DUrole{n}{num\_iter}\DUrole{o}{=}\DUrole{default_value}{300}}\sphinxparamcomma \sphinxparam{\DUrole{n}{quantile}\DUrole{o}{=}\DUrole{default_value}{0.95}}\sphinxparamcomma \sphinxparam{\DUrole{n}{random\_state}\DUrole{o}{=}\DUrole{default_value}{None}}\sphinxparamcomma \sphinxparam{\DUrole{n}{n\_jobs}\DUrole{o}{=}\DUrole{default_value}{8}}}{}
\pysigstopsignatures
\sphinxAtStartPar
Class for Poisson kernel\sphinxhyphen{}based quadratic distance 
test of Uniformity on the Sphere


\paragraph{Parameters}
\label{\detokenize{api_reference/generated/QuadratiK.poisson_kernel_test.PoissonKernelTest:parameters}}\begin{quote}
\begin{description}
\sphinxlineitem{rho}{[}float{]}
\sphinxAtStartPar
The value of concentration parameter used for the 
Poisson kernel function.

\sphinxlineitem{num\_iter}{[}int, optional{]}
\sphinxAtStartPar
Number of iterations for critical value estimation of U\sphinxhyphen{}statistic.

\sphinxlineitem{quantile}{[}float, optional{]}
\sphinxAtStartPar
The quantile to use for critical value estimation

\sphinxlineitem{random\_state}{[}int, None, optional. {]}
\sphinxAtStartPar
Seed for random number generation. Defaults to None

\sphinxlineitem{n\_jobs}{[}int, optional.{]}
\sphinxAtStartPar
n\_jobs specifies the maximum number of concurrently running workers. 
If 1 is given, no joblib parallelism is used at all, which is useful for debugging.
For more information on joblib n\_jobs refer 
to \sphinxhyphen{} \sphinxurl{https://joblib.readthedocs.io/en/latest/generated/joblib.Parallel.html}. 
Defaults to 8.

\end{description}
\end{quote}


\paragraph{Attributes}
\label{\detokenize{api_reference/generated/QuadratiK.poisson_kernel_test.PoissonKernelTest:attributes}}\begin{quote}
\begin{description}
\sphinxlineitem{test\_type\_}{[}str{]}
\sphinxAtStartPar
The type of test performed on the data

\sphinxlineitem{execution\_time}{[}float{]}
\sphinxAtStartPar
Time taken for the test method to execute

\sphinxlineitem{u\_statistic\_h0\_}{[}boolean{]}
\sphinxAtStartPar
A logical value indicating whether or not the null hypothesis 
is rejected according to Un

\sphinxlineitem{u\_statistic\_un\_}{[}float{]}
\sphinxAtStartPar
The value of the U\sphinxhyphen{}statistic.

\sphinxlineitem{u\_statistic\_cv\_}{[}float{]}
\sphinxAtStartPar
The empirical critical value for Un

\sphinxlineitem{v\_statistic\_h0\_}{[}boolean{]}
\sphinxAtStartPar
A logical value indicating whether or not the null hypothesis is 
rejected according to Vn.

\sphinxlineitem{v\_statistic\_vn\_}{[}float{]}
\sphinxAtStartPar
The value of the V\sphinxhyphen{}statistic.

\sphinxlineitem{v\_statistic\_cv\_}{[}float{]}
\sphinxAtStartPar
The critical value for Vn computed following the asymptotic distribution.

\end{description}
\end{quote}


\paragraph{References}
\label{\detokenize{api_reference/generated/QuadratiK.poisson_kernel_test.PoissonKernelTest:references}}\begin{quote}

\sphinxAtStartPar
Ding Y., Markatou M., Saraceno G. (2023). “Poisson Kernel\sphinxhyphen{}Based Tests for
Uniformity on the d\sphinxhyphen{}Dimensional Sphere.” Statistica Sinica. doi: doi:10.5705/ss.202022.0347
\end{quote}


\paragraph{Examples}
\label{\detokenize{api_reference/generated/QuadratiK.poisson_kernel_test.PoissonKernelTest:examples}}
\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{k+kn}{from} \PYG{n+nn}{QuadratiK}\PYG{n+nn}{.}\PYG{n+nn}{tools} \PYG{k+kn}{import} \PYG{n}{sample\PYGZus{}hypersphere}
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{k+kn}{from} \PYG{n+nn}{QuadratiK}\PYG{n+nn}{.}\PYG{n+nn}{poisson\PYGZus{}kernel\PYGZus{}test} \PYG{k+kn}{import} \PYG{n}{PoissonKernelTest}
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{np}\PYG{o}{.}\PYG{n}{random}\PYG{o}{.}\PYG{n}{seed}\PYG{p}{(}\PYG{l+m+mi}{42}\PYG{p}{)}
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{X} \PYG{o}{=} \PYG{n}{sample\PYGZus{}hypersphere}\PYG{p}{(}\PYG{l+m+mi}{100}\PYG{p}{,}\PYG{l+m+mi}{3}\PYG{p}{,} \PYG{n}{random\PYGZus{}state}\PYG{o}{=}\PYG{l+m+mi}{42}\PYG{p}{)}
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{unif\PYGZus{}test} \PYG{o}{=} \PYG{n}{PoissonKernelTest}\PYG{p}{(}\PYG{n}{rho} \PYG{o}{=} \PYG{l+m+mf}{0.7}\PYG{p}{,} \PYG{n}{random\PYGZus{}state}\PYG{o}{=}\PYG{l+m+mi}{42}\PYG{p}{)}\PYG{o}{.}\PYG{n}{test}\PYG{p}{(}\PYG{n}{X}\PYG{p}{)}
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n+nb}{print}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{Execution time: }\PYG{l+s+si}{\PYGZob{}:.3f\PYGZcb{}}\PYG{l+s+s2}{ seconds}\PYG{l+s+s2}{\PYGZdq{}}\PYG{o}{.}\PYG{n}{format}\PYG{p}{(}\PYG{n}{unif\PYGZus{}test}\PYG{o}{.}\PYG{n}{execution\PYGZus{}time}\PYG{p}{)}\PYG{p}{)}
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n+nb}{print}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{U Statistic Results}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{)}
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n+nb}{print}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{H0 is rejected : }\PYG{l+s+si}{\PYGZob{}\PYGZcb{}}\PYG{l+s+s2}{\PYGZdq{}}\PYG{o}{.}\PYG{n}{format}\PYG{p}{(}\PYG{n}{unif\PYGZus{}test}\PYG{o}{.}\PYG{n}{u\PYGZus{}statistic\PYGZus{}h0\PYGZus{}}\PYG{p}{)}\PYG{p}{)}
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n+nb}{print}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{Un Statistic : }\PYG{l+s+si}{\PYGZob{}\PYGZcb{}}\PYG{l+s+s2}{\PYGZdq{}}\PYG{o}{.}\PYG{n}{format}\PYG{p}{(}\PYG{n}{unif\PYGZus{}test}\PYG{o}{.}\PYG{n}{u\PYGZus{}statistic\PYGZus{}un\PYGZus{}}\PYG{p}{)}\PYG{p}{)}
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n+nb}{print}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{Critical Value : }\PYG{l+s+si}{\PYGZob{}\PYGZcb{}}\PYG{l+s+s2}{\PYGZdq{}}\PYG{o}{.}\PYG{n}{format}\PYG{p}{(}\PYG{n}{unif\PYGZus{}test}\PYG{o}{.}\PYG{n}{u\PYGZus{}statistic\PYGZus{}cv\PYGZus{}}\PYG{p}{)}\PYG{p}{)}
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n+nb}{print}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{V Statistic Results}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{)}
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n+nb}{print}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{H0 is rejected : }\PYG{l+s+si}{\PYGZob{}\PYGZcb{}}\PYG{l+s+s2}{\PYGZdq{}}\PYG{o}{.}\PYG{n}{format}\PYG{p}{(}\PYG{n}{unif\PYGZus{}test}\PYG{o}{.}\PYG{n}{v\PYGZus{}statistic\PYGZus{}h0\PYGZus{}}\PYG{p}{)}\PYG{p}{)}
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n+nb}{print}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{Vn Statistic : }\PYG{l+s+si}{\PYGZob{}\PYGZcb{}}\PYG{l+s+s2}{\PYGZdq{}}\PYG{o}{.}\PYG{n}{format}\PYG{p}{(}\PYG{n}{unif\PYGZus{}test}\PYG{o}{.}\PYG{n}{v\PYGZus{}statistic\PYGZus{}vn\PYGZus{}}\PYG{p}{)}\PYG{p}{)}
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n+nb}{print}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{Critical Value : }\PYG{l+s+si}{\PYGZob{}\PYGZcb{}}\PYG{l+s+s2}{\PYGZdq{}}\PYG{o}{.}\PYG{n}{format}\PYG{p}{(}\PYG{n}{unif\PYGZus{}test}\PYG{o}{.}\PYG{n}{v\PYGZus{}statistic\PYGZus{}cv\PYGZus{}}\PYG{p}{)}\PYG{p}{)}
\PYG{g+gp}{... }\PYG{n}{Execution} \PYG{n}{time}\PYG{p}{:} \PYG{l+m+mf}{0.181} \PYG{n}{seconds}
\PYG{g+gp}{... }\PYG{n}{U} \PYG{n}{Statistic} \PYG{n}{Results}
\PYG{g+gp}{... }\PYG{n}{H0} \PYG{o+ow}{is} \PYG{n}{rejected} \PYG{p}{:} \PYG{k+kc}{False}
\PYG{g+gp}{... }\PYG{n}{Un} \PYG{n}{Statistic} \PYG{p}{:} \PYG{l+m+mf}{1.6156682048968174}
\PYG{g+gp}{... }\PYG{n}{Critical} \PYG{n}{Value} \PYG{p}{:} \PYG{l+m+mf}{0.06155875299050079}
\PYG{g+gp}{... }\PYG{n}{V} \PYG{n}{Statistic} \PYG{n}{Results}
\PYG{g+gp}{... }\PYG{n}{H0} \PYG{o+ow}{is} \PYG{n}{rejected} \PYG{p}{:} \PYG{k+kc}{False}
\PYG{g+gp}{... }\PYG{n}{Vn} \PYG{n}{Statistic} \PYG{p}{:} \PYG{l+m+mf}{22.83255917641962}
\PYG{g+gp}{... }\PYG{n}{Critical} \PYG{n}{Value} \PYG{p}{:} \PYG{l+m+mf}{23.229486935225513}
\end{sphinxVerbatim}

\end{fulllineitems}

\subsubsection*{Methods}


\begin{savenotes}\sphinxattablestart
\sphinxthistablewithglobalstyle
\sphinxthistablewithnovlinesstyle
\centering
\begin{tabulary}{\linewidth}[t]{\X{1}{2}\X{1}{2}}
\sphinxtoprule
\sphinxtableatstartofbodyhook
\sphinxAtStartPar
{\hyperref[\detokenize{api_reference/generated/QuadratiK.poisson_kernel_test.PoissonKernelTest:QuadratiK.poisson_kernel_test.PoissonKernelTest.stats}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{PoissonKernelTest.stats}}}}}()
&
\sphinxAtStartPar
Function to generate descriptive statistics.
\\
\sphinxhline
\sphinxAtStartPar
{\hyperref[\detokenize{api_reference/generated/QuadratiK.poisson_kernel_test.PoissonKernelTest:QuadratiK.poisson_kernel_test.PoissonKernelTest.summary}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{PoissonKernelTest.summary}}}}}({[}print\_fmt{]})
&
\sphinxAtStartPar
Summary function generates a table for  the poisson kernel test results and the summary statistics.
\\
\sphinxhline
\sphinxAtStartPar
{\hyperref[\detokenize{api_reference/generated/QuadratiK.poisson_kernel_test.PoissonKernelTest:QuadratiK.poisson_kernel_test.PoissonKernelTest.test}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{PoissonKernelTest.test}}}}}(x)
&
\sphinxAtStartPar
Performs the Poisson kernel\sphinxhyphen{}based quadratic distance Goodness\sphinxhyphen{}of\sphinxhyphen{}fit tests for Uniformity for spherical data using the Poisson kernel with concentration parameter \(rho\)
\\
\sphinxbottomrule
\end{tabulary}
\sphinxtableafterendhook\par
\sphinxattableend\end{savenotes}


\bigskip\hrule\bigskip

\index{stats() (QuadratiK.poisson\_kernel\_test.PoissonKernelTest method)@\spxentry{stats()}\spxextra{QuadratiK.poisson\_kernel\_test.PoissonKernelTest method}}

\begin{fulllineitems}
\phantomsection\label{\detokenize{api_reference/generated/QuadratiK.poisson_kernel_test.PoissonKernelTest:QuadratiK.poisson_kernel_test.PoissonKernelTest.stats}}
\pysigstartsignatures
\pysiglinewithargsret{\sphinxcode{\sphinxupquote{PoissonKernelTest.}}\sphinxbfcode{\sphinxupquote{stats}}}{}{}
\pysigstopsignatures
\sphinxAtStartPar
Function to generate descriptive statistics.


\paragraph{Returns}
\label{\detokenize{api_reference/generated/QuadratiK.poisson_kernel_test.PoissonKernelTest:returns}}\begin{quote}
\begin{description}
\sphinxlineitem{summary\_stats\_df}{[}pandas.DataFrame{]}
\sphinxAtStartPar
Dataframe of descriptive statistics

\end{description}
\end{quote}

\end{fulllineitems}

\index{summary() (QuadratiK.poisson\_kernel\_test.PoissonKernelTest method)@\spxentry{summary()}\spxextra{QuadratiK.poisson\_kernel\_test.PoissonKernelTest method}}

\begin{fulllineitems}
\phantomsection\label{\detokenize{api_reference/generated/QuadratiK.poisson_kernel_test.PoissonKernelTest:QuadratiK.poisson_kernel_test.PoissonKernelTest.summary}}
\pysigstartsignatures
\pysiglinewithargsret{\sphinxcode{\sphinxupquote{PoissonKernelTest.}}\sphinxbfcode{\sphinxupquote{summary}}}{\sphinxparam{\DUrole{n}{print\_fmt}\DUrole{o}{=}\DUrole{default_value}{\textquotesingle{}simple\_grid\textquotesingle{}}}}{}
\pysigstopsignatures
\sphinxAtStartPar
Summary function generates a table for 
the poisson kernel test results and the summary statistics.


\paragraph{Parameters}
\label{\detokenize{api_reference/generated/QuadratiK.poisson_kernel_test.PoissonKernelTest:id1}}\begin{quote}
\begin{description}
\sphinxlineitem{print\_fmt}{[}str, optional. {]}
\sphinxAtStartPar
Used for printing the output in the desired format. 
Supports all available options in tabulate, 
see here: \sphinxurl{https://pypi.org/project/tabulate/}. 
Defaults to “simple\_grid”.

\end{description}
\end{quote}


\paragraph{Returns}
\label{\detokenize{api_reference/generated/QuadratiK.poisson_kernel_test.PoissonKernelTest:id2}}\begin{quote}
\begin{description}
\sphinxlineitem{summary}{[}str{]}
\sphinxAtStartPar
A string formatted in the desired output 
format with the kernel test results and summary statistics.

\end{description}
\end{quote}

\end{fulllineitems}

\index{test() (QuadratiK.poisson\_kernel\_test.PoissonKernelTest method)@\spxentry{test()}\spxextra{QuadratiK.poisson\_kernel\_test.PoissonKernelTest method}}

\begin{fulllineitems}
\phantomsection\label{\detokenize{api_reference/generated/QuadratiK.poisson_kernel_test.PoissonKernelTest:QuadratiK.poisson_kernel_test.PoissonKernelTest.test}}
\pysigstartsignatures
\pysiglinewithargsret{\sphinxcode{\sphinxupquote{PoissonKernelTest.}}\sphinxbfcode{\sphinxupquote{test}}}{\sphinxparam{\DUrole{n}{x}}}{}
\pysigstopsignatures
\sphinxAtStartPar
Performs the Poisson kernel\sphinxhyphen{}based quadratic distance Goodness\sphinxhyphen{}of\sphinxhyphen{}fit tests for
Uniformity for spherical data using the Poisson kernel with concentration parameter \(rho\)


\paragraph{Parameters}
\label{\detokenize{api_reference/generated/QuadratiK.poisson_kernel_test.PoissonKernelTest:id3}}\begin{quote}
\begin{description}
\sphinxlineitem{x}{[}numpy.ndarray, pandas.DataFrame{]}
\sphinxAtStartPar
a numeric d\sphinxhyphen{}dim matrix of data points on the Sphere \(S^{(d-1)}\).

\end{description}
\end{quote}


\paragraph{Returns}
\label{\detokenize{api_reference/generated/QuadratiK.poisson_kernel_test.PoissonKernelTest:id4}}\begin{quote}
\begin{description}
\sphinxlineitem{self}{[}object{]}
\sphinxAtStartPar
Fitted estimator

\end{description}
\end{quote}

\end{fulllineitems}



\index{module@\spxentry{module}!QuadratiK.spherical\_clustering@\spxentry{QuadratiK.spherical\_clustering}}\index{QuadratiK.spherical\_clustering@\spxentry{QuadratiK.spherical\_clustering}!module@\spxentry{module}}

\subsection{Spherical Clustering}
\label{\detokenize{api_reference/index:spherical-clustering}}\label{\detokenize{api_reference/index:module-QuadratiK.spherical_clustering}}

\begin{savenotes}\sphinxattablestart
\sphinxthistablewithglobalstyle
\sphinxthistablewithnovlinesstyle
\centering
\begin{tabulary}{\linewidth}[t]{\X{1}{2}\X{1}{2}}
\sphinxtoprule
\sphinxtableatstartofbodyhook
\sphinxAtStartPar
{\hyperref[\detokenize{api_reference/generated/QuadratiK.spherical_clustering.PKBC:QuadratiK.spherical_clustering.PKBC}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{PKBC}}}}}({[}num\_clust, max\_iter, stopping\_rule, ...{]})
&
\sphinxAtStartPar
Poisson kernel\sphinxhyphen{}based clustering on the Sphere.
\\
\sphinxhline
\sphinxAtStartPar
{\hyperref[\detokenize{api_reference/generated/QuadratiK.spherical_clustering.PKBD:QuadratiK.spherical_clustering.PKBD}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{PKBD}}}}}()
&
\sphinxAtStartPar
Class for estimating density and generating samples of Poisson\sphinxhyphen{}kernel based distribution (PKBD).
\\
\sphinxbottomrule
\end{tabulary}
\sphinxtableafterendhook\par
\sphinxattableend\end{savenotes}

\sphinxstepscope


\subsubsection{PKBC}
\label{\detokenize{api_reference/generated/QuadratiK.spherical_clustering.PKBC:pkbc}}\label{\detokenize{api_reference/generated/QuadratiK.spherical_clustering.PKBC::doc}}\index{PKBC (class in QuadratiK.spherical\_clustering)@\spxentry{PKBC}\spxextra{class in QuadratiK.spherical\_clustering}}

\begin{fulllineitems}
\phantomsection\label{\detokenize{api_reference/generated/QuadratiK.spherical_clustering.PKBC:QuadratiK.spherical_clustering.PKBC}}
\pysigstartsignatures
\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class\DUrole{w}{ }}}\sphinxcode{\sphinxupquote{QuadratiK.spherical\_clustering.}}\sphinxbfcode{\sphinxupquote{PKBC}}}{\sphinxparam{\DUrole{n}{num\_clust}}\sphinxparamcomma \sphinxparam{\DUrole{n}{max\_iter}\DUrole{o}{=}\DUrole{default_value}{300}}\sphinxparamcomma \sphinxparam{\DUrole{n}{stopping\_rule}\DUrole{o}{=}\DUrole{default_value}{\textquotesingle{}loglik\textquotesingle{}}}\sphinxparamcomma \sphinxparam{\DUrole{n}{init\_method}\DUrole{o}{=}\DUrole{default_value}{\textquotesingle{}sampledata\textquotesingle{}}}\sphinxparamcomma \sphinxparam{\DUrole{n}{num\_init}\DUrole{o}{=}\DUrole{default_value}{10}}\sphinxparamcomma \sphinxparam{\DUrole{n}{tol}\DUrole{o}{=}\DUrole{default_value}{1e\sphinxhyphen{}07}}\sphinxparamcomma \sphinxparam{\DUrole{n}{random\_state}\DUrole{o}{=}\DUrole{default_value}{None}}\sphinxparamcomma \sphinxparam{\DUrole{n}{n\_jobs}\DUrole{o}{=}\DUrole{default_value}{4}}}{}
\pysigstopsignatures
\sphinxAtStartPar
Poisson kernel\sphinxhyphen{}based clustering on the sphere. 
The class performs the Poisson kernel\sphinxhyphen{}based clustering algorithm 
on the sphere based on the Poisson kernel\sphinxhyphen{}based densities. It estimates
the parameter of a mixture of Poisson kernel\sphinxhyphen{}based densities. The obtained
estimates are used for assigning final memberships, identifying the data points.


\paragraph{Parameters}
\label{\detokenize{api_reference/generated/QuadratiK.spherical_clustering.PKBC:parameters}}\begin{quote}
\begin{description}
\sphinxlineitem{num\_clust}{[}int{]}
\sphinxAtStartPar
Number of clusters.

\sphinxlineitem{max\_iter}{[}int{]}
\sphinxAtStartPar
Maximum number of iterations before a run is terminated.

\sphinxlineitem{stopping\_rule}{[}str, optional{]}
\sphinxAtStartPar
String describing the stopping rule to be used within each run. 
Currently must be either ‘max’, ‘membership’, or ‘loglik’.

\sphinxlineitem{init\_method}{[}str, optional{]}
\sphinxAtStartPar
String describing the initialization method to be used. 
Currently must be ‘sampleData’.

\sphinxlineitem{num\_init}{[}int, optional{]}
\sphinxAtStartPar
Number of initializations.

\sphinxlineitem{tol}{[}float.{]}
\sphinxAtStartPar
Constant defining threshold by which log 
likelihood must change to continue iterations, if applicable.
Defaults to 1e\sphinxhyphen{}7.

\sphinxlineitem{random\_state}{[}int, None, optional. {]}
\sphinxAtStartPar
Seed for random number generation. Defaults to None

\sphinxlineitem{n\_jobs}{[}int{]}
\sphinxAtStartPar
Used only for computing the WCSS efficiently.
n\_jobs specifies the maximum number of concurrently running workers. 
If 1 is given, no joblib parallelism is used at all, which is useful for debugging.
For more information on joblib n\_jobs refer to \sphinxhyphen{} 
\sphinxurl{https://joblib.readthedocs.io/en/latest/generated/joblib.Parallel.html}.
Defaults to 4.

\end{description}
\end{quote}


\paragraph{Attributes}
\label{\detokenize{api_reference/generated/QuadratiK.spherical_clustering.PKBC:attributes}}\begin{quote}
\begin{description}
\sphinxlineitem{alpha\_}{[}numpy.ndarray of shape (n\_clusters,){]}
\sphinxAtStartPar
Estimated mixing proportions

\sphinxlineitem{labels\_}{[}numpy.ndarray of shape (n\_samples,){]}
\sphinxAtStartPar
Final cluster membership assigned by the algorithm to each observation

\sphinxlineitem{log\_lik\_vec}{[}numpy.ndarray of shape (num\_init, ){]}
\sphinxAtStartPar
Array of log\sphinxhyphen{}likelihood values for each initialization

\sphinxlineitem{loklik\_}{[}float{]}
\sphinxAtStartPar
Maximum value of the log\sphinxhyphen{}likelihood function

\sphinxlineitem{mu\_}{[}numpy.ndarray of shape (n\_clusters, n\_features){]}
\sphinxAtStartPar
Estimated centroids

\sphinxlineitem{num\_iter\_per\_run}{[}numpy.ndarray of shape (num\_init, ){]}
\sphinxAtStartPar
Number of E\sphinxhyphen{}M iterations per run

\sphinxlineitem{post\_probs\_}{[}numpy.ndarray of shape (n\_samples, n\_features){]}
\sphinxAtStartPar
Posterior probabilities of each observation for the indicated clusters

\sphinxlineitem{rho\_}{[}numpy.ndarray of shape (n\_clusters,){]}
\sphinxAtStartPar
Estimated concentration parameters rho

\sphinxlineitem{euclidean\_wcss\_}{[}float{]}
\sphinxAtStartPar
Values of within\sphinxhyphen{}cluster sum of squares computed with 
Euclidean distance.

\sphinxlineitem{cosine\_wcss\_}{[}float{]}
\sphinxAtStartPar
Values of within\sphinxhyphen{}cluster sum of squares computed with 
cosine similarity.

\end{description}
\end{quote}


\paragraph{References}
\label{\detokenize{api_reference/generated/QuadratiK.spherical_clustering.PKBC:references}}\begin{quote}

\sphinxAtStartPar
Golzy M. \& Markatou M. (2020) Poisson Kernel\sphinxhyphen{}Based 
Clustering on the Sphere: Convergence Properties, Identifiability, 
and a Method of Sampling, Journal of Computational and Graphical Statistics, 
29:4, 758\sphinxhyphen{}770, DOI: 10.1080/10618600.2020.1740713.
\end{quote}


\paragraph{Examples}
\label{\detokenize{api_reference/generated/QuadratiK.spherical_clustering.PKBC:examples}}
\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{k+kn}{from} \PYG{n+nn}{QuadratiK}\PYG{n+nn}{.}\PYG{n+nn}{datasets} \PYG{k+kn}{import} \PYG{n}{load\PYGZus{}wireless\PYGZus{}data}
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{k+kn}{from} \PYG{n+nn}{QuadratiK}\PYG{n+nn}{.}\PYG{n+nn}{spherical\PYGZus{}clustering} \PYG{k+kn}{import} \PYG{n}{PKBC}
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{k+kn}{from} \PYG{n+nn}{sklearn}\PYG{n+nn}{.}\PYG{n+nn}{preprocessing} \PYG{k+kn}{import} \PYG{n}{LabelEncoder}
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{X}\PYG{p}{,} \PYG{n}{y} \PYG{o}{=} \PYG{n}{load\PYGZus{}wireless\PYGZus{}data}\PYG{p}{(}\PYG{n}{return\PYGZus{}X\PYGZus{}y}\PYG{o}{=}\PYG{k+kc}{True}\PYG{p}{)}
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{le} \PYG{o}{=} \PYG{n}{LabelEncoder}\PYG{p}{(}\PYG{p}{)}
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{le}\PYG{o}{.}\PYG{n}{fit}\PYG{p}{(}\PYG{n}{y}\PYG{p}{)}
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{y} \PYG{o}{=} \PYG{n}{le}\PYG{o}{.}\PYG{n}{transform}\PYG{p}{(}\PYG{n}{y}\PYG{p}{)}
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{cluster\PYGZus{}fit} \PYG{o}{=} \PYG{n}{PKBC}\PYG{p}{(}\PYG{n}{num\PYGZus{}clust}\PYG{o}{=}\PYG{l+m+mi}{4}\PYG{p}{,} \PYG{n}{random\PYGZus{}state}\PYG{o}{=}\PYG{l+m+mi}{42}\PYG{p}{)}\PYG{o}{.}\PYG{n}{fit}\PYG{p}{(}\PYG{n}{X}\PYG{p}{)}
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{ari}\PYG{p}{,} \PYG{n}{macro\PYGZus{}precision}\PYG{p}{,} \PYG{n}{macro\PYGZus{}recall}\PYG{p}{,} \PYG{n}{avg\PYGZus{}silhouette\PYGZus{}Score} \PYG{o}{=} \PYG{n}{cluster\PYGZus{}fit}\PYG{o}{.}\PYG{n}{validation}\PYG{p}{(}\PYG{n}{y}\PYG{p}{)}
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n+nb}{print}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{Estimated mixing proportions :}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{n}{cluster\PYGZus{}fit}\PYG{o}{.}\PYG{n}{alpha\PYGZus{}}\PYG{p}{)}
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n+nb}{print}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{Estimated concentration parameters: }\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{n}{cluster\PYGZus{}fit}\PYG{o}{.}\PYG{n}{rho\PYGZus{}}\PYG{p}{)}
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n+nb}{print}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{Adjusted Rand Index:}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{n}{ari}\PYG{p}{)}
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n+nb}{print}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{Macro Precision:}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{n}{macro\PYGZus{}precision}\PYG{p}{)}
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n+nb}{print}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{Macro Recall:}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{n}{macro\PYGZus{}recall}\PYG{p}{)}
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n+nb}{print}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{Average Silhouette Score:}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{n}{avg\PYGZus{}silhouette\PYGZus{}Score}\PYG{p}{)}
\PYG{g+gp}{... }\PYG{n}{Estimated} \PYG{n}{mixing} \PYG{n}{proportions} \PYG{p}{:} \PYG{p}{[}\PYG{l+m+mf}{0.23590339} \PYG{l+m+mf}{0.24977919} \PYG{l+m+mf}{0.25777522} \PYG{l+m+mf}{0.25654219}\PYG{p}{]}
\PYG{g+gp}{... }\PYG{n}{Estimated} \PYG{n}{concentration} \PYG{n}{parameters}\PYG{p}{:}  \PYG{p}{[}\PYG{l+m+mf}{0.97773265} \PYG{l+m+mf}{0.98348976} \PYG{l+m+mf}{0.98226901} \PYG{l+m+mf}{0.98572597}\PYG{p}{]}
\PYG{g+gp}{... }\PYG{n}{Adjusted} \PYG{n}{Rand} \PYG{n}{Index}\PYG{p}{:} \PYG{l+m+mf}{0.9403086353805835}
\PYG{g+gp}{... }\PYG{n}{Macro} \PYG{n}{Precision}\PYG{p}{:} \PYG{l+m+mf}{0.9771870612442508}
\PYG{g+gp}{... }\PYG{n}{Macro} \PYG{n}{Recall}\PYG{p}{:} \PYG{l+m+mf}{0.9769999999999999}
\PYG{g+gp}{... }\PYG{n}{Average} \PYG{n}{Silhouette} \PYG{n}{Score}\PYG{p}{:} \PYG{l+m+mf}{0.3803089203572107}
\end{sphinxVerbatim}

\end{fulllineitems}

\subsubsection*{Methods}


\begin{savenotes}\sphinxattablestart
\sphinxthistablewithglobalstyle
\sphinxthistablewithnovlinesstyle
\centering
\begin{tabulary}{\linewidth}[t]{\X{1}{2}\X{1}{2}}
\sphinxtoprule
\sphinxtableatstartofbodyhook
\sphinxAtStartPar
{\hyperref[\detokenize{api_reference/generated/QuadratiK.spherical_clustering.PKBC:QuadratiK.spherical_clustering.PKBC.fit}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{PKBC.fit}}}}}(dat)
&
\sphinxAtStartPar
Performs Poisson Kernel\sphinxhyphen{}based Clustering.
\\
\sphinxhline
\sphinxAtStartPar
{\hyperref[\detokenize{api_reference/generated/QuadratiK.spherical_clustering.PKBC:QuadratiK.spherical_clustering.PKBC.stats}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{PKBC.stats}}}}}()
&
\sphinxAtStartPar
Function to generate descriptive statistics per variable (and per group if available).
\\
\sphinxhline
\sphinxAtStartPar
{\hyperref[\detokenize{api_reference/generated/QuadratiK.spherical_clustering.PKBC:QuadratiK.spherical_clustering.PKBC.validation}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{PKBC.validation}}}}}({[}y\_true{]})
&
\sphinxAtStartPar
Computes validation metrics such as ARI, Macro Precision  and Macro Recall when true labels are provided.
\\
\sphinxbottomrule
\end{tabulary}
\sphinxtableafterendhook\par
\sphinxattableend\end{savenotes}


\bigskip\hrule\bigskip

\index{fit() (QuadratiK.spherical\_clustering.PKBC method)@\spxentry{fit()}\spxextra{QuadratiK.spherical\_clustering.PKBC method}}

\begin{fulllineitems}
\phantomsection\label{\detokenize{api_reference/generated/QuadratiK.spherical_clustering.PKBC:QuadratiK.spherical_clustering.PKBC.fit}}
\pysigstartsignatures
\pysiglinewithargsret{\sphinxcode{\sphinxupquote{PKBC.}}\sphinxbfcode{\sphinxupquote{fit}}}{\sphinxparam{\DUrole{n}{dat}}}{}
\pysigstopsignatures
\sphinxAtStartPar
Performs Poisson Kernel\sphinxhyphen{}based Clustering.


\paragraph{Parameters}
\label{\detokenize{api_reference/generated/QuadratiK.spherical_clustering.PKBC:id1}}\begin{quote}
\begin{description}
\sphinxlineitem{dat}{[}numpy.ndarray, pandas.DataFrame{]}
\sphinxAtStartPar
A numeric array of data values.

\end{description}
\end{quote}


\paragraph{Returns}
\label{\detokenize{api_reference/generated/QuadratiK.spherical_clustering.PKBC:returns}}\begin{quote}
\begin{description}
\sphinxlineitem{self}{[}object{]}
\sphinxAtStartPar
Fitted estimator

\end{description}
\end{quote}

\end{fulllineitems}

\index{stats() (QuadratiK.spherical\_clustering.PKBC method)@\spxentry{stats()}\spxextra{QuadratiK.spherical\_clustering.PKBC method}}

\begin{fulllineitems}
\phantomsection\label{\detokenize{api_reference/generated/QuadratiK.spherical_clustering.PKBC:QuadratiK.spherical_clustering.PKBC.stats}}
\pysigstartsignatures
\pysiglinewithargsret{\sphinxcode{\sphinxupquote{PKBC.}}\sphinxbfcode{\sphinxupquote{stats}}}{}{}
\pysigstopsignatures
\sphinxAtStartPar
Function to generate descriptive statistics per variable (and per group if available).


\paragraph{Returns}
\label{\detokenize{api_reference/generated/QuadratiK.spherical_clustering.PKBC:id2}}\begin{quote}
\begin{description}
\sphinxlineitem{summary\_stats\_df}{[}pandas.DataFrame{]}
\sphinxAtStartPar
Dataframe of descriptive statistics

\end{description}
\end{quote}

\end{fulllineitems}

\index{validation() (QuadratiK.spherical\_clustering.PKBC method)@\spxentry{validation()}\spxextra{QuadratiK.spherical\_clustering.PKBC method}}

\begin{fulllineitems}
\phantomsection\label{\detokenize{api_reference/generated/QuadratiK.spherical_clustering.PKBC:QuadratiK.spherical_clustering.PKBC.validation}}
\pysigstartsignatures
\pysiglinewithargsret{\sphinxcode{\sphinxupquote{PKBC.}}\sphinxbfcode{\sphinxupquote{validation}}}{\sphinxparam{\DUrole{n}{y\_true}\DUrole{o}{=}\DUrole{default_value}{None}}}{}
\pysigstopsignatures
\sphinxAtStartPar
Computes validation metrics such as ARI, Macro Precision 
and Macro Recall when true labels are provided.


\paragraph{Parameters}
\label{\detokenize{api_reference/generated/QuadratiK.spherical_clustering.PKBC:id3}}\begin{quote}
\begin{description}
\sphinxlineitem{y\_true}{[}numpy.ndarray. {]}
\sphinxAtStartPar
Array of true memberships to clusters,
Defaults to None.

\end{description}
\end{quote}


\paragraph{Returns}
\label{\detokenize{api_reference/generated/QuadratiK.spherical_clustering.PKBC:id4}}\begin{quote}
\begin{description}
\sphinxlineitem{validation metrics}{[}tuple{]}
\sphinxAtStartPar
The tuple consists of the following:
\begin{itemize}
\item {} \begin{description}
\sphinxlineitem{Adjusted Rand Index}{[}float (returned only when y\_true is provided){]}
\sphinxAtStartPar
Adjusted Rand Index computed between the true and predicted cluster memberships.

\end{description}

\item {} \begin{description}
\sphinxlineitem{Macro Precision}{[}float (returned only when y\_true is provided){]}
\sphinxAtStartPar
Macro Precision computed between the true and predicted cluster memberships.

\end{description}

\item {} \begin{description}
\sphinxlineitem{Macro Recall}{[}float (returned only when y\_true is provided){]}
\sphinxAtStartPar
Macro Recall computed between the true and predicted cluster memberships.

\end{description}

\item {} \begin{description}
\sphinxlineitem{Average Silhouette Score}{[}float{]}
\sphinxAtStartPar
Mean Silhouette Coefficient of all samples.

\end{description}

\end{itemize}

\end{description}
\end{quote}


\paragraph{References}
\label{\detokenize{api_reference/generated/QuadratiK.spherical_clustering.PKBC:id5}}\begin{quote}

\sphinxAtStartPar
Rousseeuw, P.J. (1987) Silhouettes: A graphical aid to the interpretation and validation of cluster analysis. 
Journal of Computational and Applied Mathematics, 20, 53\textendash{}65.
\end{quote}


\paragraph{Notes}
\label{\detokenize{api_reference/generated/QuadratiK.spherical_clustering.PKBC:notes}}\begin{quote}

\sphinxAtStartPar
We have taken a naive approach to map the predicted cluster labels 
to the true class labels (if provided). This might not work in cases where \sphinxtitleref{num\_clust} is large.
Please use \sphinxtitleref{sklearn.metrics} for computing metrics in such cases, and provide the correctly
matched labels.
\end{quote}


\paragraph{See also}
\label{\detokenize{api_reference/generated/QuadratiK.spherical_clustering.PKBC:see-also}}\begin{quote}

\sphinxAtStartPar
\sphinxtitleref{sklearn.metrics} : Scikit\sphinxhyphen{}learn metrics functionality support a wide range of metrics.
\end{quote}

\end{fulllineitems}




\sphinxstepscope


\subsubsection{PKBD}
\label{\detokenize{api_reference/generated/QuadratiK.spherical_clustering.PKBD:pkbd}}\label{\detokenize{api_reference/generated/QuadratiK.spherical_clustering.PKBD::doc}}\index{PKBD (class in QuadratiK.spherical\_clustering)@\spxentry{PKBD}\spxextra{class in QuadratiK.spherical\_clustering}}

\begin{fulllineitems}
\phantomsection\label{\detokenize{api_reference/generated/QuadratiK.spherical_clustering.PKBD:QuadratiK.spherical_clustering.PKBD}}
\pysigstartsignatures
\pysigline{\sphinxbfcode{\sphinxupquote{class\DUrole{w}{ }}}\sphinxcode{\sphinxupquote{QuadratiK.spherical\_clustering.}}\sphinxbfcode{\sphinxupquote{PKBD}}}
\pysigstopsignatures
\sphinxAtStartPar
Class for estimating density and generating samples of Poisson\sphinxhyphen{}kernel based distribution (PKBD).

\end{fulllineitems}

\subsubsection*{Methods}


\begin{savenotes}\sphinxattablestart
\sphinxthistablewithglobalstyle
\sphinxthistablewithnovlinesstyle
\centering
\begin{tabulary}{\linewidth}[t]{\X{1}{2}\X{1}{2}}
\sphinxtoprule
\sphinxtableatstartofbodyhook
\sphinxAtStartPar
{\hyperref[\detokenize{api_reference/generated/QuadratiK.spherical_clustering.PKBD:QuadratiK.spherical_clustering.PKBD.dpkb}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{PKBD.dpkb}}}}}(x, mu, rho{[}, logdens{]})
&
\sphinxAtStartPar
Function for estimating the density function of the PKB distribution.
\\
\sphinxhline
\sphinxAtStartPar
{\hyperref[\detokenize{api_reference/generated/QuadratiK.spherical_clustering.PKBD:QuadratiK.spherical_clustering.PKBD.rpkb}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{PKBD.rpkb}}}}}(n, mu, rho{[}, method, random\_state{]})
&
\sphinxAtStartPar
Function for generating a random sample from PKBD.
\\
\sphinxbottomrule
\end{tabulary}
\sphinxtableafterendhook\par
\sphinxattableend\end{savenotes}


\bigskip\hrule\bigskip

\index{dpkb() (QuadratiK.spherical\_clustering.PKBD method)@\spxentry{dpkb()}\spxextra{QuadratiK.spherical\_clustering.PKBD method}}

\begin{fulllineitems}
\phantomsection\label{\detokenize{api_reference/generated/QuadratiK.spherical_clustering.PKBD:QuadratiK.spherical_clustering.PKBD.dpkb}}
\pysigstartsignatures
\pysiglinewithargsret{\sphinxcode{\sphinxupquote{PKBD.}}\sphinxbfcode{\sphinxupquote{dpkb}}}{\sphinxparam{\DUrole{n}{x}}\sphinxparamcomma \sphinxparam{\DUrole{n}{mu}}\sphinxparamcomma \sphinxparam{\DUrole{n}{rho}}\sphinxparamcomma \sphinxparam{\DUrole{n}{logdens}\DUrole{o}{=}\DUrole{default_value}{False}}}{}
\pysigstopsignatures
\sphinxAtStartPar
Function for estimating the density function of the PKB distribution.


\paragraph{Parameters}
\label{\detokenize{api_reference/generated/QuadratiK.spherical_clustering.PKBD:parameters}}\begin{quote}
\begin{description}
\sphinxlineitem{x}{[}numpy.ndarray, pandas.DataFrame{]}
\sphinxAtStartPar
A matrix with a number of columns \textgreater{}= 2.

\sphinxlineitem{mu}{[}float{]}
\sphinxAtStartPar
Location parameter with the same length as the rows of x. Normalized to length one.

\sphinxlineitem{rho}{[}float{]}
\sphinxAtStartPar
Concentration parameter. \(\rho \in (0,1]\).

\sphinxlineitem{logdens}{[}bool, optional{]}
\sphinxAtStartPar
If True, densities d are given as \(\log(d)\). Defaults to False.

\end{description}
\end{quote}


\paragraph{Returns}
\label{\detokenize{api_reference/generated/QuadratiK.spherical_clustering.PKBD:returns}}\begin{quote}
\begin{description}
\sphinxlineitem{density}{[}numpy.ndarray{]}
\sphinxAtStartPar
An array with the evaluated density values.

\end{description}
\end{quote}

\end{fulllineitems}

\index{rpkb() (QuadratiK.spherical\_clustering.PKBD method)@\spxentry{rpkb()}\spxextra{QuadratiK.spherical\_clustering.PKBD method}}

\begin{fulllineitems}
\phantomsection\label{\detokenize{api_reference/generated/QuadratiK.spherical_clustering.PKBD:QuadratiK.spherical_clustering.PKBD.rpkb}}
\pysigstartsignatures
\pysiglinewithargsret{\sphinxcode{\sphinxupquote{PKBD.}}\sphinxbfcode{\sphinxupquote{rpkb}}}{\sphinxparam{\DUrole{n}{n}}\sphinxparamcomma \sphinxparam{\DUrole{n}{mu}}\sphinxparamcomma \sphinxparam{\DUrole{n}{rho}}\sphinxparamcomma \sphinxparam{\DUrole{n}{method}\DUrole{o}{=}\DUrole{default_value}{\textquotesingle{}rejvmf\textquotesingle{}}}\sphinxparamcomma \sphinxparam{\DUrole{n}{random\_state}\DUrole{o}{=}\DUrole{default_value}{None}}}{}
\pysigstopsignatures
\sphinxAtStartPar
Function for generating a random sample from PKBD. 
The number of observation generated is determined by \sphinxtitleref{n}.


\paragraph{Parameters}
\label{\detokenize{api_reference/generated/QuadratiK.spherical_clustering.PKBD:id1}}\begin{quote}
\begin{description}
\sphinxlineitem{n}{[}int{]}
\sphinxAtStartPar
Sample size.

\sphinxlineitem{mu}{[}float{]}
\sphinxAtStartPar
Location parameter with the same length as the quantiles.

\sphinxlineitem{rho}{[}float{]}
\sphinxAtStartPar
Concentration parameter. \(\rho \in (0,1]\).

\sphinxlineitem{method}{[}str, optional{]}
\sphinxAtStartPar
String that indicates the method used for sampling observations. 
The available methods are :
\begin{itemize}
\item {} \begin{description}
\sphinxlineitem{‘rejvmf’: acceptance\sphinxhyphen{}rejection algorithm using von Mises\sphinxhyphen{}Fisher envelops.}
\sphinxAtStartPar
(Algorithm in Table 2 of Golzy and Markatou 2020);

\end{description}

\item {} \begin{description}
\sphinxlineitem{‘rejacg’: using angular central Gaussian envelops. }
\sphinxAtStartPar
(Algorithm in Table 1 of Sablica et al. 2023);

\end{description}

\end{itemize}

\sphinxAtStartPar
Defaults to ‘rejvmf’.

\sphinxlineitem{random\_state}{[}int, None, optional. {]}
\sphinxAtStartPar
Seed for random number generation. Defaults to None

\end{description}
\end{quote}


\paragraph{Returns}
\label{\detokenize{api_reference/generated/QuadratiK.spherical_clustering.PKBD:id2}}\begin{quote}
\begin{description}
\sphinxlineitem{samples}{[}numpy.ndarray{]}
\sphinxAtStartPar
Generated observations from a poisson kernel\sphinxhyphen{}based density.
This function returns a list with the matrix of generated observations, the 
number of tries and the number of acceptance.

\end{description}
\end{quote}


\paragraph{References}
\label{\detokenize{api_reference/generated/QuadratiK.spherical_clustering.PKBD:references}}\begin{quote}

\sphinxAtStartPar
Golzy M. \& Markatou M. (2020) Poisson Kernel\sphinxhyphen{}Based 
Clustering on the Sphere: Convergence Properties, Identifiability, 
and a Method of Sampling, Journal of Computational and Graphical Statistics, 
29:4, 758\sphinxhyphen{}770, DOI: 10.1080/10618600.2020.1740713.

\sphinxAtStartPar
Sablica L., Hornik K., Leydold J. “Efficient sampling from the PKBD 
distribution,” Electronic Journal of Statistics, 17(2), 2180\sphinxhyphen{}2209, (2023)
\end{quote}


\paragraph{Examples}
\label{\detokenize{api_reference/generated/QuadratiK.spherical_clustering.PKBD:examples}}
\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{k+kn}{from} \PYG{n+nn}{QuadratiK}\PYG{n+nn}{.}\PYG{n+nn}{spherical\PYGZus{}clustering} \PYG{k+kn}{import} \PYG{n}{PKBD}
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{pkbd\PYGZus{}data} \PYG{o}{=} \PYG{n}{PKBD}\PYG{p}{(}\PYG{p}{)}\PYG{o}{.}\PYG{n}{rpkb}\PYG{p}{(}\PYG{l+m+mi}{10}\PYG{p}{,}\PYG{p}{[}\PYG{l+m+mf}{0.5}\PYG{p}{,}\PYG{l+m+mi}{0}\PYG{p}{]}\PYG{p}{,}\PYG{l+m+mf}{0.5}\PYG{p}{,} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{rejvmf}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{n}{random\PYGZus{}state}\PYG{o}{=} \PYG{l+m+mi}{42}\PYG{p}{)}
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{dens\PYGZus{}val}  \PYG{o}{=} \PYG{n}{PKBD}\PYG{p}{(}\PYG{p}{)}\PYG{o}{.}\PYG{n}{dpkb}\PYG{p}{(}\PYG{n}{pkbd\PYGZus{}data}\PYG{p}{,} \PYG{p}{[}\PYG{l+m+mf}{0.5}\PYG{p}{,}\PYG{l+m+mf}{0.5}\PYG{p}{]}\PYG{p}{,}\PYG{l+m+mf}{0.5}\PYG{p}{)}
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n+nb}{print}\PYG{p}{(}\PYG{n}{dens\PYGZus{}val}\PYG{p}{)}
\PYG{g+gp}{... }\PYG{p}{[}\PYG{l+m+mf}{0.46827108} \PYG{l+m+mf}{0.05479605} \PYG{l+m+mf}{0.21163936} \PYG{l+m+mf}{0.06195099} \PYG{l+m+mf}{0.39567698} \PYG{l+m+mf}{0.40473724}
\PYG{g+gp}{... }    \PYG{l+m+mf}{0.26561508} \PYG{l+m+mf}{0.36791766} \PYG{l+m+mf}{0.09324676} \PYG{l+m+mf}{0.46847274}\PYG{p}{]}
\end{sphinxVerbatim}

\end{fulllineitems}



\index{module@\spxentry{module}!QuadratiK.ui@\spxentry{QuadratiK.ui}}\index{QuadratiK.ui@\spxentry{QuadratiK.ui}!module@\spxentry{module}}

\subsection{User Interface}
\label{\detokenize{api_reference/index:user-interface}}\label{\detokenize{api_reference/index:module-QuadratiK.ui}}

\begin{savenotes}\sphinxattablestart
\sphinxthistablewithglobalstyle
\sphinxthistablewithnovlinesstyle
\centering
\begin{tabulary}{\linewidth}[t]{\X{1}{2}\X{1}{2}}
\sphinxtoprule
\sphinxtableatstartofbodyhook
\sphinxAtStartPar
{\hyperref[\detokenize{api_reference/generated/QuadratiK.ui.UI:QuadratiK.ui.UI}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{UI}}}}}()
&
\sphinxAtStartPar
The UI class is a user interface class that runs a Streamlit dashboard using asyncio.
\\
\sphinxbottomrule
\end{tabulary}
\sphinxtableafterendhook\par
\sphinxattableend\end{savenotes}

\sphinxstepscope


\subsubsection{UI}
\label{\detokenize{api_reference/generated/QuadratiK.ui.UI:ui}}\label{\detokenize{api_reference/generated/QuadratiK.ui.UI::doc}}\index{UI (class in QuadratiK.ui)@\spxentry{UI}\spxextra{class in QuadratiK.ui}}

\begin{fulllineitems}
\phantomsection\label{\detokenize{api_reference/generated/QuadratiK.ui.UI:QuadratiK.ui.UI}}
\pysigstartsignatures
\pysigline{\sphinxbfcode{\sphinxupquote{class\DUrole{w}{ }}}\sphinxcode{\sphinxupquote{QuadratiK.ui.}}\sphinxbfcode{\sphinxupquote{UI}}}
\pysigstopsignatures
\sphinxAtStartPar
The UI class is a user interface class that runs a Streamlit dashboard using asyncio.


\paragraph{Examples}
\label{\detokenize{api_reference/generated/QuadratiK.ui.UI:examples}}
\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{k+kn}{from} \PYG{n+nn}{QuadratiK}\PYG{n+nn}{.}\PYG{n+nn}{ui} \PYG{k+kn}{import} \PYG{n}{UI}
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{UI}\PYG{p}{(}\PYG{p}{)}\PYG{o}{.}\PYG{n}{run}\PYG{p}{(}\PYG{p}{)}
\end{sphinxVerbatim}

\end{fulllineitems}

\subsubsection*{Methods}


\begin{savenotes}\sphinxattablestart
\sphinxthistablewithglobalstyle
\sphinxthistablewithnovlinesstyle
\centering
\begin{tabulary}{\linewidth}[t]{\X{1}{2}\X{1}{2}}
\sphinxtoprule
\sphinxtableatstartofbodyhook
\sphinxAtStartPar
{\hyperref[\detokenize{api_reference/generated/QuadratiK.ui.UI:QuadratiK.ui.UI.main}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{UI.main}}}}}()
&
\sphinxAtStartPar
The \sphinxtitleref{main} function runs a Streamlit dashboard by executing a command\sphinxhyphen{}line command.
\\
\sphinxhline
\sphinxAtStartPar
{\hyperref[\detokenize{api_reference/generated/QuadratiK.ui.UI:QuadratiK.ui.UI.run}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{UI.run}}}}}()
&
\sphinxAtStartPar
The function runs the main function asynchronously using the asyncio library in Python.
\\
\sphinxbottomrule
\end{tabulary}
\sphinxtableafterendhook\par
\sphinxattableend\end{savenotes}


\bigskip\hrule\bigskip

\index{main() (QuadratiK.ui.UI method)@\spxentry{main()}\spxextra{QuadratiK.ui.UI method}}

\begin{fulllineitems}
\phantomsection\label{\detokenize{api_reference/generated/QuadratiK.ui.UI:QuadratiK.ui.UI.main}}
\pysigstartsignatures
\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{async\DUrole{w}{ }}}\sphinxcode{\sphinxupquote{UI.}}\sphinxbfcode{\sphinxupquote{main}}}{}{}
\pysigstopsignatures
\sphinxAtStartPar
The \sphinxtitleref{main} function runs a Streamlit dashboard by executing a command\sphinxhyphen{}line command.

\end{fulllineitems}

\index{run() (QuadratiK.ui.UI method)@\spxentry{run()}\spxextra{QuadratiK.ui.UI method}}

\begin{fulllineitems}
\phantomsection\label{\detokenize{api_reference/generated/QuadratiK.ui.UI:QuadratiK.ui.UI.run}}
\pysigstartsignatures
\pysiglinewithargsret{\sphinxcode{\sphinxupquote{UI.}}\sphinxbfcode{\sphinxupquote{run}}}{}{}
\pysigstopsignatures
\sphinxAtStartPar
The function runs the main function asynchronously using the asyncio library in Python.

\end{fulllineitems}



\index{module@\spxentry{module}!QuadratiK.datasets@\spxentry{QuadratiK.datasets}}\index{QuadratiK.datasets@\spxentry{QuadratiK.datasets}!module@\spxentry{module}}

\subsection{Datasets}
\label{\detokenize{api_reference/index:datasets}}\label{\detokenize{api_reference/index:module-QuadratiK.datasets}}

\begin{savenotes}\sphinxattablestart
\sphinxthistablewithglobalstyle
\sphinxthistablewithnovlinesstyle
\centering
\begin{tabulary}{\linewidth}[t]{\X{1}{2}\X{1}{2}}
\sphinxtoprule
\sphinxtableatstartofbodyhook
\sphinxAtStartPar
{\hyperref[\detokenize{api_reference/generated/QuadratiK.datasets.load_wireless_data:QuadratiK.datasets.load_wireless_data}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{load\_wireless\_data}}}}}({[}desc, return\_X\_y, ...{]})
&
\sphinxAtStartPar
The wireless data frame has 2000 rows and 8 columns.
\\
\sphinxbottomrule
\end{tabulary}
\sphinxtableafterendhook\par
\sphinxattableend\end{savenotes}

\sphinxstepscope


\subsubsection{load\_wireless\_data}
\label{\detokenize{api_reference/generated/QuadratiK.datasets.load_wireless_data:load-wireless-data}}\label{\detokenize{api_reference/generated/QuadratiK.datasets.load_wireless_data::doc}}\index{load\_wireless\_data() (in module QuadratiK.datasets)@\spxentry{load\_wireless\_data()}\spxextra{in module QuadratiK.datasets}}

\begin{fulllineitems}
\phantomsection\label{\detokenize{api_reference/generated/QuadratiK.datasets.load_wireless_data:QuadratiK.datasets.load_wireless_data}}
\pysigstartsignatures
\pysiglinewithargsret{\sphinxcode{\sphinxupquote{QuadratiK.datasets.}}\sphinxbfcode{\sphinxupquote{load\_wireless\_data}}}{\sphinxparam{\DUrole{n}{desc}\DUrole{o}{=}\DUrole{default_value}{False}}\sphinxparamcomma \sphinxparam{\DUrole{n}{return\_X\_y}\DUrole{o}{=}\DUrole{default_value}{False}}\sphinxparamcomma \sphinxparam{\DUrole{n}{as\_dataframe}\DUrole{o}{=}\DUrole{default_value}{True}}\sphinxparamcomma \sphinxparam{\DUrole{n}{scaled}\DUrole{o}{=}\DUrole{default_value}{False}}}{}
\pysigstopsignatures
\sphinxAtStartPar
The wireless data frame has 2000 rows and 8 columns. The first 7 variables
report the measurements of the Wi\sphinxhyphen{}Fi signal strength received from 7 Wi\sphinxhyphen{}Fi routers in an
office location in Pittsburgh (USA). The last column indicates the class labels.

\sphinxAtStartPar
The function load\_wireless\_data loads a wireless localization dataset.

\sphinxAtStartPar
Read more in the {\hyperref[\detokenize{user_guide/datasets:datasets}]{\sphinxcrossref{\DUrole{std,std-ref}{User Guide}}}}.


\paragraph{Parameters}
\label{\detokenize{api_reference/generated/QuadratiK.datasets.load_wireless_data:parameters}}\begin{quote}
\begin{description}
\sphinxlineitem{desc}{[}boolean, optional {]}
\sphinxAtStartPar
If set to \sphinxtitleref{True}, the function will return the description along with the data. 
If set to \sphinxtitleref{False}, the description will not be included. Defaults to False.

\sphinxlineitem{return\_X\_y}{[}boolean, optional{]}
\sphinxAtStartPar
Determines whether the function should return the data as separate arrays (\sphinxtitleref{X} and \sphinxtitleref{y}). 
Defaults to False.

\sphinxlineitem{as\_dataframe}{[}boolean, optional{]}
\sphinxAtStartPar
Determines whether the function should return the data as a pandas DataFrame (Trues) 
or as a numpy array (False). Defaults to True.

\sphinxlineitem{scaled}{[}boolean, optional{]}
\sphinxAtStartPar
Determines whether or not the data should be scaled. If set to True, the data will be 
divided by its Euclidean norm along each row. Defaults to False.

\end{description}
\end{quote}


\paragraph{Returns}
\label{\detokenize{api_reference/generated/QuadratiK.datasets.load_wireless_data:returns}}\begin{quote}
\begin{description}
\sphinxlineitem{(data, target)}{[}tuple, if return\_X\_y is True{]}
\sphinxAtStartPar
A tuple of two ndarray. The first containing a 2D array of shape
(n\_samples, n\_features) with each row representing one sample and
each column representing the features. The second ndarray of shape
(n\_samples,) containing the target samples.

\sphinxlineitem{data}{[}pandas.DataFrame, if as\_dataframe is True{]}
\sphinxAtStartPar
Dataframe of the data with shape (n\_samples, n\_features + class)

\sphinxlineitem{(desc, data, target)}{[}tuple, if desc is True and return\_X\_y is True{]}
\sphinxAtStartPar
A tuple of description and two numpy.ndarray. The first containing a 2D 
array of shape (n\_samples, n\_features) with each row representing 
one sample and each column representing the features. The second 
ndarray of shape (n\_samples,) containing the target samples.

\sphinxlineitem{(desc, data)}{[}tuple, if desc is True and as\_dataframe is True{]}
\sphinxAtStartPar
A tuple of description and pandas.DataFrame.
Dataframe of the data with shape (n\_samples, n\_features + class)

\end{description}
\end{quote}


\paragraph{References}
\label{\detokenize{api_reference/generated/QuadratiK.datasets.load_wireless_data:references}}\begin{quote}

\sphinxAtStartPar
Rohra, J.G., Perumal, B., Narayanan, S.J., Thakur, P., Bhatt, R.B. (2017). 
User Localization in an Indoor Environment Using Fuzzy Hybrid of Particle Swarm Optimization 
\& Gravitational Search Algorithm with Neural Networks. In: Deep, K., et al. Proceedings of 
Sixth International Conference on Soft Computing for Problem Solving. Advances in Intelligent 
Systems and Computing, vol 546. Springer, Singapore. \sphinxurl{https://doi.org/10.1007/978-981-10-3322-3\_27}
\end{quote}


\paragraph{Source}
\label{\detokenize{api_reference/generated/QuadratiK.datasets.load_wireless_data:source}}\begin{quote}

\sphinxAtStartPar
Bhatt,Rajen. (2017). Wireless Indoor Localization. UCI Machine Learning Repository.
\sphinxurl{https://doi.org/10.24432/C51880}.
\end{quote}


\paragraph{Examples}
\label{\detokenize{api_reference/generated/QuadratiK.datasets.load_wireless_data:examples}}
\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{k+kn}{from} \PYG{n+nn}{QuadratiK}\PYG{n+nn}{.}\PYG{n+nn}{datasets} \PYG{k+kn}{import} \PYG{n}{load\PYGZus{}wireless\PYGZus{}data}
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{X}\PYG{p}{,} \PYG{n}{y} \PYG{o}{=} \PYG{n}{load\PYGZus{}wireless\PYGZus{}data}\PYG{p}{(}\PYG{n}{return\PYGZus{}X\PYGZus{}y}\PYG{o}{=}\PYG{k+kc}{True}\PYG{p}{)}
\end{sphinxVerbatim}

\end{fulllineitems}



\index{module@\spxentry{module}!QuadratiK.tools@\spxentry{QuadratiK.tools}}\index{QuadratiK.tools@\spxentry{QuadratiK.tools}!module@\spxentry{module}}

\subsection{Tools}
\label{\detokenize{api_reference/index:tools}}\label{\detokenize{api_reference/index:module-QuadratiK.tools}}

\begin{savenotes}\sphinxattablestart
\sphinxthistablewithglobalstyle
\sphinxthistablewithnovlinesstyle
\centering
\begin{tabulary}{\linewidth}[t]{\X{1}{2}\X{1}{2}}
\sphinxtoprule
\sphinxtableatstartofbodyhook
\sphinxAtStartPar
{\hyperref[\detokenize{api_reference/generated/QuadratiK.tools.sample_hypersphere:QuadratiK.tools.sample_hypersphere}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{sample\_hypersphere}}}}}({[}npoints, ndim, random\_state{]})
&
\sphinxAtStartPar
Generate random samples from the hypersphere
\\
\sphinxhline
\sphinxAtStartPar
{\hyperref[\detokenize{api_reference/generated/QuadratiK.tools.stats:QuadratiK.tools.stats}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{stats}}}}}(x{[}, y{]})
&
\sphinxAtStartPar
The stats function calculates statistics for one or multiple groups of data.
\\
\sphinxhline
\sphinxAtStartPar
{\hyperref[\detokenize{api_reference/generated/QuadratiK.tools.qq_plot:QuadratiK.tools.qq_plot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{qq\_plot}}}}}(x{[}, y, dist{]})
&
\sphinxAtStartPar
The function qq\_plot is used to create a quantile\sphinxhyphen{}quantile plot,  either for a single sample or for two samples.
\\
\sphinxhline
\sphinxAtStartPar
{\hyperref[\detokenize{api_reference/generated/QuadratiK.tools.sphere3d:QuadratiK.tools.sphere3d}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{sphere3d}}}}}(x{[}, y{]})
&
\sphinxAtStartPar
The function sphere3d creates a 3D scatter plot with a sphere  as the surface and data points plotted on it.
\\
\sphinxhline
\sphinxAtStartPar
{\hyperref[\detokenize{api_reference/generated/QuadratiK.tools.plot_clusters_2d:QuadratiK.tools.plot_clusters_2d}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{plot\_clusters\_2d}}}}}(x{[}, y{]})
&
\sphinxAtStartPar
This function plots a 2D scatter plot of data points,  with an optional argument to color the points based on  a cluster label, and also plots a unit circle.
\\
\sphinxbottomrule
\end{tabulary}
\sphinxtableafterendhook\par
\sphinxattableend\end{savenotes}

\sphinxstepscope


\subsubsection{sample\_hypersphere}
\label{\detokenize{api_reference/generated/QuadratiK.tools.sample_hypersphere:sample-hypersphere}}\label{\detokenize{api_reference/generated/QuadratiK.tools.sample_hypersphere::doc}}\index{sample\_hypersphere() (in module QuadratiK.tools)@\spxentry{sample\_hypersphere()}\spxextra{in module QuadratiK.tools}}

\begin{fulllineitems}
\phantomsection\label{\detokenize{api_reference/generated/QuadratiK.tools.sample_hypersphere:QuadratiK.tools.sample_hypersphere}}
\pysigstartsignatures
\pysiglinewithargsret{\sphinxcode{\sphinxupquote{QuadratiK.tools.}}\sphinxbfcode{\sphinxupquote{sample\_hypersphere}}}{\sphinxparam{\DUrole{n}{npoints}\DUrole{o}{=}\DUrole{default_value}{100}}\sphinxparamcomma \sphinxparam{\DUrole{n}{ndim}\DUrole{o}{=}\DUrole{default_value}{3}}\sphinxparamcomma \sphinxparam{\DUrole{n}{random\_state}\DUrole{o}{=}\DUrole{default_value}{None}}}{}
\pysigstopsignatures
\sphinxAtStartPar
Generate random samples from the hypersphere


\paragraph{Parameters}
\label{\detokenize{api_reference/generated/QuadratiK.tools.sample_hypersphere:parameters}}\begin{quote}
\begin{description}
\sphinxlineitem{npoints}{[}int, optional.{]}
\sphinxAtStartPar
The number of points to generate. 
Default is 100.

\sphinxlineitem{ndim}{[}int, optional. {]}
\sphinxAtStartPar
The dimensionality of the hypersphere.
Default is 3.

\sphinxlineitem{random\_state}{[}int, None, optional. {]}
\sphinxAtStartPar
Seed for random number generation. Defaults to None

\end{description}
\end{quote}


\paragraph{Returns}
\label{\detokenize{api_reference/generated/QuadratiK.tools.sample_hypersphere:returns}}\begin{quote}
\begin{description}
\sphinxlineitem{data on sphere}{[}numpy.ndarray{]}
\sphinxAtStartPar
An array containing random vectors sampled uniformly 
from the surface of the hypersphere.

\end{description}
\end{quote}


\paragraph{Examples}
\label{\detokenize{api_reference/generated/QuadratiK.tools.sample_hypersphere:examples}}
\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{k+kn}{from} \PYG{n+nn}{QuadratiK}\PYG{n+nn}{.}\PYG{n+nn}{tools} \PYG{k+kn}{import} \PYG{n}{sample\PYGZus{}hypersphere}
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{sample\PYGZus{}hypersphere}\PYG{p}{(}\PYG{l+m+mi}{100}\PYG{p}{,}\PYG{l+m+mi}{3}\PYG{p}{,}\PYG{n}{random\PYGZus{}state} \PYG{o}{=} \PYG{l+m+mi}{42}\PYG{p}{)}
\PYG{g+gp}{... }\PYG{n}{array}\PYG{p}{(}\PYG{p}{[}\PYG{p}{[} \PYG{l+m+mf}{0.60000205}\PYG{p}{,} \PYG{o}{\PYGZhy{}}\PYG{l+m+mf}{0.1670153} \PYG{p}{,}  \PYG{l+m+mf}{0.78237039}\PYG{p}{]}\PYG{p}{,}
\PYG{g+gp}{... }       \PYG{p}{[} \PYG{l+m+mf}{0.97717133}\PYG{p}{,} \PYG{o}{\PYGZhy{}}\PYG{l+m+mf}{0.15023209}\PYG{p}{,} \PYG{o}{\PYGZhy{}}\PYG{l+m+mf}{0.15022156}\PYG{p}{]}\PYG{p}{,} \PYG{o}{.}\PYG{o}{.}\PYG{o}{.}\PYG{o}{.}\PYG{o}{.}\PYG{o}{.}\PYG{o}{.}\PYG{o}{.}
\end{sphinxVerbatim}

\end{fulllineitems}




\sphinxstepscope


\subsubsection{stats}
\label{\detokenize{api_reference/generated/QuadratiK.tools.stats:stats}}\label{\detokenize{api_reference/generated/QuadratiK.tools.stats::doc}}\index{stats() (in module QuadratiK.tools)@\spxentry{stats()}\spxextra{in module QuadratiK.tools}}

\begin{fulllineitems}
\phantomsection\label{\detokenize{api_reference/generated/QuadratiK.tools.stats:QuadratiK.tools.stats}}
\pysigstartsignatures
\pysiglinewithargsret{\sphinxcode{\sphinxupquote{QuadratiK.tools.}}\sphinxbfcode{\sphinxupquote{stats}}}{\sphinxparam{\DUrole{n}{x}}\sphinxparamcomma \sphinxparam{\DUrole{n}{y}\DUrole{o}{=}\DUrole{default_value}{None}}}{}
\pysigstopsignatures
\sphinxAtStartPar
The stats function calculates statistics for one or multiple groups of data.


\paragraph{Parameters}
\label{\detokenize{api_reference/generated/QuadratiK.tools.stats:parameters}}\begin{quote}
\begin{description}
\sphinxlineitem{x}{[}numpy.ndarray, pandas.DataFrame{]}
\sphinxAtStartPar
Data for which statistics is to be calculated.

\sphinxlineitem{y}{[}numpy.ndarray, pandas.DataFrame, optional{]}
\sphinxAtStartPar
The parameter \sphinxtitleref{y} is an optional input that can be either another set of observations,
or the associated labels for observations (data points).

\end{description}
\end{quote}


\paragraph{Returns}
\label{\detokenize{api_reference/generated/QuadratiK.tools.stats:returns}}\begin{quote}
\begin{description}
\sphinxlineitem{summary statistics}{[}pandas.DataFrame{]}
\sphinxAtStartPar
Summary statistics of the input data.

\end{description}
\end{quote}


\paragraph{Examples}
\label{\detokenize{api_reference/generated/QuadratiK.tools.stats:examples}}
\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{k+kn}{import} \PYG{n+nn}{numpy} \PYG{k}{as} \PYG{n+nn}{np}
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{k+kn}{from} \PYG{n+nn}{QuadratiK}\PYG{n+nn}{.}\PYG{n+nn}{tools} \PYG{k+kn}{import} \PYG{n}{stats}
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{np}\PYG{o}{.}\PYG{n}{random}\PYG{o}{.}\PYG{n}{seed}\PYG{p}{(}\PYG{l+m+mi}{42}\PYG{p}{)}
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{X} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{random}\PYG{o}{.}\PYG{n}{randn}\PYG{p}{(}\PYG{l+m+mi}{100}\PYG{p}{,}\PYG{l+m+mi}{4}\PYG{p}{)}
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{stats}\PYG{p}{(}\PYG{n}{X}\PYG{p}{)}
\PYG{g+gp}{... }          \PYG{n}{Feature} \PYG{l+m+mi}{0}  \PYG{n}{Feature} \PYG{l+m+mi}{1}  \PYG{n}{Feature} \PYG{l+m+mi}{2}  \PYG{n}{Feature} \PYG{l+m+mi}{3}
\PYG{g+go}{    Mean     \PYGZhy{}0.009811   0.033746   0.022496   0.043764}
\PYG{g+go}{    Std Dev   0.868065   0.952234   1.044014   0.982240}
\PYG{g+go}{    Median   \PYGZhy{}0.000248  \PYGZhy{}0.024646   0.068665   0.075219}
\PYG{g+go}{    IQR       1.244319   1.111478   1.318245   1.506492}
\PYG{g+go}{    Min      \PYGZhy{}2.025143  \PYGZhy{}1.959670  \PYGZhy{}3.241267  \PYGZhy{}1.987569}
\PYG{g+go}{    Max       2.314659   3.852731   2.189803   2.720169}
\end{sphinxVerbatim}

\end{fulllineitems}




\sphinxstepscope


\subsubsection{qq\_plot}
\label{\detokenize{api_reference/generated/QuadratiK.tools.qq_plot:qq-plot}}\label{\detokenize{api_reference/generated/QuadratiK.tools.qq_plot::doc}}\index{qq\_plot() (in module QuadratiK.tools)@\spxentry{qq\_plot()}\spxextra{in module QuadratiK.tools}}

\begin{fulllineitems}
\phantomsection\label{\detokenize{api_reference/generated/QuadratiK.tools.qq_plot:QuadratiK.tools.qq_plot}}
\pysigstartsignatures
\pysiglinewithargsret{\sphinxcode{\sphinxupquote{QuadratiK.tools.}}\sphinxbfcode{\sphinxupquote{qq\_plot}}}{\sphinxparam{\DUrole{n}{x}}\sphinxparamcomma \sphinxparam{\DUrole{n}{y}\DUrole{o}{=}\DUrole{default_value}{None}}\sphinxparamcomma \sphinxparam{\DUrole{n}{dist}\DUrole{o}{=}\DUrole{default_value}{\textquotesingle{}norm\textquotesingle{}}}}{}
\pysigstopsignatures
\sphinxAtStartPar
The function qq\_plot is used to create a quantile\sphinxhyphen{}quantile plot, 
either for a single sample or for two samples.


\paragraph{Parameters}
\label{\detokenize{api_reference/generated/QuadratiK.tools.qq_plot:parameters}}\begin{quote}
\begin{description}
\sphinxlineitem{x}{[}numpy.ndarray{]}
\sphinxAtStartPar
The \sphinxtitleref{x} parameter represents the data for which you want to 
create a QQ plot. It can be a single variable or an array\sphinxhyphen{}like 
object containing multiple variables

\sphinxlineitem{y}{[}numpy.ndarray, optional{]}
\sphinxAtStartPar
The parameter \sphinxtitleref{y} is an optional argument that represents the second 
sample for a two\sphinxhyphen{}sample QQ plot. If provided, the function will generate 
a QQ plot comparing the two samples

\sphinxlineitem{dist}{[}str, optional{]}
\sphinxAtStartPar
Supports all the scipy.stats.distributions. The \sphinxtitleref{dist} parameter specifies
the distribution to compare the data against in the QQ plot. By default, 
it is set to “norm” which represents the normal distribution. However, you can 
specify a different distribution if you want to compare the data against
a different distribution. Defaults to “norm”.

\end{description}
\end{quote}


\paragraph{Returns}
\label{\detokenize{api_reference/generated/QuadratiK.tools.qq_plot:returns}}\begin{quote}

\sphinxAtStartPar
Returns QQ plots.
\end{quote}


\paragraph{Examples}
\label{\detokenize{api_reference/generated/QuadratiK.tools.qq_plot:examples}}
\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{k+kn}{import} \PYG{n+nn}{numpy} \PYG{k}{as} \PYG{n+nn}{np}
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{k+kn}{from} \PYG{n+nn}{QuadratiK}\PYG{n+nn}{.}\PYG{n+nn}{tools} \PYG{k+kn}{import} \PYG{n}{qq\PYGZus{}plot}
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{np}\PYG{o}{.}\PYG{n}{random}\PYG{o}{.}\PYG{n}{seed}\PYG{p}{(}\PYG{l+m+mi}{42}\PYG{p}{)}
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{X} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{random}\PYG{o}{.}\PYG{n}{randn}\PYG{p}{(}\PYG{l+m+mi}{100}\PYG{p}{,}\PYG{l+m+mi}{4}\PYG{p}{)}
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{qq\PYGZus{}plot}\PYG{p}{(}\PYG{n}{X}\PYG{p}{)}
\end{sphinxVerbatim}

\end{fulllineitems}




\sphinxstepscope


\subsubsection{sphere3d}
\label{\detokenize{api_reference/generated/QuadratiK.tools.sphere3d:sphere3d}}\label{\detokenize{api_reference/generated/QuadratiK.tools.sphere3d::doc}}\index{sphere3d() (in module QuadratiK.tools)@\spxentry{sphere3d()}\spxextra{in module QuadratiK.tools}}

\begin{fulllineitems}
\phantomsection\label{\detokenize{api_reference/generated/QuadratiK.tools.sphere3d:QuadratiK.tools.sphere3d}}
\pysigstartsignatures
\pysiglinewithargsret{\sphinxcode{\sphinxupquote{QuadratiK.tools.}}\sphinxbfcode{\sphinxupquote{sphere3d}}}{\sphinxparam{\DUrole{n}{x}}\sphinxparamcomma \sphinxparam{\DUrole{n}{y}\DUrole{o}{=}\DUrole{default_value}{None}}}{}
\pysigstopsignatures
\sphinxAtStartPar
The function sphere3d creates a 3D scatter plot with a sphere 
as the surface and data points plotted on it.


\paragraph{Parameters}
\label{\detokenize{api_reference/generated/QuadratiK.tools.sphere3d:parameters}}\begin{quote}
\begin{description}
\sphinxlineitem{x}{[}numpy.ndarray, pandas.DataFrame {]}
\sphinxAtStartPar
The parameter \sphinxtitleref{x} represents the input data for the scatter plot. 
It should be a 2D array\sphinxhyphen{}like object with shape (n\_samples, 3), 
where each row represents the coordinates of a point in
3D space

\sphinxlineitem{y}{[}numpy.ndarray, list, optional{]}
\sphinxAtStartPar
The parameter \sphinxtitleref{y} is an optional input that determines the color and 
shape of each data point in the plot. If \sphinxtitleref{y} is not provided, the 
scatter plot will have the default marker symbol and color.

\end{description}
\end{quote}


\paragraph{Returns}
\label{\detokenize{api_reference/generated/QuadratiK.tools.sphere3d:returns}}\begin{quote}

\sphinxAtStartPar
Returns a 3D plot of a sphere with data points plotted on it.
\end{quote}


\paragraph{Examples}
\label{\detokenize{api_reference/generated/QuadratiK.tools.sphere3d:examples}}
\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{k+kn}{from} \PYG{n+nn}{QuadratiK}\PYG{n+nn}{.}\PYG{n+nn}{tools} \PYG{k+kn}{import} \PYG{n}{sphere3d}
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{np}\PYG{o}{.}\PYG{n}{random}\PYG{o}{.}\PYG{n}{seed}\PYG{p}{(}\PYG{l+m+mi}{42}\PYG{p}{)}
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{X} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{random}\PYG{o}{.}\PYG{n}{randn}\PYG{p}{(}\PYG{l+m+mi}{100}\PYG{p}{,}\PYG{l+m+mi}{3}\PYG{p}{)}
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{sphere3d}\PYG{p}{(}\PYG{n}{X}\PYG{p}{)}
\end{sphinxVerbatim}

\end{fulllineitems}




\sphinxstepscope


\subsubsection{plot\_clusters\_2d}
\label{\detokenize{api_reference/generated/QuadratiK.tools.plot_clusters_2d:plot-clusters-2d}}\label{\detokenize{api_reference/generated/QuadratiK.tools.plot_clusters_2d::doc}}\index{plot\_clusters\_2d() (in module QuadratiK.tools)@\spxentry{plot\_clusters\_2d()}\spxextra{in module QuadratiK.tools}}

\begin{fulllineitems}
\phantomsection\label{\detokenize{api_reference/generated/QuadratiK.tools.plot_clusters_2d:QuadratiK.tools.plot_clusters_2d}}
\pysigstartsignatures
\pysiglinewithargsret{\sphinxcode{\sphinxupquote{QuadratiK.tools.}}\sphinxbfcode{\sphinxupquote{plot\_clusters\_2d}}}{\sphinxparam{\DUrole{n}{x}}\sphinxparamcomma \sphinxparam{\DUrole{n}{y}\DUrole{o}{=}\DUrole{default_value}{None}}}{}
\pysigstopsignatures
\sphinxAtStartPar
This function plots a 2D scatter plot of data points, 
with an optional argument to color the points based on 
a cluster label, and also plots a unit circle.


\paragraph{Parameters}
\label{\detokenize{api_reference/generated/QuadratiK.tools.plot_clusters_2d:parameters}}\begin{quote}
\begin{description}
\sphinxlineitem{x}{[}numpy.ndarray, pandas.DataFrame{]}
\sphinxAtStartPar
The parameter \sphinxtitleref{x} is a 2\sphinxhyphen{}dimensional array or matrix 
containing the coordinates of the data points to be plotted. 
Each row of \sphinxtitleref{x} represents the coordinates of a single data point 
in the 2\sphinxhyphen{}dimensional space

\sphinxlineitem{y}{[}numpy.ndarray, pandas.DataFrame, optional{]}
\sphinxAtStartPar
The parameter \sphinxtitleref{y} is an optional array that represents the labels 
or cluster assignments for each data point in \sphinxtitleref{x}. 
If \sphinxtitleref{y} is provided, the data points will be colored according to their
labels or cluster assignments.

\end{description}
\end{quote}


\paragraph{Returns}
\label{\detokenize{api_reference/generated/QuadratiK.tools.plot_clusters_2d:returns}}\begin{quote}

\sphinxAtStartPar
A matplotlib figure object.
\end{quote}


\paragraph{Examples}
\label{\detokenize{api_reference/generated/QuadratiK.tools.plot_clusters_2d:examples}}
\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{k+kn}{import} \PYG{n+nn}{numpy} \PYG{k}{as} \PYG{n+nn}{np}
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{k+kn}{from} \PYG{n+nn}{QuadratiK}\PYG{n+nn}{.}\PYG{n+nn}{tools} \PYG{k+kn}{import} \PYG{n}{plot\PYGZus{}clusters\PYGZus{}2d}
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{np}\PYG{o}{.}\PYG{n}{random}\PYG{o}{.}\PYG{n}{seed}\PYG{p}{(}\PYG{l+m+mi}{42}\PYG{p}{)}
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{X} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{random}\PYG{o}{.}\PYG{n}{randn}\PYG{p}{(}\PYG{l+m+mi}{100}\PYG{p}{,}\PYG{l+m+mi}{2}\PYG{p}{)}
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{X} \PYG{o}{=} \PYG{n}{X}\PYG{o}{/}\PYG{n}{np}\PYG{o}{.}\PYG{n}{linalg}\PYG{o}{.}\PYG{n}{norm}\PYG{p}{(}\PYG{n}{X}\PYG{p}{,}\PYG{n}{axis} \PYG{o}{=} \PYG{l+m+mi}{1}\PYG{p}{,} \PYG{n}{keepdims}\PYG{o}{=}\PYG{k+kc}{True}\PYG{p}{)}
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{plot\PYGZus{}clusters\PYGZus{}2d}\PYG{p}{(}\PYG{n}{X}\PYG{p}{)}
\end{sphinxVerbatim}

\end{fulllineitems}





\chapter{User Guide}
\label{\detokenize{index:id3}}
\sphinxstepscope


\section{User Guide}
\label{\detokenize{user_guide/index:user-guide}}\label{\detokenize{user_guide/index::doc}}

\subsection{Dataset}
\label{\detokenize{user_guide/index:dataset}}
\sphinxstepscope


\subsubsection{Wireless Indoor Localization Dataset}
\label{\detokenize{user_guide/datasets:wireless-indoor-localization-dataset}}\label{\detokenize{user_guide/datasets:datasets}}\label{\detokenize{user_guide/datasets:id1}}\label{\detokenize{user_guide/datasets::doc}}
\sphinxAtStartPar
The \sphinxtitleref{wireless} data frame has 2000 rows and 8 columns. The first 7 variables
report the measurements of the Wi\sphinxhyphen{}Fi signal strength received from 7 Wi\sphinxhyphen{}Fi routers in an
office location in Pittsburgh (USA). The last column indicates the class labels.


\paragraph{Format}
\label{\detokenize{user_guide/datasets:format}}
\sphinxAtStartPar
A data frame containing the following columns:
\begin{itemize}
\item {} 
\sphinxAtStartPar
\sphinxtitleref{V1}: signal strength from router 1.

\item {} 
\sphinxAtStartPar
\sphinxtitleref{V2}: signal strength from router 2.

\item {} 
\sphinxAtStartPar
\sphinxtitleref{V3}: signal strength from router 3.

\item {} 
\sphinxAtStartPar
\sphinxtitleref{V4}: signal strength from router 4.

\item {} 
\sphinxAtStartPar
\sphinxtitleref{V5}: signal strength from router 5.

\item {} 
\sphinxAtStartPar
\sphinxtitleref{V6}: signal strength from router 6.

\item {} 
\sphinxAtStartPar
\sphinxtitleref{V7}: signal strength from router 7.

\item {} 
\sphinxAtStartPar
\sphinxtitleref{V8}: group memberships, from 1 to 4.

\end{itemize}


\paragraph{Details}
\label{\detokenize{user_guide/datasets:details}}
\sphinxAtStartPar
The Wi\sphinxhyphen{}Fi signal strength is measured in dBm, decibel milliwatts, which is expressed
as a negative value ranging from \sphinxhyphen{}100 to 0. The labels correspond to ‘conference room’,
‘kitchen’, ‘indoor sports room’, and ‘other’. In total, we have 4 groups with 500 observations each.


\paragraph{Source}
\label{\detokenize{user_guide/datasets:source}}
\sphinxAtStartPar
Bhatt,Rajen. (2017). Wireless Indoor Localization. UCI Machine Learning Repository. \sphinxurl{https://doi.org/10.24432/C51880}.


\paragraph{References}
\label{\detokenize{user_guide/datasets:references}}
\sphinxAtStartPar
Rohra, J.G., Perumal, B., Narayanan, S.J., Thakur, P., Bhatt, R.B. (2017). User Localization in an Indoor Environment Using Fuzzy Hybrid of Particle Swarm Optimization \& Gravitational Search Algorithm with Neural Networks. In: Deep, K., et al. Proceedings of Sixth International Conference on Soft Computing for Problem Solving. Advances in Intelligent Systems and Computing, vol 546. Springer, Singapore. \sphinxurl{https://doi.org/10.1007/978-981-10-3322-3\_27}


\subsection{Usage Examples}
\label{\detokenize{user_guide/index:usage-examples}}
\sphinxstepscope


\subsubsection{QuadratiK Usage Examples}
\label{\detokenize{user_guide/basic_usage:QuadratiK-Usage-Examples}}\label{\detokenize{user_guide/basic_usage::doc}}

\paragraph{Normality Test}
\label{\detokenize{user_guide/basic_usage:Normality-Test}}
\sphinxAtStartPar
This section contains example for the Parametric and Non\sphinxhyphen{}parametric Normality Test based on kernel\sphinxhyphen{}based quadratic distances


\subparagraph{Parametric}
\label{\detokenize{user_guide/basic_usage:Parametric}}
\begin{sphinxuseclass}{nbinput}
{
\begin{sphinxVerbatim}[commandchars=\\\{\}]
\llap{\color{nbsphinxin}[1]:\,\hspace{\fboxrule}\hspace{\fboxsep}}\PYG{k+kn}{import} \PYG{n+nn}{numpy} \PYG{k}{as} \PYG{n+nn}{np}
\PYG{k+kn}{from} \PYG{n+nn}{QuadratiK}\PYG{n+nn}{.}\PYG{n+nn}{kernel\PYGZus{}test} \PYG{k+kn}{import} \PYG{n}{KernelTest}
\PYG{n}{np}\PYG{o}{.}\PYG{n}{random}\PYG{o}{.}\PYG{n}{seed}\PYG{p}{(}\PYG{l+m+mi}{42}\PYG{p}{)}
\PYG{n}{data} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{random}\PYG{o}{.}\PYG{n}{randn}\PYG{p}{(}\PYG{l+m+mi}{100}\PYG{p}{,}\PYG{l+m+mi}{2}\PYG{p}{)}

\PYG{n}{normality\PYGZus{}test} \PYG{o}{=} \PYG{n}{KernelTest}\PYG{p}{(}\PYG{n}{h}\PYG{o}{=}\PYG{l+m+mf}{0.4}\PYG{p}{,} \PYG{n}{centering\PYGZus{}type}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{param}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}\PYG{n}{random\PYGZus{}state}\PYG{o}{=}\PYG{l+m+mi}{42}\PYG{p}{)}\PYG{o}{.}\PYG{n}{test}\PYG{p}{(}\PYG{n}{data}\PYG{p}{)}
\PYG{n+nb}{print}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{Test : }\PYG{l+s+si}{\PYGZob{}\PYGZcb{}}\PYG{l+s+s2}{\PYGZdq{}}\PYG{o}{.}\PYG{n}{format}\PYG{p}{(}\PYG{n}{normality\PYGZus{}test}\PYG{o}{.}\PYG{n}{test\PYGZus{}type\PYGZus{}}\PYG{p}{)}\PYG{p}{)}
\PYG{n+nb}{print}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{Execution time: }\PYG{l+s+si}{\PYGZob{}:.3f\PYGZcb{}}\PYG{l+s+s2}{\PYGZdq{}}\PYG{o}{.}\PYG{n}{format}\PYG{p}{(}\PYG{n}{normality\PYGZus{}test}\PYG{o}{.}\PYG{n}{execution\PYGZus{}time}\PYG{p}{)}\PYG{p}{)}
\PYG{n+nb}{print}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{H0 is Rejected : }\PYG{l+s+si}{\PYGZob{}\PYGZcb{}}\PYG{l+s+s2}{\PYGZdq{}}\PYG{o}{.}\PYG{n}{format}\PYG{p}{(}\PYG{n}{normality\PYGZus{}test}\PYG{o}{.}\PYG{n}{h0\PYGZus{}rejected\PYGZus{}}\PYG{p}{)}\PYG{p}{)}
\PYG{n+nb}{print}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{Test Statistic : }\PYG{l+s+si}{\PYGZob{}\PYGZcb{}}\PYG{l+s+s2}{\PYGZdq{}}\PYG{o}{.}\PYG{n}{format}\PYG{p}{(}\PYG{n}{normality\PYGZus{}test}\PYG{o}{.}\PYG{n}{test\PYGZus{}statistic\PYGZus{}}\PYG{p}{)}\PYG{p}{)}
\PYG{n+nb}{print}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{Critical Value (CV) : }\PYG{l+s+si}{\PYGZob{}\PYGZcb{}}\PYG{l+s+s2}{\PYGZdq{}}\PYG{o}{.}\PYG{n}{format}\PYG{p}{(}\PYG{n}{normality\PYGZus{}test}\PYG{o}{.}\PYG{n}{cv\PYGZus{}}\PYG{p}{)}\PYG{p}{)}
\PYG{n+nb}{print}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{CV Method : }\PYG{l+s+si}{\PYGZob{}\PYGZcb{}}\PYG{l+s+s2}{\PYGZdq{}}\PYG{o}{.}\PYG{n}{format}\PYG{p}{(}\PYG{n}{normality\PYGZus{}test}\PYG{o}{.}\PYG{n}{cv\PYGZus{}method\PYGZus{}}\PYG{p}{)}\PYG{p}{)}
\PYG{n+nb}{print}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{Selected tuning parameter : }\PYG{l+s+si}{\PYGZob{}\PYGZcb{}}\PYG{l+s+s2}{\PYGZdq{}}\PYG{o}{.}\PYG{n}{format}\PYG{p}{(}\PYG{n}{normality\PYGZus{}test}\PYG{o}{.}\PYG{n}{h}\PYG{p}{)}\PYG{p}{)}
\end{sphinxVerbatim}
}

\end{sphinxuseclass}
\begin{sphinxuseclass}{nboutput}
\begin{sphinxuseclass}{nblast}
{

\kern-\sphinxverbatimsmallskipamount\kern-\baselineskip
\kern+\FrameHeightAdjust\kern-\fboxrule
\vspace{\nbsphinxcodecellspacing}

\sphinxsetup{VerbatimColor={named}{white}}
\begin{sphinxuseclass}{output_area}
\begin{sphinxuseclass}{}


\begin{sphinxVerbatim}[commandchars=\\\{\}]
Test : Kernel-based quadratic distance Normality test
Execution time: 1.578
H0 is Rejected : False
Test Statistic : -0.004422397826208057
Critical Value (CV) : 0.00495159345113745
CV Method : Empirical
Selected tuning parameter : 0.4
\end{sphinxVerbatim}



\end{sphinxuseclass}
\end{sphinxuseclass}
}

\end{sphinxuseclass}
\end{sphinxuseclass}
\begin{sphinxuseclass}{nbinput}
{
\begin{sphinxVerbatim}[commandchars=\\\{\}]
\llap{\color{nbsphinxin}[2]:\,\hspace{\fboxrule}\hspace{\fboxsep}}\PYG{n+nb}{print}\PYG{p}{(}\PYG{n}{normality\PYGZus{}test}\PYG{o}{.}\PYG{n}{summary}\PYG{p}{(}\PYG{p}{)}\PYG{p}{)}
\end{sphinxVerbatim}
}

\end{sphinxuseclass}
\begin{sphinxuseclass}{nboutput}
\begin{sphinxuseclass}{nblast}
{

\kern-\sphinxverbatimsmallskipamount\kern-\baselineskip
\kern+\FrameHeightAdjust\kern-\fboxrule
\vspace{\nbsphinxcodecellspacing}

\sphinxsetup{VerbatimColor={named}{white}}
\begin{sphinxuseclass}{output_area}
\begin{sphinxuseclass}{}


\begin{sphinxVerbatim}[commandchars=\\\{\}]
Time taken for execution: 1.578 seconds
Test Results
--------------  ----------------------------------------------
Test Type       Kernel-based quadratic distance Normality test
Test Statistic  -0.004422397826208057
Critical Value  0.00495159345113745
Reject H0       False
--------------  ----------------------------------------------
Summary Statistics
           Feature 0    Feature 1
-------  -----------  -----------
Mean         -0.1156       0.034
Std Dev       0.8563       0.9989
Median       -0.0353       0.1323
IQR           1.0704       1.3333
Min          -2.6197      -1.9876
Max           1.8862       2.7202
\end{sphinxVerbatim}



\end{sphinxuseclass}
\end{sphinxuseclass}
}

\end{sphinxuseclass}
\end{sphinxuseclass}

\subparagraph{Non\sphinxhyphen{}parametric}
\label{\detokenize{user_guide/basic_usage:Non-parametric}}
\begin{sphinxuseclass}{nbinput}
{
\begin{sphinxVerbatim}[commandchars=\\\{\}]
\llap{\color{nbsphinxin}[3]:\,\hspace{\fboxrule}\hspace{\fboxsep}}\PYG{n}{normality\PYGZus{}test} \PYG{o}{=} \PYG{n}{KernelTest}\PYG{p}{(}\PYG{n}{h}\PYG{o}{=}\PYG{l+m+mf}{0.4}\PYG{p}{,} \PYG{n}{centering\PYGZus{}type}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{nonparam}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{)}\PYG{o}{.}\PYG{n}{test}\PYG{p}{(}\PYG{n}{data}\PYG{p}{)}
\PYG{n+nb}{print}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{Test : }\PYG{l+s+si}{\PYGZob{}\PYGZcb{}}\PYG{l+s+s2}{\PYGZdq{}}\PYG{o}{.}\PYG{n}{format}\PYG{p}{(}\PYG{n}{normality\PYGZus{}test}\PYG{o}{.}\PYG{n}{test\PYGZus{}type\PYGZus{}}\PYG{p}{)}\PYG{p}{)}
\PYG{n+nb}{print}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{Execution time: }\PYG{l+s+si}{\PYGZob{}:.3f\PYGZcb{}}\PYG{l+s+s2}{\PYGZdq{}}\PYG{o}{.}\PYG{n}{format}\PYG{p}{(}\PYG{n}{normality\PYGZus{}test}\PYG{o}{.}\PYG{n}{execution\PYGZus{}time}\PYG{p}{)}\PYG{p}{)}
\PYG{n+nb}{print}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{H0 is Rejected : }\PYG{l+s+si}{\PYGZob{}\PYGZcb{}}\PYG{l+s+s2}{\PYGZdq{}}\PYG{o}{.}\PYG{n}{format}\PYG{p}{(}\PYG{n}{normality\PYGZus{}test}\PYG{o}{.}\PYG{n}{h0\PYGZus{}rejected\PYGZus{}}\PYG{p}{)}\PYG{p}{)}
\PYG{n+nb}{print}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{Test Statistic : }\PYG{l+s+si}{\PYGZob{}\PYGZcb{}}\PYG{l+s+s2}{\PYGZdq{}}\PYG{o}{.}\PYG{n}{format}\PYG{p}{(}\PYG{n}{normality\PYGZus{}test}\PYG{o}{.}\PYG{n}{test\PYGZus{}statistic\PYGZus{}}\PYG{p}{)}\PYG{p}{)}
\PYG{n+nb}{print}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{Critical Value (CV) : }\PYG{l+s+si}{\PYGZob{}\PYGZcb{}}\PYG{l+s+s2}{\PYGZdq{}}\PYG{o}{.}\PYG{n}{format}\PYG{p}{(}\PYG{n}{normality\PYGZus{}test}\PYG{o}{.}\PYG{n}{cv\PYGZus{}}\PYG{p}{)}\PYG{p}{)}
\PYG{n+nb}{print}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{CV Method : }\PYG{l+s+si}{\PYGZob{}\PYGZcb{}}\PYG{l+s+s2}{\PYGZdq{}}\PYG{o}{.}\PYG{n}{format}\PYG{p}{(}\PYG{n}{normality\PYGZus{}test}\PYG{o}{.}\PYG{n}{cv\PYGZus{}method\PYGZus{}}\PYG{p}{)}\PYG{p}{)}
\PYG{n+nb}{print}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{Selected tuning parameter : }\PYG{l+s+si}{\PYGZob{}\PYGZcb{}}\PYG{l+s+s2}{\PYGZdq{}}\PYG{o}{.}\PYG{n}{format}\PYG{p}{(}\PYG{n}{normality\PYGZus{}test}\PYG{o}{.}\PYG{n}{h}\PYG{p}{)}\PYG{p}{)}
\end{sphinxVerbatim}
}

\end{sphinxuseclass}
\begin{sphinxuseclass}{nboutput}
\begin{sphinxuseclass}{nblast}
{

\kern-\sphinxverbatimsmallskipamount\kern-\baselineskip
\kern+\FrameHeightAdjust\kern-\fboxrule
\vspace{\nbsphinxcodecellspacing}

\sphinxsetup{VerbatimColor={named}{white}}
\begin{sphinxuseclass}{output_area}
\begin{sphinxuseclass}{}


\begin{sphinxVerbatim}[commandchars=\\\{\}]
Test : Kernel-based quadratic distance Normality test
Execution time: 0.131
H0 is Rejected : False
Test Statistic : 0.0015387891795935942
Critical Value (CV) : 0.0020181255711485594
CV Method : Empirical
Selected tuning parameter : 0.4
\end{sphinxVerbatim}



\end{sphinxuseclass}
\end{sphinxuseclass}
}

\end{sphinxuseclass}
\end{sphinxuseclass}
\begin{sphinxuseclass}{nbinput}
{
\begin{sphinxVerbatim}[commandchars=\\\{\}]
\llap{\color{nbsphinxin}[4]:\,\hspace{\fboxrule}\hspace{\fboxsep}}\PYG{n+nb}{print}\PYG{p}{(}\PYG{n}{normality\PYGZus{}test}\PYG{o}{.}\PYG{n}{summary}\PYG{p}{(}\PYG{p}{)}\PYG{p}{)}
\end{sphinxVerbatim}
}

\end{sphinxuseclass}
\begin{sphinxuseclass}{nboutput}
\begin{sphinxuseclass}{nblast}
{

\kern-\sphinxverbatimsmallskipamount\kern-\baselineskip
\kern+\FrameHeightAdjust\kern-\fboxrule
\vspace{\nbsphinxcodecellspacing}

\sphinxsetup{VerbatimColor={named}{white}}
\begin{sphinxuseclass}{output_area}
\begin{sphinxuseclass}{}


\begin{sphinxVerbatim}[commandchars=\\\{\}]
Time taken for execution: 0.131 seconds
Test Results
--------------  ----------------------------------------------
Test Type       Kernel-based quadratic distance Normality test
Test Statistic  0.0015387891795935942
Critical Value  0.0020181255711485594
Reject H0       False
--------------  ----------------------------------------------
Summary Statistics
           Feature 0    Feature 1
-------  -----------  -----------
Mean         -0.1156       0.034
Std Dev       0.8563       0.9989
Median       -0.0353       0.1323
IQR           1.0704       1.3333
Min          -2.6197      -1.9876
Max           1.8862       2.7202
\end{sphinxVerbatim}



\end{sphinxuseclass}
\end{sphinxuseclass}
}

\end{sphinxuseclass}
\end{sphinxuseclass}

\subparagraph{QQ Plot}
\label{\detokenize{user_guide/basic_usage:QQ-Plot}}
\begin{sphinxuseclass}{nbinput}
{
\begin{sphinxVerbatim}[commandchars=\\\{\}]
\llap{\color{nbsphinxin}[5]:\,\hspace{\fboxrule}\hspace{\fboxsep}}\PYG{k+kn}{from} \PYG{n+nn}{QuadratiK}\PYG{n+nn}{.}\PYG{n+nn}{tools} \PYG{k+kn}{import} \PYG{n}{qq\PYGZus{}plot}
\PYG{n}{qq\PYGZus{}plot}\PYG{p}{(}\PYG{n}{data}\PYG{p}{)}
\end{sphinxVerbatim}
}

\end{sphinxuseclass}
\begin{sphinxuseclass}{nboutput}
\begin{sphinxuseclass}{nblast}
\hrule height -\fboxrule\relax
\vspace{\nbsphinxcodecellspacing}

\savebox\nbsphinxpromptbox[0pt][r]{\color{nbsphinxout}\Verb|\strut{[5]:}\,|}

\begin{nbsphinxfancyoutput}

\begin{sphinxuseclass}{output_area}
\begin{sphinxuseclass}{}
\noindent\sphinxincludegraphics[width=534\sphinxpxdimen,height=585\sphinxpxdimen]{{user_guide_basic_usage_10_0}.png}

\end{sphinxuseclass}
\end{sphinxuseclass}
\end{nbsphinxfancyoutput}

\end{sphinxuseclass}
\end{sphinxuseclass}

\paragraph{Two Sample Test}
\label{\detokenize{user_guide/basic_usage:Two-Sample-Test}}
\sphinxAtStartPar
This sections shows example for the two\sphinxhyphen{}sample test using normal kernel\sphinxhyphen{}based quadratic distance

\begin{sphinxuseclass}{nbinput}
{
\begin{sphinxVerbatim}[commandchars=\\\{\}]
\llap{\color{nbsphinxin}[6]:\,\hspace{\fboxrule}\hspace{\fboxsep}}\PYG{k+kn}{import} \PYG{n+nn}{numpy} \PYG{k}{as} \PYG{n+nn}{np}
\PYG{k+kn}{from} \PYG{n+nn}{QuadratiK}\PYG{n+nn}{.}\PYG{n+nn}{kernel\PYGZus{}test} \PYG{k+kn}{import} \PYG{n}{KernelTest}
\PYG{n}{np}\PYG{o}{.}\PYG{n}{random}\PYG{o}{.}\PYG{n}{seed}\PYG{p}{(}\PYG{l+m+mi}{42}\PYG{p}{)}
\PYG{n}{X} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{random}\PYG{o}{.}\PYG{n}{randn}\PYG{p}{(}\PYG{l+m+mi}{100}\PYG{p}{,}\PYG{l+m+mi}{2}\PYG{p}{)}
\PYG{n}{np}\PYG{o}{.}\PYG{n}{random}\PYG{o}{.}\PYG{n}{seed}\PYG{p}{(}\PYG{l+m+mi}{42}\PYG{p}{)}
\PYG{n}{Y} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{random}\PYG{o}{.}\PYG{n}{randn}\PYG{p}{(}\PYG{l+m+mi}{100}\PYG{p}{,}\PYG{l+m+mi}{2}\PYG{p}{)}

\PYG{n}{two\PYGZus{}sample\PYGZus{}test} \PYG{o}{=} \PYG{n}{KernelTest}\PYG{p}{(}\PYG{n}{h}\PYG{o}{=}\PYG{l+m+mf}{0.4}\PYG{p}{,} \PYG{n}{random\PYGZus{}state}\PYG{o}{=}\PYG{l+m+mi}{42}\PYG{p}{)}\PYG{o}{.}\PYG{n}{test}\PYG{p}{(}\PYG{n}{X}\PYG{p}{,}\PYG{n}{Y}\PYG{p}{)}
\PYG{n+nb}{print}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{Test : }\PYG{l+s+si}{\PYGZob{}\PYGZcb{}}\PYG{l+s+s2}{\PYGZdq{}}\PYG{o}{.}\PYG{n}{format}\PYG{p}{(}\PYG{n}{two\PYGZus{}sample\PYGZus{}test}\PYG{o}{.}\PYG{n}{test\PYGZus{}type\PYGZus{}}\PYG{p}{)}\PYG{p}{)}
\PYG{n+nb}{print}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{Execution time: }\PYG{l+s+si}{\PYGZob{}:.3f\PYGZcb{}}\PYG{l+s+s2}{\PYGZdq{}}\PYG{o}{.}\PYG{n}{format}\PYG{p}{(}\PYG{n}{two\PYGZus{}sample\PYGZus{}test}\PYG{o}{.}\PYG{n}{execution\PYGZus{}time}\PYG{p}{)}\PYG{p}{)}
\PYG{n+nb}{print}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{H0 is Rejected : }\PYG{l+s+si}{\PYGZob{}\PYGZcb{}}\PYG{l+s+s2}{\PYGZdq{}}\PYG{o}{.}\PYG{n}{format}\PYG{p}{(}\PYG{n}{two\PYGZus{}sample\PYGZus{}test}\PYG{o}{.}\PYG{n}{h0\PYGZus{}rejected\PYGZus{}}\PYG{p}{)}\PYG{p}{)}
\PYG{n+nb}{print}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{Test Statistic : }\PYG{l+s+si}{\PYGZob{}\PYGZcb{}}\PYG{l+s+s2}{\PYGZdq{}}\PYG{o}{.}\PYG{n}{format}\PYG{p}{(}\PYG{n}{two\PYGZus{}sample\PYGZus{}test}\PYG{o}{.}\PYG{n}{test\PYGZus{}statistic\PYGZus{}}\PYG{p}{)}\PYG{p}{)}
\PYG{n+nb}{print}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{Critical Value (CV) : }\PYG{l+s+si}{\PYGZob{}\PYGZcb{}}\PYG{l+s+s2}{\PYGZdq{}}\PYG{o}{.}\PYG{n}{format}\PYG{p}{(}\PYG{n}{two\PYGZus{}sample\PYGZus{}test}\PYG{o}{.}\PYG{n}{cv\PYGZus{}}\PYG{p}{)}\PYG{p}{)}
\PYG{n+nb}{print}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{CV Method : }\PYG{l+s+si}{\PYGZob{}\PYGZcb{}}\PYG{l+s+s2}{\PYGZdq{}}\PYG{o}{.}\PYG{n}{format}\PYG{p}{(}\PYG{n}{two\PYGZus{}sample\PYGZus{}test}\PYG{o}{.}\PYG{n}{cv\PYGZus{}method\PYGZus{}}\PYG{p}{)}\PYG{p}{)}
\PYG{n+nb}{print}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{Selected tuning parameter : }\PYG{l+s+si}{\PYGZob{}\PYGZcb{}}\PYG{l+s+s2}{\PYGZdq{}}\PYG{o}{.}\PYG{n}{format}\PYG{p}{(}\PYG{n}{two\PYGZus{}sample\PYGZus{}test}\PYG{o}{.}\PYG{n}{h}\PYG{p}{)}\PYG{p}{)}
\end{sphinxVerbatim}
}

\end{sphinxuseclass}
\begin{sphinxuseclass}{nboutput}
\begin{sphinxuseclass}{nblast}
{

\kern-\sphinxverbatimsmallskipamount\kern-\baselineskip
\kern+\FrameHeightAdjust\kern-\fboxrule
\vspace{\nbsphinxcodecellspacing}

\sphinxsetup{VerbatimColor={named}{white}}
\begin{sphinxuseclass}{output_area}
\begin{sphinxuseclass}{}


\begin{sphinxVerbatim}[commandchars=\\\{\}]
Test : Kernel-based quadratic distance two-sample test
Execution time: 0.041
H0 is Rejected : False
Test Statistic : -0.018355578706893333
Critical Value (CV) : 0.011282236253872464
CV Method : subsampling
Selected tuning parameter : 0.4
\end{sphinxVerbatim}



\end{sphinxuseclass}
\end{sphinxuseclass}
}

\end{sphinxuseclass}
\end{sphinxuseclass}
\begin{sphinxuseclass}{nbinput}
{
\begin{sphinxVerbatim}[commandchars=\\\{\}]
\llap{\color{nbsphinxin}[7]:\,\hspace{\fboxrule}\hspace{\fboxsep}}\PYG{n+nb}{print}\PYG{p}{(}\PYG{n}{two\PYGZus{}sample\PYGZus{}test}\PYG{o}{.}\PYG{n}{summary}\PYG{p}{(}\PYG{p}{)}\PYG{p}{)}
\end{sphinxVerbatim}
}

\end{sphinxuseclass}
\begin{sphinxuseclass}{nboutput}
\begin{sphinxuseclass}{nblast}
{

\kern-\sphinxverbatimsmallskipamount\kern-\baselineskip
\kern+\FrameHeightAdjust\kern-\fboxrule
\vspace{\nbsphinxcodecellspacing}

\sphinxsetup{VerbatimColor={named}{white}}
\begin{sphinxuseclass}{output_area}
\begin{sphinxuseclass}{}


\begin{sphinxVerbatim}[commandchars=\\\{\}]
Time taken for execution: 0.041 seconds
Test Results
--------------  -----------------------------------------------
Test Type       Kernel-based quadratic distance two-sample test
Test Statistic  -0.018355578706893333
Critical Value  0.011282236253872464
Reject H0       False
--------------  -----------------------------------------------
Summary Statistics
                            Group 1    Group 2    Overall
------------------------  ---------  ---------  ---------
('Feature 0', 'Mean')       -0.1156    -0.1156    -0.1156
('Feature 0', 'Std Dev')     0.8563     0.8563     0.8542
('Feature 0', 'Median')     -0.0353    -0.0353    -0.0353
('Feature 0', 'IQR')         1.0704     1.0704     1.0704
('Feature 0', 'Min')        -2.6197    -2.6197    -2.6197
('Feature 0', 'Max')         1.8862     1.8862     1.8862
('Feature 1', 'Mean')        0.034      0.034      0.034
('Feature 1', 'Std Dev')     0.9989     0.9989     0.9963
('Feature 1', 'Median')      0.1323     0.1323     0.1323
('Feature 1', 'IQR')         1.3333     1.3333     1.3333
('Feature 1', 'Min')        -1.9876    -1.9876    -1.9876
('Feature 1', 'Max')         2.7202     2.7202     2.7202
\end{sphinxVerbatim}



\end{sphinxuseclass}
\end{sphinxuseclass}
}

\end{sphinxuseclass}
\end{sphinxuseclass}

\paragraph{K\sphinxhyphen{}Sample Test}
\label{\detokenize{user_guide/basic_usage:K-Sample-Test}}
\sphinxAtStartPar
Shows examples for the kernel\sphinxhyphen{}based quadratic distance k\sphinxhyphen{}sample tests with the Normal kernel and bandwidth parameter h.

\begin{sphinxuseclass}{nbinput}
{
\begin{sphinxVerbatim}[commandchars=\\\{\}]
\llap{\color{nbsphinxin}[8]:\,\hspace{\fboxrule}\hspace{\fboxsep}}\PYG{k+kn}{from} \PYG{n+nn}{QuadratiK}\PYG{n+nn}{.}\PYG{n+nn}{kernel\PYGZus{}test} \PYG{k+kn}{import} \PYG{n}{KernelTest}
\PYG{n}{np}\PYG{o}{.}\PYG{n}{random}\PYG{o}{.}\PYG{n}{seed}\PYG{p}{(}\PYG{l+m+mi}{42}\PYG{p}{)}
\PYG{n}{X} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{random}\PYG{o}{.}\PYG{n}{randn}\PYG{p}{(}\PYG{l+m+mi}{500}\PYG{p}{,}\PYG{l+m+mi}{2}\PYG{p}{)}
\PYG{n}{np}\PYG{o}{.}\PYG{n}{random}\PYG{o}{.}\PYG{n}{seed}\PYG{p}{(}\PYG{l+m+mi}{42}\PYG{p}{)}
\PYG{n}{y} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{random}\PYG{o}{.}\PYG{n}{randint}\PYG{p}{(}\PYG{l+m+mi}{0}\PYG{p}{,}\PYG{l+m+mi}{5}\PYG{p}{,}\PYG{l+m+mi}{500}\PYG{p}{)}
\PYG{n}{k\PYGZus{}sample\PYGZus{}test} \PYG{o}{=} \PYG{n}{KernelTest}\PYG{p}{(}\PYG{n}{h} \PYG{o}{=} \PYG{l+m+mf}{1.5}\PYG{p}{,} \PYG{n}{method} \PYG{o}{=} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{permutation}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{)}\PYG{o}{.}\PYG{n}{test}\PYG{p}{(}\PYG{n}{X}\PYG{p}{,}\PYG{n}{y}\PYG{p}{)}

\PYG{n+nb}{print}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{Test : }\PYG{l+s+si}{\PYGZob{}\PYGZcb{}}\PYG{l+s+s2}{\PYGZdq{}}\PYG{o}{.}\PYG{n}{format}\PYG{p}{(}\PYG{n}{k\PYGZus{}sample\PYGZus{}test}\PYG{o}{.}\PYG{n}{test\PYGZus{}type\PYGZus{}}\PYG{p}{)}\PYG{p}{)}
\PYG{n+nb}{print}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{Execution time: }\PYG{l+s+si}{\PYGZob{}:.3f\PYGZcb{}}\PYG{l+s+s2}{ seconds}\PYG{l+s+s2}{\PYGZdq{}}\PYG{o}{.}\PYG{n}{format}\PYG{p}{(}\PYG{n}{k\PYGZus{}sample\PYGZus{}test}\PYG{o}{.}\PYG{n}{execution\PYGZus{}time}\PYG{p}{)}\PYG{p}{)}
\PYG{n+nb}{print}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{H0 is Rejected : }\PYG{l+s+si}{\PYGZob{}\PYGZcb{}}\PYG{l+s+s2}{\PYGZdq{}}\PYG{o}{.}\PYG{n}{format}\PYG{p}{(}\PYG{n}{k\PYGZus{}sample\PYGZus{}test}\PYG{o}{.}\PYG{n}{h0\PYGZus{}rejected\PYGZus{}}\PYG{p}{)}\PYG{p}{)}
\PYG{n+nb}{print}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{Test Statistic : }\PYG{l+s+si}{\PYGZob{}\PYGZcb{}}\PYG{l+s+s2}{\PYGZdq{}}\PYG{o}{.}\PYG{n}{format}\PYG{p}{(}\PYG{n}{k\PYGZus{}sample\PYGZus{}test}\PYG{o}{.}\PYG{n}{test\PYGZus{}statistic\PYGZus{}}\PYG{p}{)}\PYG{p}{)}
\PYG{n+nb}{print}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{Critical Value (CV) : }\PYG{l+s+si}{\PYGZob{}\PYGZcb{}}\PYG{l+s+s2}{\PYGZdq{}}\PYG{o}{.}\PYG{n}{format}\PYG{p}{(}\PYG{n}{k\PYGZus{}sample\PYGZus{}test}\PYG{o}{.}\PYG{n}{cv\PYGZus{}}\PYG{p}{)}\PYG{p}{)}
\PYG{n+nb}{print}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{CV Method : }\PYG{l+s+si}{\PYGZob{}\PYGZcb{}}\PYG{l+s+s2}{\PYGZdq{}}\PYG{o}{.}\PYG{n}{format}\PYG{p}{(}\PYG{n}{k\PYGZus{}sample\PYGZus{}test}\PYG{o}{.}\PYG{n}{cv\PYGZus{}method\PYGZus{}}\PYG{p}{)}\PYG{p}{)}
\PYG{n+nb}{print}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{Selected tuning parameter : }\PYG{l+s+si}{\PYGZob{}\PYGZcb{}}\PYG{l+s+s2}{\PYGZdq{}}\PYG{o}{.}\PYG{n}{format}\PYG{p}{(}\PYG{n}{k\PYGZus{}sample\PYGZus{}test}\PYG{o}{.}\PYG{n}{h}\PYG{p}{)}\PYG{p}{)}
\end{sphinxVerbatim}
}

\end{sphinxuseclass}
\begin{sphinxuseclass}{nboutput}
\begin{sphinxuseclass}{nblast}
{

\kern-\sphinxverbatimsmallskipamount\kern-\baselineskip
\kern+\FrameHeightAdjust\kern-\fboxrule
\vspace{\nbsphinxcodecellspacing}

\sphinxsetup{VerbatimColor={named}{white}}
\begin{sphinxuseclass}{output_area}
\begin{sphinxuseclass}{}


\begin{sphinxVerbatim}[commandchars=\\\{\}]
Test : Kernel-based quadratic distance K-sample test
Execution time: 0.248 seconds
H0 is Rejected : False
Test Statistic : [0.00140789 0.00035197]
Critical Value (CV) : [0.00431479 0.0010787 ]
CV Method : permutation
Selected tuning parameter : 1.5
\end{sphinxVerbatim}



\end{sphinxuseclass}
\end{sphinxuseclass}
}

\end{sphinxuseclass}
\end{sphinxuseclass}
\begin{sphinxuseclass}{nbinput}
{
\begin{sphinxVerbatim}[commandchars=\\\{\}]
\llap{\color{nbsphinxin}[9]:\,\hspace{\fboxrule}\hspace{\fboxsep}}\PYG{n+nb}{print}\PYG{p}{(}\PYG{n}{k\PYGZus{}sample\PYGZus{}test}\PYG{o}{.}\PYG{n}{summary}\PYG{p}{(}\PYG{p}{)}\PYG{p}{)}
\end{sphinxVerbatim}
}

\end{sphinxuseclass}
\begin{sphinxuseclass}{nboutput}
\begin{sphinxuseclass}{nblast}
{

\kern-\sphinxverbatimsmallskipamount\kern-\baselineskip
\kern+\FrameHeightAdjust\kern-\fboxrule
\vspace{\nbsphinxcodecellspacing}

\sphinxsetup{VerbatimColor={named}{white}}
\begin{sphinxuseclass}{output_area}
\begin{sphinxuseclass}{}


\begin{sphinxVerbatim}[commandchars=\\\{\}]
Time taken for execution: 0.248 seconds
Test Results
--------------  ---------------------------------------------
Test Type       Kernel-based quadratic distance K-sample test
Test Statistic  [0.00140789 0.00035197]
Critical Value  [0.00431479 0.0010787 ]
Reject H0       False
--------------  ---------------------------------------------
Summary Statistics
                            Group 0    Group 1    Group 2    Group 3    Group 4    Overall
------------------------  ---------  ---------  ---------  ---------  ---------  ---------
('Feature 0', 'Mean')        0.033     -0.1227     0.0547    -0.0554     0.1192     0.0036
('Feature 0', 'Std Dev')     1.0563     0.874      0.8279     0.9351     1.1038     0.967
('Feature 0', 'Median')      0.0485    -0.0347     0.0675    -0.0349     0.1958     0.0184
('Feature 0', 'IQR')         1.4214     1.0371     0.9924     1.1388     1.3338     1.239
('Feature 0', 'Min')        -2.6969    -2.0819    -1.7787    -2.651     -3.2413    -3.2413
('Feature 0', 'Max')         2.5269     2.2989     2.1898     2.4458     3.0789     3.0789
('Feature 1', 'Mean')        0.0501     0.072     -0.0934    -0.0257     0.1786     0.0351
('Feature 1', 'Std Dev')     1.0116     1.0488     0.9651     0.9411     0.9945     0.992
('Feature 1', 'Median')      0.0481     0.1714    -0.1857    -0.1872     0.2239     0.0283
('Feature 1', 'IQR')         1.2537     1.3063     1.2909     1.3971     1.4369     1.3616
('Feature 1', 'Min')        -2.0417    -2.3019    -2.0392    -2.4239    -2.2111    -2.4239
('Feature 1', 'Max')         3.8527     2.6324     2.7202     2.4632     2.1905     3.8527
\end{sphinxVerbatim}



\end{sphinxuseclass}
\end{sphinxuseclass}
}

\end{sphinxuseclass}
\end{sphinxuseclass}

\paragraph{Poisson Kernel Test}
\label{\detokenize{user_guide/basic_usage:Poisson-Kernel-Test}}
\sphinxAtStartPar
Shows example for perforing the the kernel\sphinxhyphen{}based quadratic distance Goodness\sphinxhyphen{}of\sphinxhyphen{}fit tests for Uniformity for spherical data using the Poisson kernel with concentration parameter rho.

\begin{sphinxuseclass}{nbinput}
{
\begin{sphinxVerbatim}[commandchars=\\\{\}]
\llap{\color{nbsphinxin}[10]:\,\hspace{\fboxrule}\hspace{\fboxsep}}\PYG{k+kn}{from} \PYG{n+nn}{QuadratiK}\PYG{n+nn}{.}\PYG{n+nn}{tools} \PYG{k+kn}{import} \PYG{n}{sample\PYGZus{}hypersphere}
\PYG{k+kn}{from} \PYG{n+nn}{QuadratiK}\PYG{n+nn}{.}\PYG{n+nn}{poisson\PYGZus{}kernel\PYGZus{}test} \PYG{k+kn}{import} \PYG{n}{PoissonKernelTest}
\PYG{n}{np}\PYG{o}{.}\PYG{n}{random}\PYG{o}{.}\PYG{n}{seed}\PYG{p}{(}\PYG{l+m+mi}{42}\PYG{p}{)}
\PYG{n}{X} \PYG{o}{=} \PYG{n}{sample\PYGZus{}hypersphere}\PYG{p}{(}\PYG{l+m+mi}{100}\PYG{p}{,}\PYG{l+m+mi}{3}\PYG{p}{,} \PYG{n}{random\PYGZus{}state}\PYG{o}{=}\PYG{l+m+mi}{42}\PYG{p}{)}
\PYG{n}{unif\PYGZus{}test} \PYG{o}{=} \PYG{n}{PoissonKernelTest}\PYG{p}{(}\PYG{n}{rho} \PYG{o}{=} \PYG{l+m+mf}{0.7}\PYG{p}{,} \PYG{n}{random\PYGZus{}state}\PYG{o}{=}\PYG{l+m+mi}{42}\PYG{p}{)}\PYG{o}{.}\PYG{n}{test}\PYG{p}{(}\PYG{n}{X}\PYG{p}{)}

\PYG{n+nb}{print}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{Execution time: }\PYG{l+s+si}{\PYGZob{}:.3f\PYGZcb{}}\PYG{l+s+s2}{ seconds}\PYG{l+s+s2}{\PYGZdq{}}\PYG{o}{.}\PYG{n}{format}\PYG{p}{(}\PYG{n}{unif\PYGZus{}test}\PYG{o}{.}\PYG{n}{execution\PYGZus{}time}\PYG{p}{)}\PYG{p}{)}

\PYG{n+nb}{print}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{U Statistic Results}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{)}
\PYG{n+nb}{print}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{H0 is rejected : }\PYG{l+s+si}{\PYGZob{}\PYGZcb{}}\PYG{l+s+s2}{\PYGZdq{}}\PYG{o}{.}\PYG{n}{format}\PYG{p}{(}\PYG{n}{unif\PYGZus{}test}\PYG{o}{.}\PYG{n}{u\PYGZus{}statistic\PYGZus{}h0\PYGZus{}}\PYG{p}{)}\PYG{p}{)}
\PYG{n+nb}{print}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{Un Statistic : }\PYG{l+s+si}{\PYGZob{}\PYGZcb{}}\PYG{l+s+s2}{\PYGZdq{}}\PYG{o}{.}\PYG{n}{format}\PYG{p}{(}\PYG{n}{unif\PYGZus{}test}\PYG{o}{.}\PYG{n}{u\PYGZus{}statistic\PYGZus{}un\PYGZus{}}\PYG{p}{)}\PYG{p}{)}
\PYG{n+nb}{print}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{Critical Value : }\PYG{l+s+si}{\PYGZob{}\PYGZcb{}}\PYG{l+s+s2}{\PYGZdq{}}\PYG{o}{.}\PYG{n}{format}\PYG{p}{(}\PYG{n}{unif\PYGZus{}test}\PYG{o}{.}\PYG{n}{u\PYGZus{}statistic\PYGZus{}cv\PYGZus{}}\PYG{p}{)}\PYG{p}{)}

\PYG{n+nb}{print}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{V Statistic Results}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{)}
\PYG{n+nb}{print}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{H0 is rejected : }\PYG{l+s+si}{\PYGZob{}\PYGZcb{}}\PYG{l+s+s2}{\PYGZdq{}}\PYG{o}{.}\PYG{n}{format}\PYG{p}{(}\PYG{n}{unif\PYGZus{}test}\PYG{o}{.}\PYG{n}{v\PYGZus{}statistic\PYGZus{}h0\PYGZus{}}\PYG{p}{)}\PYG{p}{)}
\PYG{n+nb}{print}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{Vn Statistic : }\PYG{l+s+si}{\PYGZob{}\PYGZcb{}}\PYG{l+s+s2}{\PYGZdq{}}\PYG{o}{.}\PYG{n}{format}\PYG{p}{(}\PYG{n}{unif\PYGZus{}test}\PYG{o}{.}\PYG{n}{v\PYGZus{}statistic\PYGZus{}vn\PYGZus{}}\PYG{p}{)}\PYG{p}{)}
\PYG{n+nb}{print}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{Critical Value : }\PYG{l+s+si}{\PYGZob{}\PYGZcb{}}\PYG{l+s+s2}{\PYGZdq{}}\PYG{o}{.}\PYG{n}{format}\PYG{p}{(}\PYG{n}{unif\PYGZus{}test}\PYG{o}{.}\PYG{n}{v\PYGZus{}statistic\PYGZus{}cv\PYGZus{}}\PYG{p}{)}\PYG{p}{)}
\end{sphinxVerbatim}
}

\end{sphinxuseclass}
\begin{sphinxuseclass}{nboutput}
\begin{sphinxuseclass}{nblast}
{

\kern-\sphinxverbatimsmallskipamount\kern-\baselineskip
\kern+\FrameHeightAdjust\kern-\fboxrule
\vspace{\nbsphinxcodecellspacing}

\sphinxsetup{VerbatimColor={named}{white}}
\begin{sphinxuseclass}{output_area}
\begin{sphinxuseclass}{}


\begin{sphinxVerbatim}[commandchars=\\\{\}]
Execution time: 0.041 seconds
U Statistic Results
H0 is rejected : False
Un Statistic : 1.6156682048968174
Critical Value : 0.06155875299050079
V Statistic Results
H0 is rejected : False
Vn Statistic : 22.83255917641962
Critical Value : 23.229486935225513
\end{sphinxVerbatim}



\end{sphinxuseclass}
\end{sphinxuseclass}
}

\end{sphinxuseclass}
\end{sphinxuseclass}
\begin{sphinxuseclass}{nbinput}
{
\begin{sphinxVerbatim}[commandchars=\\\{\}]
\llap{\color{nbsphinxin}[11]:\,\hspace{\fboxrule}\hspace{\fboxsep}}\PYG{n+nb}{print}\PYG{p}{(}\PYG{n}{unif\PYGZus{}test}\PYG{o}{.}\PYG{n}{summary}\PYG{p}{(}\PYG{p}{)}\PYG{p}{)}
\end{sphinxVerbatim}
}

\end{sphinxuseclass}
\begin{sphinxuseclass}{nboutput}
\begin{sphinxuseclass}{nblast}
{

\kern-\sphinxverbatimsmallskipamount\kern-\baselineskip
\kern+\FrameHeightAdjust\kern-\fboxrule
\vspace{\nbsphinxcodecellspacing}

\sphinxsetup{VerbatimColor={named}{white}}
\begin{sphinxuseclass}{output_area}
\begin{sphinxuseclass}{}


\begin{sphinxVerbatim}[commandchars=\\\{\}]
Time taken for execution: 0.041 seconds
Test Results
--------------------------  -------------------
Test Type                   Poisson Kernel-based quadratic
 distance test of Uniformity on the Sphere
U Statistic Un              1.6156682048968174
U Statistic Critical Value  0.06155875299050079
U Statistic Reject H0       False
V Statistic Vn              22.83255917641962
V Statistic Critical Value  23.229486935225513
V Statistic Reject H0       False
--------------------------  -------------------
Summary Statistics
           Feature 0    Feature 1    Feature 2
-------  -----------  -----------  -----------
Mean          0.0451      -0.1206       0.0309
Std Dev       0.509        0.5988       0.6122
Median        0.132       -0.1596       0.0879
IQR           0.8051       1.0063       1.1473
Min          -0.9548      -0.9929      -0.9904
Max           0.9772       0.9738       0.9996
\end{sphinxVerbatim}



\end{sphinxuseclass}
\end{sphinxuseclass}
}

\end{sphinxuseclass}
\end{sphinxuseclass}

\subparagraph{QQ Plot}
\label{\detokenize{user_guide/basic_usage:id1}}
\begin{sphinxuseclass}{nbinput}
{
\begin{sphinxVerbatim}[commandchars=\\\{\}]
\llap{\color{nbsphinxin}[12]:\,\hspace{\fboxrule}\hspace{\fboxsep}}\PYG{k+kn}{from} \PYG{n+nn}{QuadratiK}\PYG{n+nn}{.}\PYG{n+nn}{tools} \PYG{k+kn}{import} \PYG{n}{qq\PYGZus{}plot}

\PYG{n}{qq\PYGZus{}plot}\PYG{p}{(}\PYG{n}{X}\PYG{p}{,}\PYG{n}{dist} \PYG{o}{=} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{uniform}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{)}
\end{sphinxVerbatim}
}

\end{sphinxuseclass}
\begin{sphinxuseclass}{nboutput}
\begin{sphinxuseclass}{nblast}
\hrule height -\fboxrule\relax
\vspace{\nbsphinxcodecellspacing}

\savebox\nbsphinxpromptbox[0pt][r]{\color{nbsphinxout}\Verb|\strut{[12]:}\,|}

\begin{nbsphinxfancyoutput}

\begin{sphinxuseclass}{output_area}
\begin{sphinxuseclass}{}
\noindent\sphinxincludegraphics[width=547\sphinxpxdimen,height=846\sphinxpxdimen]{{user_guide_basic_usage_24_0}.png}

\end{sphinxuseclass}
\end{sphinxuseclass}
\end{nbsphinxfancyoutput}

\end{sphinxuseclass}
\end{sphinxuseclass}

\paragraph{Poisson Kernel based Clustering}
\label{\detokenize{user_guide/basic_usage:Poisson-Kernel-based-Clustering}}
\sphinxAtStartPar
Shows example for performing the Poisson kernel\sphinxhyphen{}based clustering algorithm on the Sphere based on the Poisson kernel\sphinxhyphen{}based densities.

\begin{sphinxuseclass}{nbinput}
{
\begin{sphinxVerbatim}[commandchars=\\\{\}]
\llap{\color{nbsphinxin}[13]:\,\hspace{\fboxrule}\hspace{\fboxsep}}\PYG{k+kn}{from} \PYG{n+nn}{QuadratiK}\PYG{n+nn}{.}\PYG{n+nn}{datasets} \PYG{k+kn}{import} \PYG{n}{load\PYGZus{}wireless\PYGZus{}data}
\PYG{k+kn}{from} \PYG{n+nn}{QuadratiK}\PYG{n+nn}{.}\PYG{n+nn}{spherical\PYGZus{}clustering} \PYG{k+kn}{import} \PYG{n}{PKBC}
\PYG{k+kn}{from} \PYG{n+nn}{sklearn}\PYG{n+nn}{.}\PYG{n+nn}{preprocessing} \PYG{k+kn}{import} \PYG{n}{LabelEncoder}

\PYG{n}{X}\PYG{p}{,} \PYG{n}{y} \PYG{o}{=} \PYG{n}{load\PYGZus{}wireless\PYGZus{}data}\PYG{p}{(}\PYG{n}{return\PYGZus{}X\PYGZus{}y}\PYG{o}{=}\PYG{k+kc}{True}\PYG{p}{)}

\PYG{n}{le} \PYG{o}{=} \PYG{n}{LabelEncoder}\PYG{p}{(}\PYG{p}{)}
\PYG{n}{le}\PYG{o}{.}\PYG{n}{fit}\PYG{p}{(}\PYG{n}{y}\PYG{p}{)}
\PYG{n}{y} \PYG{o}{=} \PYG{n}{le}\PYG{o}{.}\PYG{n}{transform}\PYG{p}{(}\PYG{n}{y}\PYG{p}{)}

\PYG{n}{cluster\PYGZus{}fit} \PYG{o}{=} \PYG{n}{PKBC}\PYG{p}{(}\PYG{n}{num\PYGZus{}clust}\PYG{o}{=}\PYG{l+m+mi}{4}\PYG{p}{,} \PYG{n}{random\PYGZus{}state}\PYG{o}{=}\PYG{l+m+mi}{42}\PYG{p}{)}\PYG{o}{.}\PYG{n}{fit}\PYG{p}{(}\PYG{n}{X}\PYG{p}{)}
\PYG{n}{ari}\PYG{p}{,} \PYG{n}{macro\PYGZus{}precision}\PYG{p}{,} \PYG{n}{macro\PYGZus{}recall}\PYG{p}{,} \PYG{n}{avg\PYGZus{}silhouette\PYGZus{}Score} \PYG{o}{=} \PYG{n}{cluster\PYGZus{}fit}\PYG{o}{.}\PYG{n}{validation}\PYG{p}{(}\PYG{n}{y}\PYG{p}{)}

\PYG{n+nb}{print}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{Estimated mixing proportions :}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{n}{cluster\PYGZus{}fit}\PYG{o}{.}\PYG{n}{alpha\PYGZus{}}\PYG{p}{)}
\PYG{n+nb}{print}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{Estimated concentration parameters: }\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{n}{cluster\PYGZus{}fit}\PYG{o}{.}\PYG{n}{rho\PYGZus{}}\PYG{p}{)}

\PYG{n+nb}{print}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{Adjusted Rand Index:}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{n}{ari}\PYG{p}{)}
\PYG{n+nb}{print}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{Macro Precision:}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{n}{macro\PYGZus{}precision}\PYG{p}{)}
\PYG{n+nb}{print}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{Macro Recall:}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{n}{macro\PYGZus{}recall}\PYG{p}{)}
\PYG{n+nb}{print}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{Average Silhouette Score:}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{n}{avg\PYGZus{}silhouette\PYGZus{}Score}\PYG{p}{)}
\end{sphinxVerbatim}
}

\end{sphinxuseclass}
\begin{sphinxuseclass}{nboutput}
\begin{sphinxuseclass}{nblast}
{

\kern-\sphinxverbatimsmallskipamount\kern-\baselineskip
\kern+\FrameHeightAdjust\kern-\fboxrule
\vspace{\nbsphinxcodecellspacing}

\sphinxsetup{VerbatimColor={named}{white}}
\begin{sphinxuseclass}{output_area}
\begin{sphinxuseclass}{}


\begin{sphinxVerbatim}[commandchars=\\\{\}]
Estimated mixing proportions : [0.23590339 0.24977919 0.25777522 0.25654219]
Estimated concentration parameters:  [0.97773265 0.98348976 0.98226901 0.98572597]
Adjusted Rand Index: 0.9403086353805835
Macro Precision: 0.9771870612442508
Macro Recall: 0.9769999999999999
Average Silhouette Score: 0.3803089203572107
\end{sphinxVerbatim}



\end{sphinxuseclass}
\end{sphinxuseclass}
}

\end{sphinxuseclass}
\end{sphinxuseclass}

\subparagraph{Elbow Plot using Euclidean Distance and Cosine Similarity based WCSS}
\label{\detokenize{user_guide/basic_usage:Elbow-Plot-using-Euclidean-Distance-and-Cosine-Similarity-based-WCSS}}
\begin{sphinxuseclass}{nbinput}
{
\begin{sphinxVerbatim}[commandchars=\\\{\}]
\llap{\color{nbsphinxin}[14]:\,\hspace{\fboxrule}\hspace{\fboxsep}}\PYG{k+kn}{import} \PYG{n+nn}{matplotlib}\PYG{n+nn}{.}\PYG{n+nn}{pyplot} \PYG{k}{as} \PYG{n+nn}{plt}

\PYG{n}{wcss\PYGZus{}euc} \PYG{o}{=} \PYG{p}{[}\PYG{p}{]}
\PYG{n}{wcss\PYGZus{}cos} \PYG{o}{=} \PYG{p}{[}\PYG{p}{]}

\PYG{k}{for} \PYG{n}{i} \PYG{o+ow}{in} \PYG{n+nb}{range}\PYG{p}{(}\PYG{l+m+mi}{2}\PYG{p}{,} \PYG{l+m+mi}{10}\PYG{p}{)}\PYG{p}{:}
    \PYG{n}{clus\PYGZus{}fit} \PYG{o}{=} \PYG{n}{PKBC}\PYG{p}{(}\PYG{n}{num\PYGZus{}clust}\PYG{o}{=}\PYG{n}{i}\PYG{p}{)}\PYG{o}{.}\PYG{n}{fit}\PYG{p}{(}\PYG{n}{X}\PYG{p}{)}
    \PYG{n}{wcss\PYGZus{}euc}\PYG{o}{.}\PYG{n}{append}\PYG{p}{(}\PYG{n}{clus\PYGZus{}fit}\PYG{o}{.}\PYG{n}{euclidean\PYGZus{}wcss\PYGZus{}}\PYG{p}{)}
    \PYG{n}{wcss\PYGZus{}cos}\PYG{o}{.}\PYG{n}{append}\PYG{p}{(}\PYG{n}{clus\PYGZus{}fit}\PYG{o}{.}\PYG{n}{cosine\PYGZus{}wcss\PYGZus{}}\PYG{p}{)}

\PYG{n}{fig} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{figure}\PYG{p}{(}\PYG{n}{figsize}\PYG{o}{=}\PYG{p}{(}\PYG{l+m+mi}{6}\PYG{p}{,} \PYG{l+m+mi}{4}\PYG{p}{)}\PYG{p}{)}
\PYG{n}{plt}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{n+nb}{list}\PYG{p}{(}\PYG{n+nb}{range}\PYG{p}{(}\PYG{l+m+mi}{2}\PYG{p}{,} \PYG{l+m+mi}{10}\PYG{p}{)}\PYG{p}{)}\PYG{p}{,} \PYG{n}{wcss\PYGZus{}euc}\PYG{p}{,} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{\PYGZhy{}\PYGZhy{}o}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{)}
\PYG{n}{plt}\PYG{o}{.}\PYG{n}{xlabel}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{Number of Cluster}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{)}
\PYG{n}{plt}\PYG{o}{.}\PYG{n}{ylabel}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{Within Cluster Sum of Squares (WCSS)}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{)}
\PYG{n}{plt}\PYG{o}{.}\PYG{n}{title}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{Elbow Plot for Wireless Indoor Localization dataset}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{)}
\PYG{n}{plt}\PYG{o}{.}\PYG{n}{show}\PYG{p}{(}\PYG{p}{)}

\PYG{n}{fig} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{figure}\PYG{p}{(}\PYG{n}{figsize}\PYG{o}{=}\PYG{p}{(}\PYG{l+m+mi}{6}\PYG{p}{,} \PYG{l+m+mi}{4}\PYG{p}{)}\PYG{p}{)}
\PYG{n}{plt}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{n+nb}{list}\PYG{p}{(}\PYG{n+nb}{range}\PYG{p}{(}\PYG{l+m+mi}{2}\PYG{p}{,}\PYG{l+m+mi}{10}\PYG{p}{)}\PYG{p}{)}\PYG{p}{,}\PYG{n}{wcss\PYGZus{}cos}\PYG{p}{,} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{\PYGZhy{}\PYGZhy{}o}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{)}
\PYG{n}{plt}\PYG{o}{.}\PYG{n}{xlabel}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{Number of Cluster}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{)}
\PYG{n}{plt}\PYG{o}{.}\PYG{n}{ylabel}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{Within Cluster Sum of Squares (WCSS)}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{)}
\PYG{n}{plt}\PYG{o}{.}\PYG{n}{title}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{Elbow Plot for Wireless Indoor Localization dataset}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{)}
\PYG{n}{plt}\PYG{o}{.}\PYG{n}{show}\PYG{p}{(}\PYG{p}{)}
\end{sphinxVerbatim}
}

\end{sphinxuseclass}
\begin{sphinxuseclass}{nboutput}
\hrule height -\fboxrule\relax
\vspace{\nbsphinxcodecellspacing}

\makeatletter\setbox\nbsphinxpromptbox\box\voidb@x\makeatother

\begin{nbsphinxfancyoutput}

\begin{sphinxuseclass}{output_area}
\begin{sphinxuseclass}{}
\noindent\sphinxincludegraphics[width=532\sphinxpxdimen,height=393\sphinxpxdimen]{{user_guide_basic_usage_29_0}.png}

\end{sphinxuseclass}
\end{sphinxuseclass}
\end{nbsphinxfancyoutput}

\end{sphinxuseclass}
\begin{sphinxuseclass}{nboutput}
\begin{sphinxuseclass}{nblast}
\hrule height -\fboxrule\relax
\vspace{\nbsphinxcodecellspacing}

\makeatletter\setbox\nbsphinxpromptbox\box\voidb@x\makeatother

\begin{nbsphinxfancyoutput}

\begin{sphinxuseclass}{output_area}
\begin{sphinxuseclass}{}
\noindent\sphinxincludegraphics[width=562\sphinxpxdimen,height=393\sphinxpxdimen]{{user_guide_basic_usage_29_1}.png}

\end{sphinxuseclass}
\end{sphinxuseclass}
\end{nbsphinxfancyoutput}

\end{sphinxuseclass}
\end{sphinxuseclass}

\paragraph{Density Estimation and Sample Generation from PKBD}
\label{\detokenize{user_guide/basic_usage:Density-Estimation-and-Sample-Generation-from-PKBD}}
\begin{sphinxuseclass}{nbinput}
{
\begin{sphinxVerbatim}[commandchars=\\\{\}]
\llap{\color{nbsphinxin}[15]:\,\hspace{\fboxrule}\hspace{\fboxsep}}\PYG{k+kn}{from} \PYG{n+nn}{QuadratiK}\PYG{n+nn}{.}\PYG{n+nn}{spherical\PYGZus{}clustering} \PYG{k+kn}{import} \PYG{n}{PKBD}
\PYG{n}{pkbd\PYGZus{}data} \PYG{o}{=} \PYG{n}{PKBD}\PYG{p}{(}\PYG{p}{)}\PYG{o}{.}\PYG{n}{rpkb}\PYG{p}{(}\PYG{l+m+mi}{10}\PYG{p}{,}\PYG{p}{[}\PYG{l+m+mf}{0.5}\PYG{p}{,}\PYG{l+m+mi}{0}\PYG{p}{]}\PYG{p}{,}\PYG{l+m+mf}{0.5}\PYG{p}{,} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{rejvmf}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{n}{random\PYGZus{}state}\PYG{o}{=} \PYG{l+m+mi}{42}\PYG{p}{)}
\PYG{n}{dens\PYGZus{}val}  \PYG{o}{=} \PYG{n}{PKBD}\PYG{p}{(}\PYG{p}{)}\PYG{o}{.}\PYG{n}{dpkb}\PYG{p}{(}\PYG{n}{pkbd\PYGZus{}data}\PYG{p}{,} \PYG{p}{[}\PYG{l+m+mf}{0.5}\PYG{p}{,}\PYG{l+m+mf}{0.5}\PYG{p}{]}\PYG{p}{,}\PYG{l+m+mf}{0.5}\PYG{p}{)}
\PYG{n+nb}{print}\PYG{p}{(}\PYG{n}{dens\PYGZus{}val}\PYG{p}{)}
\end{sphinxVerbatim}
}

\end{sphinxuseclass}
\begin{sphinxuseclass}{nboutput}
\begin{sphinxuseclass}{nblast}
{

\kern-\sphinxverbatimsmallskipamount\kern-\baselineskip
\kern+\FrameHeightAdjust\kern-\fboxrule
\vspace{\nbsphinxcodecellspacing}

\sphinxsetup{VerbatimColor={named}{white}}
\begin{sphinxuseclass}{output_area}
\begin{sphinxuseclass}{}


\begin{sphinxVerbatim}[commandchars=\\\{\}]
[0.46827108 0.05479605 0.21163936 0.06195099 0.39567698 0.40473724
 0.26561508 0.36791766 0.09324676 0.46847274]
\end{sphinxVerbatim}



\end{sphinxuseclass}
\end{sphinxuseclass}
}

\end{sphinxuseclass}
\end{sphinxuseclass}

\paragraph{Tuning Parameter \protect\(h\protect\) selection}
\label{\detokenize{user_guide/basic_usage:Tuning-Parameter-h-selection}}
\sphinxAtStartPar
Computes the kernel bandwidth of the Gaussian kernel for the two\sphinxhyphen{}sample and ksample kernel\sphinxhyphen{}based quadratic distance (KBQD) tests.

\begin{sphinxuseclass}{nbinput}
{
\begin{sphinxVerbatim}[commandchars=\\\{\}]
\llap{\color{nbsphinxin}[16]:\,\hspace{\fboxrule}\hspace{\fboxsep}}\PYG{k+kn}{import} \PYG{n+nn}{numpy} \PYG{k}{as} \PYG{n+nn}{np}
\PYG{k+kn}{from} \PYG{n+nn}{QuadratiK}\PYG{n+nn}{.}\PYG{n+nn}{kernel\PYGZus{}test} \PYG{k+kn}{import} \PYG{n}{select\PYGZus{}h}
\PYG{n}{np}\PYG{o}{.}\PYG{n}{random}\PYG{o}{.}\PYG{n}{seed}\PYG{p}{(}\PYG{l+m+mi}{42}\PYG{p}{)}
\PYG{n}{X} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{random}\PYG{o}{.}\PYG{n}{randn}\PYG{p}{(}\PYG{l+m+mi}{200}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{p}{)}
\PYG{n}{np}\PYG{o}{.}\PYG{n}{random}\PYG{o}{.}\PYG{n}{seed}\PYG{p}{(}\PYG{l+m+mi}{42}\PYG{p}{)}
\PYG{n}{y} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{random}\PYG{o}{.}\PYG{n}{randint}\PYG{p}{(}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{p}{,} \PYG{l+m+mi}{200}\PYG{p}{)}
\PYG{n}{h\PYGZus{}selected}\PYG{p}{,} \PYG{n}{all\PYGZus{}values}\PYG{p}{,} \PYG{n}{power\PYGZus{}plot} \PYG{o}{=} \PYG{n}{select\PYGZus{}h}\PYG{p}{(}
    \PYG{n}{X}\PYG{p}{,} \PYG{n}{y}\PYG{p}{,} \PYG{n}{alternative}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{location}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{power\PYGZus{}plot}\PYG{o}{=}\PYG{k+kc}{True}\PYG{p}{,}  \PYG{n}{random\PYGZus{}state}\PYG{o}{=}\PYG{k+kc}{None}\PYG{p}{)}
\PYG{n+nb}{print}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{Selected h is: }\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{n}{h\PYGZus{}selected}\PYG{p}{)}
\end{sphinxVerbatim}
}

\end{sphinxuseclass}
\begin{sphinxuseclass}{nboutput}
\begin{sphinxuseclass}{nblast}
{

\kern-\sphinxverbatimsmallskipamount\kern-\baselineskip
\kern+\FrameHeightAdjust\kern-\fboxrule
\vspace{\nbsphinxcodecellspacing}

\sphinxsetup{VerbatimColor={named}{white}}
\begin{sphinxuseclass}{output_area}
\begin{sphinxuseclass}{}


\begin{sphinxVerbatim}[commandchars=\\\{\}]
Selected h is:  2.8
\end{sphinxVerbatim}



\end{sphinxuseclass}
\end{sphinxuseclass}
}

\end{sphinxuseclass}
\end{sphinxuseclass}
\begin{sphinxuseclass}{nbinput}
{
\begin{sphinxVerbatim}[commandchars=\\\{\}]
\llap{\color{nbsphinxin}[17]:\,\hspace{\fboxrule}\hspace{\fboxsep}}\PYG{c+c1}{\PYGZsh{}shows the detailed power vs h table}
\PYG{n}{all\PYGZus{}values}
\end{sphinxVerbatim}
}

\end{sphinxuseclass}
\begin{sphinxuseclass}{nboutput}
\begin{sphinxuseclass}{nblast}
{

\kern-\sphinxverbatimsmallskipamount\kern-\baselineskip
\kern+\FrameHeightAdjust\kern-\fboxrule
\vspace{\nbsphinxcodecellspacing}

\sphinxsetup{VerbatimColor={named}{white}}
\begin{sphinxuseclass}{output_area}
\begin{sphinxuseclass}{}


\begin{sphinxVerbatim}[commandchars=\\\{\}]
\llap{\color{nbsphinxout}[17]:\,\hspace{\fboxrule}\hspace{\fboxsep}}     h  delta  power
0  0.4    0.2   0.20
1  0.8    0.2   0.26
2  1.2    0.2   0.42
3  1.6    0.2   0.34
4  2.0    0.2   0.38
5  2.4    0.2   0.36
6  2.8    0.2   0.56
7  3.2    0.2   0.38
\end{sphinxVerbatim}



\end{sphinxuseclass}
\end{sphinxuseclass}
}

\end{sphinxuseclass}
\end{sphinxuseclass}
\begin{sphinxuseclass}{nbinput}
{
\begin{sphinxVerbatim}[commandchars=\\\{\}]
\llap{\color{nbsphinxin}[18]:\,\hspace{\fboxrule}\hspace{\fboxsep}}\PYG{c+c1}{\PYGZsh{}shows the power plot}
\PYG{n}{power\PYGZus{}plot}
\end{sphinxVerbatim}
}

\end{sphinxuseclass}
\begin{sphinxuseclass}{nboutput}
\begin{sphinxuseclass}{nblast}
\hrule height -\fboxrule\relax
\vspace{\nbsphinxcodecellspacing}

\savebox\nbsphinxpromptbox[0pt][r]{\color{nbsphinxout}\Verb|\strut{[18]:}\,|}

\begin{nbsphinxfancyoutput}

\begin{sphinxuseclass}{output_area}
\begin{sphinxuseclass}{}
\noindent\sphinxincludegraphics[width=699\sphinxpxdimen,height=393\sphinxpxdimen]{{user_guide_basic_usage_36_0}.png}

\end{sphinxuseclass}
\end{sphinxuseclass}
\end{nbsphinxfancyoutput}

\end{sphinxuseclass}
\end{sphinxuseclass}

\renewcommand{\indexname}{Python Module Index}
\begin{sphinxtheindex}
\let\bigletter\sphinxstyleindexlettergroup
\bigletter{q}
\item\relax\sphinxstyleindexentry{QuadratiK.datasets}\sphinxstyleindexpageref{api_reference/index:\detokenize{module-QuadratiK.datasets}}
\item\relax\sphinxstyleindexentry{QuadratiK.kernel\_test}\sphinxstyleindexpageref{api_reference/index:\detokenize{module-QuadratiK.kernel_test}}
\item\relax\sphinxstyleindexentry{QuadratiK.poisson\_kernel\_test}\sphinxstyleindexpageref{api_reference/index:\detokenize{module-QuadratiK.poisson_kernel_test}}
\item\relax\sphinxstyleindexentry{QuadratiK.spherical\_clustering}\sphinxstyleindexpageref{api_reference/index:\detokenize{module-QuadratiK.spherical_clustering}}
\item\relax\sphinxstyleindexentry{QuadratiK.tools}\sphinxstyleindexpageref{api_reference/index:\detokenize{module-QuadratiK.tools}}
\item\relax\sphinxstyleindexentry{QuadratiK.ui}\sphinxstyleindexpageref{api_reference/index:\detokenize{module-QuadratiK.ui}}
\end{sphinxtheindex}

\renewcommand{\indexname}{Index}
\printindex
\end{document}