How do I perform non-linear curve fitting with restraints?
Show older comments
I want to fit data to a biexponential model, where all the parameters need to be positive. I've been using lsqcurvefit but I can't work out how to prevent it returning negative parameters.
start_point = rand(1, 4);
fun = @(params,time) params(1) .* (1-exp(-params(2) * time)) + params(3) .* (1-exp(-params(4) * time));
[Est,Error] = lsqcurvefit(fun,start_point,time,ydata)
Accepted Answer
More Answers (0)
Categories
Find more on Linear and Nonlinear Regression in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!