필터 지우기
필터 지우기

(somewhat) specifying coefficients for curve fitting

조회 수: 1 (최근 30일)
J.S.
J.S. 2018년 6월 28일
답변: Walter Roberson 2018년 6월 28일
I have a set of data that I am fitting with the modified ("custom", because it has offsets) two-exponential fit a*exp(b*(x-x0))+c*exp(d*(x-x0))+y0. Offsets x0 and y0 are known. From my data, I know what the upper and lower bounds for a-d should be, and I have imposed these constraints in my code. Since I do not precisely know what starting values for a-d I should set, I am leaving that to MATLAB's random start point selection. However, one disadvantage is that, between any two fit attempts, not only will the values for a-d be different, but also a might be bigger than c in one fit, and then at the next attempt, a is smaller than c. This result then influences whether b is bigger than d or b is smaller than d. Since I need to perform fitting multiple times to find distributions (via histograms) of b and d, this could be a problem. Is there some way I can tell MATLAB that a should be bigger than c, regardless of MATLAB's chosen start points?
Thanks very much in advance!

채택된 답변

Walter Roberson
Walter Roberson 2018년 6월 28일
No, there is not. However, you can use
FitFcn = @(a,b,c,d,x) RealFitFcn(max(a,c), b, min(a,c), d, x)

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Least Squares에 대해 자세히 알아보기

제품


릴리스

R2015b

Community Treasure Hunt

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

Start Hunting!

Translated by