Skip to content

About

Easy interface for obtaining fits for 2D data

Resources

Stars

46 stars

Watchers

1 watching

Forks

Latest commit

 

History

277 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tests codecov Aqua QA Docs stable Docs dev

EasyFit

Easy interface for obtaining fits of 2D data.

The purpose of this package is to provide a very simple interface to obtain some of the most common fits of 2D data: linear, quadratic, cubic, n-th degree polynomial, exponential, normalized exponential-decay, and spline fits, plus moving averages and density (continuous histogram) estimation.

On the background this interface uses the LsqFit and Interpolations packages, which are already quite easy to use. Additionally, EasyFit contains a simple globalization heuristic, such that good non-linear fits are obtained often.

Our aim is to provide a package for quick fits without having to think about the code.

Installation

julia> ] add EasyFit

julia> using EasyFit

Quick example

julia> x = sort(rand(10)); y = sort(rand(10));

julia> fit = fitlinear(x, y)
------------------- Linear Fit -------------

Equation: y = ax + b

With: a = 1.158930569179642 ± 0.6538824813074927
      b = -0.1251714526967127 ± 0.3588742142656203

Correlation coefficient, R² = 0.9696101474036224
Average square residue = 0.004113279571449428

Predicted Y: ypred = [0.1044876257374221, 0.2072397615587609, ...]
residues = [0.08428396483020295, 0.05555828441380739, ...]

--------------------------------------------

julia> using Plots

julia> scatter(x, y)   # the original data

julia> plot!(fit.x, fit.y)   # the fit

Documentation

The full documentation, with runnable examples and plots for every fit (linear, quadratic, cubic, n-th degree polynomial, exponential, normalized exponential-decay, splines, moving averages, density, bounds/fixed parameters, and options) is available at:

https://m3g.github.io/EasyFit.jl/stable

About

Easy interface for obtaining fits for 2D data

Resources

Stars

46 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages