Coder Social home page Coder Social logo

cassianokc / fit Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 11 KB

A tool for fitting functions, it uses Diferential Evolution to select parameters of a predefined function F that minimize the MSE(Mean Square Error) between the F and experimental/known/given points.

License: GNU General Public License v2.0

M 18.94% MATLAB 81.06%

fit's Introduction

	This repo contains a tool for fitting functions by using Diferential
Evolution(DE) to select parameters of a predefined function F that
minimize the MSE(Mean Square Error) between the F and
experimental/known/given points.
	The tool was tested on GNU Octave, but it should work fine on MATLAB.
	Keep in mind that the algorithm is randomic and don't always converge
to the global minimum, run it as much times as possible/viable/ before
using the choosen parameters.

==========================================================================

	Example: First you need to define the function to be fitted, here is an
simple example(concentration of a reagent in a reactor over time):

		function c = concentration(t, fixedParams, params) c0 = fixedParams(1);
		res = params(1); k = params(2); c = res+(c0-res).*exp(-k.*t); end

	This function receives a column vector t and returns a c row vector.  The
params input is 'parsed' and its values are used to compute c.  The
fixedParams input is also 'parsed', but the DE is not going to change them
in order to get better MSE results.
	Now we call the fit function:
		[params, err] = fit(t, measuredC, [0 0], [500, 1], [measuredC(1)] ...
				@concentration);
	The inputs [0 0] and [500 1] are the lowest and highest acceptable values
for the fitted/tunned parameters, respectivelly.

fit's People

Contributors

cassianokc avatar

Stargazers

 avatar

Watchers

 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.