Giter Club home page Giter Club logo

curvefitter's Introduction

Curve Fitter

A fork of ImageJ CurveFitter without any java.awt or GUI dependencies.

Import this library into an Android (i.e. Java) project to use various regression algorithms, such as:

  • Straight Line: y = a + bx
  • 2nd Degree Polynomial: y = a + bx + cx^2
  • 3rd Degree Polynomial: y = a + bx + cx^2 + dx^3
  • 4th Degree Polynomial: y = a + bx + cx^2 + dx^3 + ex^4
  • Exponential: y = a * exp(bx)
  • Power: y = a * x^b
  • Log: y = a * ln(bx)
  • Rodbard: y = d + (a - d)/(1 + (x/c)^b)
  • Gamma Variate: y = b * (x - a)^c * exp(-(x - a)/d)
  • Log with offset: y = a + b * ln(x - c)
  • Rodbard (NIH Image): x = d + (a - d)/(1 + (y/c)^b), or y = c * ((x - a)/(d - x))^(1/b)]
  • Exponential with Offset: y = a * exp(-bx) + c
  • Gaussian: y = a + (b - a) * exp(-(x - c)*(x - c)/(2 * d * d))
  • Exponential Recovery: y = a * (1 - exp(-b * x)) + c
  • Inverse Rodbard: y = c * ((x - a)/(d - x))^(1/b)
  • Exponential (linear regression): y = a * exp(bx)
  • Power (linear regression): y = a * x^b
  • 5th Degree Polynomial: y = a + bx + cx^2 + dx^3 + ex^4 + fx^5
  • 6th Degree Polynomial: y = a + bx + cx^2 + dx^3 + ex^4 + fx^5 + gx^6
  • 7th Degree Polynomial: y = a + bx + cx^2 + dx^3 + ex^4 + fx^5 + gx^6 + hx^7
  • 8th Degree Polynomial: y = a + bx + cx^2 + dx^3 + ex^4 + fx^5 + gx^6 + hx^7 + ix^8
  • Gaussian (no offset): y = a * exp(-(x - b)*(x - b)/(2 * c * c)))
  • Exponential Recovery (no offset): y = a * (1 - exp(-b * x))
  • Chapman-Richards: y = a * (1 - exp(-b * x))^c

Usage

double[] xs = {1, 2, 3, 4, 5, 6};
double[] ys = {-2, 0, 6, 16, 30, 48};
CurveFitter curveFitter = new CurveFitter(xs, ys);
curveFitter.doFit(CurveFitter.POLY2);
double[] params = curveFitter.getParams();

double a = params[0];
double b = params[1];
double c = params[2];
// y = a + bx + cx^2

curvefitter's People

Contributors

binroot avatar

Watchers

James Cloos avatar cz avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.