How to fit complicated function with 3 fitting parameters using Least square regression
古いコメントを表示
I want to fit below equation J(v). J and V data areavailable. 

N=10^21
q=1.6x10^-19
Epsilon=26.5 x 10^-14
d=3x10^- 6
Initial values may be x0=[µ l H]=[10^-5 5 10^18]
3 fitting parameters are: µ, l and H. other parameters are known.
can some one help me to solve this?
I am not expert in Matlab
V is xdata:
0
0.5
1
1.5
2
2.5
3
3.5
4
4.5
5
5.5
6
6.5
7
7.5
8
J is ydata:
1.64544E-05
1.99822E-05
0.000032253
4.2623E-05
7.40498E-05
0.000660899
0.007578998
0.027109725
0.106353025
0.30299725
0.7332185
1.550115
2.98009
5.3102775
8.88175
14.0394325
21.163215
9 件のコメント
Alex Sha
2020 年 3 月 26 日
Hi, Le, I think your function is overdeterminted, there is unique vaule for parameter l, but infinite combination for parameters of u and h, for examples:
1:
Root of Mean Square Error (RMSE): 0.111273524152212
Sum of Squared Residual: 0.2104905520133
Correlation Coef. (R): 0.999845673432621
R-Square: 0.999691370681932
Parameter Best Estimate
---------- -------------
u 2.32291533744055E-11
l 5.69421576733531
H 6.70987929031922E17
2:
Root of Mean Square Error (RMSE): 0.111273524152212
Sum of Squared Residual: 0.2104905520133
Correlation Coef. (R): 0.999845673433156
Parameter Best Estimate
---------- -------------
u 8.96577966791522E-57
l 5.69421576534176
H 7101504622.69801
3:
Root of Mean Square Error (RMSE): 0.111273524152212
Sum of Squared Residual: 0.2104905520133
Correlation Coef. (R): 0.999845673428399
R-Square: 0.999691370673488
Parameter Best Estimate
---------- -------------
u 9.04488585246612E-43
l 5.69421578308753
H 2044822881092.28
So, if you take out parameter H from your function, it is only parameter u and l left:
J=q*u*N*((2*L+1)*V/L)^(L+1)*(L/(d*(L+1)))^(2*L+1)*(Eps/(q))^L;
then the result will be stable and unique, like below:
Root of Mean Square Error (RMSE): 0.111273524152213
Sum of Squared Residual: 0.210490552013303
Correlation Coef. (R): 0.999845673430017
Parameter Best Estimate
---------- -------------
u 7.19061667016099E-113
l 5.69422156938396

Thi Na Le
2020 年 3 月 26 日
Of course, you can set L=5.69, and keep parameters u and H, unfortunately, still multi-solutions:
1:
Root of Mean Square Error (RMSE): 0.111290321914178
Sum of Squared Residual: 0.210554107779945
Correlation Coef. (R): 0.999846762154431
R-Square: 0.9996935477907
Parameter Best Estimate
---------- -------------
u 2.76396226230446E-5
H 7.83440251335193E18
2:
Root of Mean Square Error (RMSE): 0.111290321914178
Sum of Squared Residual: 0.210554107779945
Correlation Coef. (R): 0.999846762154431
R-Square: 0.9996935477907
Parameter Best Estimate
---------- -------------
u 0.000146773320341069
H 1.05061262094087E19
3:
Root of Mean Square Error (RMSE): 0.111290321914178
Sum of Squared Residual: 0.210554107779945
Correlation Coef. (R): 0.999846762154431
R-Square: 0.9996935477907
Parameter Best Estimate
---------- -------------
u 0.000537244665843506
H 1.31971574477562E19
Since if L become constnat, the formation of your function looks like: J=u/H*f(V),obviously,“u/H” have infinite combinations.
Alex Sha
2020 年 3 月 27 日
if keep u=5*10^-5, the result should be stable and unique:
Root of Mean Square Error (RMSE): 0.111273524152212
Sum of Squared Residual: 0.210490552013299
Correlation Coef. (R): 0.999845673432512
R-Square: 0.999691370681713
Parameter Best Estimate
---------- -------------
l 5.69421576774324
h 8.68730012231788E18
Alex Sha
2020 年 3 月 27 日
Pleasure, congratulation!
Thi Na Le
2020 年 3 月 27 日
Alex Sha
2020 年 3 月 27 日
You may try to provide a little different start-value for H, and see the final result, if final H is still alway equaling to start-value of H, your fitting seems to have problem.
採用された回答
その他の回答 (1 件)
Jeff Miller
2020 年 3 月 25 日
0 投票
I assume you have vectors of values for V and J, in which case fminsearch might be a good choice. The basic steps are:
- Write a function "predicted" to compute a predicted value of J for any given V, µ, l and H.
- Write a function "error" that computes the sum of (predictedJ - actualJ)^2, summing across the J vector.
- call fminsearch and pass it this error function as the function to be minimized. You will have to give it reasonable guesses for µ, l and H.
カテゴリ
ヘルプ センター および 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!
