Finding the optimal solution for a data with two variables

조회 수: 4 (최근 30일)
AAAAAA
AAAAAA 2023년 6월 11일
댓글: Alan Stevens 2023년 6월 12일
I have a data set for two variables (two columns) in which each variable has thousands of solutions (rows). I also have the actual solution.
I want to find the best solution (row) with the lowest error considering both variables (not only one variable).
As a simple example containing only 10 solutions (rows), I have the following:
% actual solution:
X1_actual = 0.4722;
X2_actual = 4.4;
% predicted data:[X1_predicted X2_predicted]
Predicted_data = [0.4742 4.4557
0.4739 4.4553
0.4732 4.4549
0.4730 4.4545
0.4725 4.4540
0.4723 4.4536
0.4715 4.4532
0.4714 4.4528
0.4713 4.4505
0.4701 4.4501]
Where the first and second columns represent the predicted values of X1 and X2, respectively.
The problem is that the minimum errors for both variables are not at the same row. As can be seen in this example, the minimum error for X1 is in the 6th row while for X2 it is in the last row.
Is there a scientific method to find the optimal row that considers the minimum errors of both variables?
  댓글 수: 3
AAAAAA
AAAAAA 2023년 6월 11일
OK. Thanks What are the other methods so that I search for these methods and compare the results with this method?
Torsten
Torsten 2023년 6월 11일
편집: Torsten 2023년 6월 11일
As I wrote: all norms on IR^2 can be used:

댓글을 달려면 로그인하십시오.

채택된 답변

Alan Stevens
Alan Stevens 2023년 6월 11일
Here's a possible approach (I've used relative errors as the values of the two columns are an order of magnitude different):
% actual solution:
X1_actual = 0.4722;
X2_actual = 4.4;
% predicted data:[X1_predicted X2_predicted]
Predicted_data = [0.4742 4.4557
0.4739 4.4553
0.4732 4.4549
0.4730 4.4545
0.4725 4.4540
0.4723 4.4536
0.4715 4.4532
0.4714 4.4528
0.4713 4.4505
0.4701 4.4501];
Relative_error = [Predicted_data(:,1)/X1_actual, ...
Predicted_data(:,2)/X2_actual] ...
- ones(10,2);
combined_error = sqrt(Relative_error(:,1).^2 + Relative_error(:,2).^2);
minerror = min(combined_error)
minerror = 0.0116
minerror_row = find(combined_error == minerror)
minerror_row = 9
  댓글 수: 2
AAAAAA
AAAAAA 2023년 6월 12일
Great This worked very well. But is the scaling you did very compulsory? How if we use the data as it is without doing any scaling? Will this affect the results?
Alan Stevens
Alan Stevens 2023년 6월 12일
If the errors of X2 are much larger than those of X1 they will dominate the combined contribution and you might find that the result is the same as if you only used X2!
However, you could try it and see!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Nonlinear Optimization에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by