https://github.com/jborrow/sidefit
A package that fits radial distance to a line rather than only vertical using a nearest-neighbor search.
https://github.com/jborrow/sidefit
Last synced: 3 months ago
JSON representation
A package that fits radial distance to a line rather than only vertical using a nearest-neighbor search.
- Host: GitHub
- URL: https://github.com/jborrow/sidefit
- Owner: JBorrow
- Created: 2018-03-13T08:05:45.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2018-03-13T08:21:53.000Z (about 7 years ago)
- Last Synced: 2024-12-27T06:41:29.873Z (5 months ago)
- Language: Python
- Size: 5.86 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
sidefit
=======This is a fitting package that (currently) only supports a brute-force
calculation. It is designed to provide an alternative chi-squared; this
package fits the 'radial' distance to the line rather than just the
vertical distance. This is particularly tricky, as often the parameterspace
is very noisy meaning most fitting packages do not converge well (hence
the brute-force nature).In the future, we hope to use a tree structure to significantly reduce the
computational impact of fitting in this way.Requirements
------------+ `python3.5` or above
+ `scipy`
+ `numpy`For tests:
+ `matplotlib`
+ `pytest`Usage
-----The frontend is available through the `Fitter` class. See below.
```
from sidefit import Fitterfit = Fitter(linex, liney, pointsx, pointsy)
interp = fit.interpolate_function(kind="linear")
dr = fit.brute_force(N_lr=100, N=10000)
```Test plots
----------The package produces a number of test plots. Find a description of them below.
+ `test_plot_heaviside.png`: this shows two panels. On the top panel, the
distance between the point and the line at a value of dx. This is essentially
a plot of the cost function. On the bottom, we show the point (dot) and the
line it is being fit to.
+ `test_integration_heaviside.png`: this shows two panels. On the bottom panel
we show dr, the minimal distance between the point at x-value x and the line.
The top panel shows the points in thick blue (these are stacked points) and
the line in blue.