Skip to content

sg-s/fitModel2Data

Repository files navigation

fitModel2Data

Fits models to data. This is a wrapped for MATLAB's constrained optimization algorithms.

Usage

If your model conforms to the form [R,a,b,c...z] = function(S,p) where p is a structure array containing parameters, and R is a vector and S is a matrix, and your data contains vector fields called response and stimulus, you can fit your model to data using:

p = fitModel2Data(@model,data);

and fitModel2Data will fit your model to your data using the patternsearch algorithm.

You can also use fmincon to fit your model:

p = fitModel2Data(@model,data,'engine','fmincon');

fitModel2Data is internally cached, using cache.m so, it remembers the best solution and can automatically start from there.

Installation

fitModel2Data is written in MATLAB. It should work on any OS, but has only been tested on macOS.

The best way to install fitModel2Data is through my package manager:

urlwrite('http://srinivas.gs/install.m','install.m'); 
install sg-s/fitModel2Data
install sg-s/srinivas.gs_mtools  

License

GPL v3

About

MATLAB toolbox to fit model to data.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages