I want to perform quartic regression on following data:
x =
375
1029
2187
3993
6591
10125
14739
y=
0.5608
0.8522
0.9075
0.9994
0.8668
0.7162
0.9143
To do that I've implemented following function:
function[str] = quarticRegression(x, y)
A = [x.^4 x.^3 x.^2 x ones(length(x), 1)];
res = A\y;
str = sprintf('%fx^4 + (%f)x^3 + (%f)x^2 + (%f)x + %f',...
res(1), res(2), res(3), res(4), res(5));
end
Unfortunately, I'm getting following error:
Warning: Rank deficient, rank = 4, tol = 7.520684e+01.
When I try to change x vector for smaller numbers, error disappears.
What is the correct way to get the result?
I guess I should somehow normalize the x vector, but I don't know how to do that and not change the system solution.

