Skip to content

PPS: Implement rhohat#446

Merged
wkearn merged 1 commit into
TopoToolbox:mainfrom
wkearn:pps-rhohat
Jun 1, 2026
Merged

PPS: Implement rhohat#446
wkearn merged 1 commit into
TopoToolbox:mainfrom
wkearn:pps-rhohat

Conversation

@wkearn

@wkearn wkearn commented May 28, 2026

Copy link
Copy Markdown
Member

This PR provides an implementation of the rhohat estimator. Not all of the functionality of the MATLAB version is supported. Plotting is, as usual, left to the user, and we return just the estimates of the intensity and its confidence intervals. The ecdf function that is used in rhohat is replaced by a ksdensity function that only does the kernel density estimation required by rhohat. The ecdf function can be added separately if necessary (the MATLAB ecdf function may try to do too many things). ksdensity is also simplified by having it return all of the bootstrap samples. Weighted datasets are not yet supported.

At the moment, the bandwidth selected by scipy.stats.gaussian_kde by default is somewhat larger than that selected by MATLAB, especially for small datasets.

This PR provides an implementation of the rhohat estimator. Not all of
the functionality of the MATLAB version is supported. Plotting is, as
usual, left to the user, and we return just the estimates of the
intensity and its confidence intervals. The ecdf function that is used
in rhohat is replaced by a ksdensity function that only does the
kernel density estimation required by rhohat. The ecdf function can be
added separately if necessary (the MATLAB ecdf function may try to do
too many things). ksdensity is also simplified by having it return all
of the bootstrap samples. Weighted datasets are not yet supported.

At the moment, the bandwidth selected by scipy.stats.gaussian_kde by
default is somewhat larger than that selected by MATLAB, especially
for small datasets.

Signed-off-by: William Kearney <william.kearney@uni-potsdam.de>
@wschwanghart

Copy link
Copy Markdown

Very nice, @wkearn. If you have suggestions for changing and improving the MATLAB version, this is very welcome. The current PPS tools are not at the core of TT, so there would a lower probability to break things if we make some substantial changes.

@wkearn wkearn merged commit c9118b2 into TopoToolbox:main Jun 1, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants