8000 Add kw arg to normalize kernel in distance weights. by sjsrey · Pull Request #791 · pysal/libpysal · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add kw arg to normalize kernel in distance weights. #791

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

sjsrey
Copy link
Member
@sjsrey sjsrey commented Jun 3, 2025

This is responding to the discussion in #790.

The default normalize=True preserves the current behavior of the Gaussian kernel weights (heavily used in spreg):
$$K(z) = \frac{1}{\sqrt{2\pi}} e^{-\frac{1}{2} z^2}$$

Setting normalize=False provides an option to use unnormalized Gaussian weights:
$$K(z) = e^{-\frac{1}{2} z^2}$$

@sjsrey sjsrey requested review from ljwolf and martinfleis June 3, 2025 19:33
Copy link
codecov bot commented Jun 3, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 85.4%. Comparing base (e8eb3c7) to head (335a76f).
Report is 3 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@          Coverage Diff          @@
##            main    #791   +/-   ##
=====================================
  Coverage   85.4%   85.4%           
=====================================
  Files        150     150           
  Lines      16012   16014    +2     
=====================================
+ Hits       13673   13677    +4     
+ Misses      2339    2337    -2     
Files with missing lines Coverage Δ
libpysal/weights/distance.py 85.6% <100.0%> (+0.2%) ⬆️
libpysal/weights/tests/test_distance.py 100.0% <100.0%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@martinfleis
Copy link
Member

Can we get it to Graph? And I suppose that it could be generalised to other than a Gaussian kernels as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0