How to find the vector b if we know the RMSE?

2 次查看(过去 30 天)
If we have two vectors given by:
a=[3,6,8,20,35,45];
b=[3.0343, 6.2725, 8.5846, 18.3781, 34.2025, 44.9699];
Then its Mean Square Error MSE and Root Mean Sqaure Error RMSE are given by:
MSE = mean((a-b).^2,2);
RMSE = sqrt(MSE);
But if we know MSE and RMSE and one of the vector namely 'a', then how to find the 2nd vector b?

回答(2 个)

Matt J
Matt J 2023-1-12
编辑:Matt J 2023-1-12
That's not possible. You have, in this case, 6 unknowns but only 1 equation.
  1 个评论
Matt J
Matt J 2023-1-14
编辑:Matt J 2023-1-14
Here's one simple solution for b:
a=[3,6,8,20,35,45];
RMSE=3.7;
b=a+RMSE;
rootMeanSquaredError = sqrt( mean((a-b).^2) ) %verify
rootMeanSquaredError = 3.7000

请先登录,再进行评论。


John D'Errico
John D'Errico 2023-1-12
There are infinitely many possible vectors b, for any given RMSE. And worse, they can have infinitely many possible shapes. This means it is flatly not possible to find a unique vector b that yields a given RMSE. Sorry.
Do you want proof?
a=[3,6,8,20,35,45];
b=[3.0343, 6.2725, 8.5846, 18.3781, 34.2025, 44.9699];
For example consider this simple vector b1:
n = length(a);
RMSEfun = @(b) sqrt(sum((a - b).^2/n));
syms x
rmsetarget = 1;
b1 = sym(a); b1(1) = x; % I will change only the first elememt of b
x1 = vpasolve(RMSEfun(b1) == rmsetarget,x)
x1 = 
0.55051025721682190180271592529411
b1 = double(subs(b1,x,x1))
b1 = 1×6
0.5505 6.0000 8.0000 20.0000 35.0000 45.0000
RMSEfun(b1)
ans = 1.0000
So by trivially changing one arbitrary element of a, I found a new vector b that yields exactly the desired RMSE. I could have perturbed ANY element and gotten the same result.
b2 = sym(a); b2(4) = x; % I will change only the first elememt of b
x2 = vpasolve(RMSEfun(b2) == rmsetarget,x)
x2 = 
17.550510257216821901802715925294
b2 = double(subs(b2,x,x2))
b2 = 1×6
3.0000 6.0000 8.0000 17.5505 35.0000 45.0000
RMSEfun(b2)
ans = 1.0000
Or, I might have chosen b in a different way.
b3 = sym(a); b3 = b3*x; % I will change EVERY element of b, proportionally
x3 = vpasolve(RMSEfun(b3) == rmsetarget,x)
x3 = 
0.96004791377243790210022857429935
b3 = double(subs(b3,x,x3))
b3 = 1×6
2.8801 5.7603 7.6804 19.2010 33.6017 43.2022
RMSEfun(b3)
ans = 1.0000
Again, there are infinitely many solutions. I chose only 3 trivial examples.
  10 个评论
John D'Errico
John D'Errico 2023-1-13
编辑:John D'Errico 2023-1-13
I will keep on saying it. You do not have sufficient information to solve for the unknowns. It is one equation only. And you have multiple unknowns. In your last example, we have:
a = [3,6,8,20];
With N and RMSE given, we have
N = 4;
RMSE = 1; % I'll just pick a number for RMSE
syms y [1,4]
ans = 
N * RMSE^2 == sum((a - y).^2)
Do you recognize this as the equation of a sphere in 4 dimensions? If not, you should. The center of the sphere is the point a=[3 6 8 20], and the square of the radius is given here as 4=2^2.
But ANY point on the surface of that sphere is a solution to your problem. ANY point. Need I repeat that? ANY POINT. How many points lie on the surface of a sphere? (Infinitely many.)
There is NO solution to your question. You cannot solve for the unknown vector (here y or b as you prefer.) You can keep on insisting there is a solution, but the mathematics says you are completely wrong. There are infinitely many solutions and there is no way to choose any specific solution, beyond saying the solution lies SOMEWHERE on the surface of that sphere.
Sadiq Akbar
Sadiq Akbar 2023-1-14
Thanks a lot for your kind response. Amazing explanation. Yes, I am convinced with your explanation. But is there any trick that we can use because most of the time tricks also work though trick may be against mathematics rules? Isn't that?

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Particle & Nuclear Physics 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by