Weighted regression without priority zone, but with finding the minimum possible value for all the differences
    조회 수: 2 (최근 30일)
  
       이전 댓글 표시
    
Dear colleagues,
I need to perform a regression. The input data is shown in Figure 1 and is also attached as an MS Excel file.
Figure 1 (Figures are shown in the end of the letter.
The equation is z = a*x^m/(y+c)^n.
The parameters of the fit are shown in Figure 2 and are also attached.
Figure 2
The output data is shown in Figure 3.
Figure 3
The individual differences in percentage are shown in Figure 4.
Figure 4
I know that by using a weighted matrix, it is possible to decrease some differences (priority zones) at the expense of increasing others. However, in this case, my goal is to estimate the minimal possible error (one border value) for all of the values. For example, in the first fit, the maximum difference is 93%. It is easy to decrease it by applying individual weight coefficients, but of course, somewhere, the difference will increase. Therefore, the question is: what method can be used to find the minimal possible difference? If this for example is 18%, it means that everywhere the difference will be smaller, and it is likely that there is no 0 % anymore. Example by hand (not real) is given in Figure 5.
Figure 5
And if we try to decrease the difference at the point with an 18% difference, this will lead to an increase in the difference somewhere above 18%. Also, if in the first fit I have a 0% or 1% difference at a given point, in the second fit, the difference at this point is likely to be close (but smaller) to 18%. And one more thing – if there is a way for doing the whole procedure, is it possible to use curve fitter app or need to use a code?

댓글 수: 0
채택된 답변
  Torsten
      
      
 2024년 12월 17일
        
      편집: Torsten
      
      
 2024년 12월 17일
  
      x = [1 2 3 4 5 10 20 50].';
y = [5 10 15 20 25 30 40 50 60 90];
z = [265.110074796797	195.008035083193	156.258229529605	129.742584500194	107.062285017337	91.0540850617739	68.5080545479447	50.5038878827341	35.8057303140135	23.9109370743307	
    321.446939682946	249.023136173216	204.538587797874	172.392832029864	146.102087493907	125.302681110766	98.3496300763363	79.6443293949692	60.4259292015808	28.967085981117	
    358.948929784307	282.185871826562	232.988776882345	197.578293515688	169.230643083598	145.977264293244	115.850743148756	96.2843426347109	74.9936831153838	40.5561051536658	
    387.580526618466	306.229191510467	253.083199667196	215.390669679886	185.62217968629	160.805889976744	128.174360996678	107.804496871799	85.3098905504615	48.5261569465696	
    411.022720927616	325.178097515035	268.617658401558	229.174534346536	198.325915732664	172.4000748844	137.680141245939	116.580164412001	93.3004757115783	54.5677932289588	
    491.330306710826	385.749717456981	316.583948069254	271.810779459274	237.728742469111	208.93517622606	166.914170433146	142.97295566989	118.058749869664	72.5800929043424	
    584.345341008974	448.998217493589	364.117335543095	314.175511964579	277.043092535072	246.270752777746	195.70913612502	168.102854357484	142.722367271741	89.5041059266947	
    730.266495461484	536.918175592217	426.295310861942	369.764885508864	328.878387857907	296.884055308305	233.111367401215	199.486893792689	175.18124008861	110.317421963392];
f = @(p) abs(p(1)*x.^p(2)./(y+p(3)).^p(4) - z);
F = @(p) reshape(f(p),[],1);
p0 = [1 1 1 1];
F(p0)
max(F(p0))
format long
[p,fval] = fminimax(F,p0)
max(fval)
댓글 수: 12
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


