[curve fitting] dependence between coefficients

Dear all -
I need to fit my experimental data (x_data, y_data) with a biexponential decay model:
% define fit options
fo_ = fitoptions('method','NonlinearLeastSquares','Lower',lower,'Upper',upper);
% define fittype
ft_ = fittype('offset+a*exp(-(x-x0)/b)+c*exp(-(x-x0)/d)',...
'dependent',{'y'},'independent',{'x'},...
'coefficients',{ 'offset', 'x0', 'a', 'b', 'c', 'd'});
% perform fit
[cf_, gof, output] = fit(x_data,y_data,ft_,fo_);
offset = y-offset
x0 = x-offset
a and c = amplitudes (weighing factors)
b and d = decay constants
As my experimental data are normalised, i.e. the decay occurs from 1 to 0, I would like to implement the following condition in my fitting routine: a + c = 1
How can I do this?
I appreciate your help!
Sebastian

 채택된 답변

Matt J
Matt J 2013년 5월 31일

0 개 추천

Replace occurrences of c in your model with 1-a. Then fit the remaining parameters.
ft_ = fittype('offset+a*exp(-(x-x0)/b)+(1-a)*exp(-(x-x0)/d)',...
'dependent',{'y'},'independent',{'x'},...
'coefficients',{ 'offset', 'x0', 'a', 'b', 'd'});

댓글 수: 3

Dear Matt,
thank you for your reply! This would be an elegant solution to this particular problem.
However, how should I proceed if I was to perform a triexponential fit and the same condition should apply (amp1 + amp2 + amp3 = 1)?
Cheers, Sebastian
Matt J
Matt J 2013년 5월 31일
편집: Matt J 2013년 5월 31일
You could do the same thing.
amp1 = 1 - amp2 - amp3
The equation always allows one variable to be eliminated, no matter how many terms you have.
That is in fact true. :-)
Thanks for your help!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Linear and Nonlinear Regression에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by