Azzera filtri
Azzera filtri

Need help for global fit

3 visualizzazioni (ultimi 30 giorni)
MD MOINUL ISLAM
MD MOINUL ISLAM il 12 Feb 2024
Risposto: Walter Roberson il 13 Feb 2024
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?

Risposte (1)

Walter Roberson
Walter Roberson il 13 Feb 2024
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:
  1. 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.
  2. 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.

Categorie

Scopri di più su Get Started with Curve Fitting Toolbox in Help Center e File Exchange

Prodotti


Release

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by