Derive equation from dataset
조회 수: 2 (최근 30일)
이전 댓글 표시
Hello!
I have the following four sets of data:
x11=[0 8 32 35 38 46 50 62];
y11=[288 288 224 183 155 29 23 0];
x12=[0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 26 35 36 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 71];
y12=[1830 1830 1830 1779 1779 1779 1779 1481 1481 1225 1225 1128 1128 995 995 707 707 682 682 661 661 607 515 511 344 344 344 339 339 339 332 332 332 319 319 319 305 305 305 261 261 261 249];
x21=[0 12 18 20 22 23 24 26 31 32 35 37 38 39 48 50 54 57];
y21=[715 715 670 643 639 616 612 581 521 466 421 369 318 326 109 55 7 0];
x22=[0 5 6 9 16 21 22 23 24 35 37 38 40 44 48 58 72 73 77];
y22=[6833 6833 6776 5704 2497 1893 1779 1706 1741 1444 1335 1256 1217 967 947 812 649 593 551];
All x-y pairs have quite the similar shape, with the curve decaying rapidly in the first half and then slowly in the second one.
The goal is to interpolate each x-y pair to derive an equation that will represent the phenomenon.
I tried interp1 and lsqcurvefit but they don't give good enough results. Could someone suggest an alternative way to interpolate these data?
Thank you!
댓글 수: 3
채택된 답변
Asad Mirza
2019년 2월 26일
Since you do not know what could be the best function to fit your data with try out the Curve Fitting App with cftool. It lets you fit data using a wide range of functions, apply bounds, weights, etc. You even have the option of making your own equation to fit it with.
댓글 수: 2
Walter Roberson
2019년 2월 27일
Are you looking to set maximum and minimum values of a parameter to be fitted?
If so then click on Fit Options... which will bring up a window listing coefficient names with a column named Lower and another column named Upper. It turns out that the entries in those two columns are clickable, and you can edit the upper and lower bounds there.
추가 답변 (1개)
Walter Roberson
2019년 2월 26일
There are an infinite number of equation that fit your data perfectly in theory , even without allowing for the possibility of noise or of imperfect recording of coefficients .
The number of equation you can derive from the data using no more than 2^48 bytes of memory (limit of x64 architecture in all known implementation ) representing your coefficients as IEEE double precision (64 bits) is a bit more limited but probably still over 2^40
With an infinite number of derived equations, the probability that any one of them is the "correct" equation is 1/infinity which is defined as 0.
Therefore you cannot do anything useful in fitting your data unless you can restrict your equation to being one of a finite number of forms, after which you can do parameter fitting for each of the possible forms and make a decision as to which fits best.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Interpolation에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!