ceresfit

Linear Regression for data set with correlated or uncorrelated uncertainties in both axes.

https://github.com/galactic-forensics/ceresfit

Science Score: 67.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 2 DOI reference(s) in README
  • Academic publication links
    Links to: zenodo.org
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (17.3%) to scientific vocabulary
Last synced: 6 months ago · JSON representation ·

Repository

Linear Regression for data set with correlated or uncorrelated uncertainties in both axes.

Basic Info
  • Host: GitHub
  • Owner: galactic-forensics
  • License: mit
  • Language: Python
  • Default Branch: main
  • Size: 387 KB
Statistics
  • Stars: 12
  • Watchers: 1
  • Forks: 0
  • Open Issues: 0
  • Releases: 5
Created almost 4 years ago · Last pushed 7 months ago
Metadata Files
Readme License Citation

README.md

CEREsFit

DOI pypi tests codecov pre-commit.ci status License: MIT Rye

The goal of CEREsFit (Correlated Errors Regression Estimate Fit) is to provide a python package that allows to calculate linear regressions on data sets with correlated uncertainties. The calculations follow the methodology published by Mahon (1996). Typos and errors that were made in that work have been corrected. A method to allow calculating a linear regression through a fixed point, avoiding previously made errors, is also provided.

Installation

The package can be installed from pypi via:

pip install ceresfit

Usage

Below is an example on how to use the package.

```python

import numpy as np from ceresfit import LinReg

# some data xdata = np.array([1, 2, 3.1, 4.9]) ydata = np.array([1.1, 1.9, 3, 5.5])

# some uncertainty and correlation xunc = 0.05 * xdata yunc = 0.073 * ydata rho = np.zeros_like(xdata) + 0.5

# do regression my_reg = LinReg(xdata, xunc, ydata, yunc, rho)

# print out the parameters and their uncertainties myreg.slope (0.9983613298400896, 0.06844666435449052) myreg.intercept (0.05545398718611372, 0.11812746374874884) my_reg.mswd 2.5105964767071143

```

Detailed example on how to use the class for fitting and plotting the results can be found in these Jupyter notebooks.

Development & Contributing

This project is developed using Rye. After cloning, you can simply run

rye sync

in the project folder and you should be good to go.

Code auto formatting is implemented using pre-commit hooks.

For local formatting and linting, please use

rye fmt rye lint

For running tests, use:

rye test rye run test_docs

The first of these commands runs pytest, the second checks the documentation tests using xdoctest.

Please feel free to raise issues on GitHub and open pull requests if you have a feature to be added. Tests and adequate docstrings should be provided along with your new code.

Owner

  • Name: Galactic Forensics Laboratory
  • Login: galactic-forensics
  • Kind: organization

We study astrophysical processes, such as stellar nucleosynthesis and galactic chemical evolution using laboratory analyzis of stardust grains and meteorites.

Citation (CITATION.cff)

cff-version: 1.2.0
message: "If you use this software, please cite it as below."
authors:
- family-names: "Trappitsch"
  given-names: "Reto"
  orcid: "https://orcid.org/0000-0002-0924-236X"
title: "CEREsFit"
version: 0.2.1
doi: 10.5281/zenodo.7798523
date-released: 2023-04-04
url: "https://github.com/galactic-forensics/CEREsFit"

GitHub Events

Total
  • Watch event: 1
  • Delete event: 34
  • Issue comment event: 35
  • Push event: 31
  • Pull request event: 63
  • Create event: 27
Last Year
  • Watch event: 1
  • Delete event: 34
  • Issue comment event: 35
  • Push event: 31
  • Pull request event: 63
  • Create event: 27

Committers

Last synced: almost 3 years ago

All Time
  • Total Commits: 50
  • Total Committers: 2
  • Avg Commits per committer: 25.0
  • Development Distribution Score (DDS): 0.3
Top Committers
Name Email Commits
Reto Trappitsch r****o@g****e 35
pre-commit-ci[bot] 6****]@u****m 15
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 2
  • Total pull requests: 128
  • Average time to close issues: about 2 hours
  • Average time to close pull requests: about 22 hours
  • Total issue authors: 1
  • Total pull request authors: 2
  • Average comments per issue: 0.5
  • Average comments per pull request: 0.84
  • Merged pull requests: 122
  • Bot issues: 2
  • Bot pull requests: 117
Past Year
  • Issues: 2
  • Pull requests: 45
  • Average time to close issues: about 2 hours
  • Average time to close pull requests: about 8 hours
  • Issue authors: 1
  • Pull request authors: 1
  • Average comments per issue: 0.5
  • Average comments per pull request: 0.82
  • Merged pull requests: 39
  • Bot issues: 2
  • Bot pull requests: 45
Top Authors
Issue Authors
  • pre-commit-ci[bot] (1)
Pull Request Authors
  • pre-commit-ci[bot] (138)
  • trappitsch (11)
Top Labels
Issue Labels
Pull Request Labels

Dependencies

pyproject.toml pypi
  • numpy *
  • scipy *
.github/workflows/package_testing.yml actions
  • actions/checkout v2 composite
  • actions/setup-python v2 composite
  • codecov/codecov-action v3 composite
.github/workflows/python-publish.yml actions
  • actions/checkout v2 composite
  • actions/setup-python v2 composite