https://github.com/mgjho/xrfit
Model Based Fitting on Xarray
https://github.com/mgjho/xrfit
fitting regression regression-analysis
Last synced: 2 months ago
JSON representation
Model Based Fitting on Xarray
- Host: GitHub
- URL: https://github.com/mgjho/xrfit
- Owner: mgjho
- License: gpl-3.0
- Created: 2025-01-29T18:19:10.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2026-04-06T19:32:24.000Z (2 months ago)
- Last Synced: 2026-04-06T21:23:03.987Z (2 months ago)
- Topics: fitting, regression, regression-analysis
- Language: Python
- Homepage:
- Size: 283 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# xrfit
[](https://pypi.org/project/xrfit/)
[](https://pypi.org/project/xrfit/)
[](https://results.pre-commit.ci/latest/github/mgjho/xrfit/main)
[](https://codecov.io/gh/mgjho/xrfit)
[](https://github.com/astral-sh/ruff)
## Overview 🎯
[*xrfit*](https://github.com/mgjho/xrfit) provides Model-based, Multidimensional regression/analysis methods. By Integrating,
1. [*xarray*](https://xarray.pydata.org/) to handle multivariate data by utilizing coordinate-aware structure of DataArray.
2. [*lmfit*](https://lmfit.github.io/lmfit-py/) to deal complex regression problems using the composite-model based approach.
## Features ✨
1. __Model based regression__
```python
model = Model_1() + Model_2()
guess = data.fit.guess(model=model)
result = data.fit(model=model, params=guess)
```
2. __Parameter handling__ (e.g. Sorting and Smoothing parameters)
```python
sorted_result = result.params.sort("params_name")
smoothened_result = sorted_result.params.smoothen("params_name")
new_result = data.fit(model=model, params=smoothened_result.parmams)
```
3. __Interactive visualization__
```python
result.display()
```