https://github.com/afarahi/kllr
Kernel Localized Linear Regression (KLLR)
Science Score: 10.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
○codemeta.json file
-
○.zenodo.json file
-
○DOI references
-
✓Academic publication links
Links to: arxiv.org -
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (14.2%) to scientific vocabulary
Keywords
Repository
Kernel Localized Linear Regression (KLLR)
Basic Info
Statistics
- Stars: 11
- Watchers: 5
- Forks: 4
- Open Issues: 1
- Releases: 0
Topics
Metadata Files
readme.md
Introduction
Linear regression of the simple least-squares variety has been a canonical method used to characterize the relation between two variables, but its utility is limited by the fact that it reduces full population statistics down to three numbers: a slope, normalization and variance/standard deviation. With large empirical or simulated samples we can perform a more sensitive analysis using a localized linear regression method (see, Farahi et al. 2018 and Anbajagane et al. 2020). The KLLR method generates estimates of conditional statistics in terms of the local the slope, normalization, and covariance. Such a method provides a more nuanced description of population statistics appropriate for the very large samples with non-linear trends.
This code is an implementation of the Kernel Localized Linear Regression (KLLR) method that performs a localized Linear regression described in Farahi et al. (2022). It employs bootstrap re-sampling technique to estimate the uncertainties. We also provide a set of visualization tools so practitioners can seamlessly generate visualization of the model parameters.
If you use KLLR or derivates based on it, please cite the following papers which introduced the tool:
KLLR: A scale-dependent, multivariate model class for regression analysis
A list of other publications that employed KLLR in their data analysis.
Wu et al., Optical selection bias and projection effects in stacked galaxy cluster weak lensing, MNRAS (2022).
W. K. Black, A. E. Evrard, Red Dragon: a redshift-evolving Gaussian mixture model for galaxies, MNRAS (2022).
D. Anbajagane, A. Evrard, A. Farahi, Baryonic Imprints on DM Halos: Population Statistics from Dwarf Galaxies to Galaxy Clusters, MNRAS (2022).
D. Anbajagane et al., Galaxy Velocity Bias in Cosmological Simulations: Towards Percent-level Calibration, MNRAS (2022).
A. Nachmann, W. K. Black, Intra-cluster Summed Galaxy Colors, arXiv preprint (2021).
D. Anbajagane et al., Stellar Property Statistics of Massive Halos from Cosmological Hydrodynamics Simulations: Common Kernel Shapes, MNRAS (2020).
Dependencies
numpy, scipy, matplotlib, pandas, sklearn, tqdm
References
[1]. A. Farahi, et al. "KLLR: A scale-dependent, multivariate model class for regression analysis." (2022, arXiv: 2202.09903)
[2]. A. Farahi, et al. "Localized massive halo properties in BAHAMAS and MACSIS simulations: scalings, lognormality, and covariance." Monthly Notices of the Royal Astronomical Society 478.2 (2018): 2618-2632.
[3]. D. Anbajagane, et al. Stellar Property Statistics of Massive Halos from Cosmological Hydrodynamics Simulations: Common Kernel Shapes. No. arXiv: 2001.02283. 2020.
Acknowledgment
A.F. is supported by the University of Texas at Austin. D.A. is supported by the National Science Foundation Graduate Research Fellowship under Grant No. DGE 1746045.
Installation
Run the following to install:
pip install kllr
Quickstart
To start using KLLR, simply use from KLLR import kllr_model to
access the primary functions and class. The exact requirements for the inputs are
listed in the docstring of the kllr_model() class further below.
An example for using KLLR looks like this:
from kllr import kllr_model
lm = kllr_model(kernel_type = 'gaussian', kernel_width = 0.2)
xrange, yrange_mean, intercept, slope, scatter, skew, kurt = lm.fit(x, y, bins=11)
Illustration
Illustration of the KLLR fit with varying kernel size.

Owner
- Name: Arya Farahi
- Login: afarahi
- Kind: user
- Location: United States
- Company: University of Texas at Austin
- Website: https://afarahi.github.io/
- Repositories: 12
- Profile: https://github.com/afarahi
GitHub Events
Total
- Issues event: 1
- Watch event: 1
- Fork event: 1
Last Year
- Issues event: 1
- Watch event: 1
- Fork event: 1
Committers
Last synced: almost 3 years ago
All Time
- Total Commits: 117
- Total Committers: 3
- Avg Commits per committer: 39.0
- Development Distribution Score (DDS): 0.47
Top Committers
| Name | Commits | |
|---|---|---|
| Dhayaa Anbajagane | d****e@g****m | 62 |
| Arya Farahi | a****6@g****m | 45 |
| Arya Farahi | a****f@m****t | 10 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 1
- Total pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Total issue authors: 1
- Total pull request authors: 0
- Average comments per issue: 0.0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 1
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 1
- Pull request authors: 0
- Average comments per issue: 0.0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- LeiAstro (1)
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- pypi 20 last-month
- Total dependent packages: 0
- Total dependent repositories: 1
- Total versions: 2
- Total maintainers: 1
pypi.org: kllr
Kernel Localized Linear Regression, a scale-dependent, multi-variate model class for regression analysis.
- Homepage: https://github.com/afarahi/kllr
- Documentation: https://kllr.readthedocs.io/
- License: MIT
-
Latest release: 1.0.0
published almost 6 years ago