Fit of multiple data sets

14 ビュー (過去 30 日間)
Daniele Sonaglioni
Daniele Sonaglioni 2021 年 3 月 30 日
コメント済み: Star Strider 2021 年 3 月 31 日
Hello everyone,
I have a problem in making a fit of some set of data. I have 4 arrays of data: the first is my x-axis while the other three are my y-axes. I want to fit the y-arrays with the same function but i want only one set of parameters to fit the three arrays.
My fitting function is the subsequent:
where . My fitting parameters are and each y-array is referred to a different value of T.
How can i write the code for this kind of fit?

採用された回答

Star Strider
Star Strider 2021 年 3 月 30 日
That is relatively straightforward. If your objective function outputs only one vector (as opposed to three), concatenate the dependent variables in one vector, create a matching independent variable vector, then use whatever nonlinear paramerer estimation routine you want to estimate the parameters.
It would help to have your data and the and m values.
  15 件のコメント
Daniele Sonaglioni
Daniele Sonaglioni 2021 年 3 月 31 日
I think that the two methods (mine and your) are equivalent.
Star Strider
Star Strider 2021 年 3 月 31 日
With nlinfit, use nlparci to get the confidence intervals on the parameters and nlpredci to get the confidence intervals on the fit. The fitnlm function calculates the parameter confidence intervals automatically, and the predict function calculates the confidence intervals on the fit.

サインインしてコメントする。

その他の回答 (1 件)

William Rose
William Rose 2021 年 3 月 30 日
@Star Strider is right. Specifically, if your data is in array A, and if A has N rows x 4 columns, and the columns are x, y1, y2, y3, and the 3 temps are T1, T2, T3, then do
B=[A(:,1),ones(N,1)*T1,A(:,2); A(:,1),ones(N,1)*T2,A(:,3); A(:,1),ones(N,1)*T3,A(:,4)];
The above command turns your Nx4 array into 3*N by 3 array. Note the use of commas and semicolons in the line above. I inserted a column for temperature. The first N rows have temp T1, the next N rows have temp T2, etc. Then you fit it all at once as @Star Strider said.

カテゴリ

Help Center および File ExchangeInterpolation についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by