How to find the vector b if we know the RMSE?
2 views (last 30 days)
Show older comments
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?
0 Comments
Answers (2)
John D'Errico
on 12 Jan 2023
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)
b1 = double(subs(b1,x,x1))
RMSEfun(b1)
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)
b2 = double(subs(b2,x,x2))
RMSEfun(b2)
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)
b3 = double(subs(b3,x,x3))
RMSEfun(b3)
Again, there are infinitely many solutions. I chose only 3 trivial examples.
10 Comments
See Also
Categories
Find more on Creating and Concatenating Matrices in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!