- do a full fit for one dataset, record the C, D, E; for the rest of the datasets, provide a function which treats C D E as constants (for example fmincon and set UB same as LB for those variables). This approach will only work if the C, D, E obtained by fitting one dataset is certain to be the "best" C D E for all of the datasets.
- Or... fit everything at one time, supplying a fitness function that uses a global C D E but uses different A and B for different sections of the signal.
Need help for global fit
3 ビュー (過去 30 日間)
古いコメントを表示
The variables I have: A, B, C, D, E.
The error calculating function is error=@(A, B, C, D, E) error_func
If I give input as error(A, B, C, D, E) it can return me the errros associated with the function.
For a single data set I can get the solution for A, B, C, D, E by using
solution = [A_initial_guess B_initial_guess C_initial_guess D_initial_guess E_initial_guess];
fit_func=@(x) error(x(1),x(2),x(3),x(4),x(5))
solution = fminsearch(@(x) fit_func(x), solution)
But I have 3 more data set, which follow the same equation. Among them variable C, D, and E are shared between the data set, where A, and B are different for each data set.
Meaning C, D, and E are shared variable. And A, and B are non-shared variables.
How should I design the script for global fit so that I can have the same fitting values for C, D, and E for all data set, but differnt A, and B for each of the data set?
0 件のコメント
回答 (1 件)
Walter Roberson
2024 年 2 月 13 日
To confirm: you want to optimize so that C, D, E are the same for all datasets, but A and B vary according to the datasets?
There are two possibilities for this:
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Get Started with Curve Fitting Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!