Clear Filters
Clear Filters

Why is SVD curve not matching original data?

1 view (last 30 days)
carenar
carenar on 17 Jul 2015
I am attempting to fit a curve with a sum of exponentials using SVD methods because it is more robust and utilize linear methods. My equation is y=Aexp(-bx) and so on. My coefficient matrix consists of a range of values and each column is the form exp(-f(1).\x)then using SVD to solve for A. However, when I perform the SVD curve fit the data does not match. I am wondering if my range of values are incorrect or my SVD method. I have attempted to debug the program but am having minimal luck
x=[1,2,4,6,8,10,15,20,35,50,75,100,150,200,350,500,1000,1750]' rates=(3:22.4:400); %rates 1/.002 to 1/.4
%Coefficent matix y1=exp(-rates(1).\x); y2=exp(-rates(2).\x); y3=exp(-rates(3).\x); y4=exp(-rates(4).\x); y5=exp(-rates(5).\x); y6=exp(-rates(6).\x); y7=exp(-rates(7).\x); y8=exp(-rates(8).\x); y9=exp(-rates(9).\x); y10=exp(-rates(10).\x); y11=exp(-rates(11).\x); y12=exp(-rates(12).\x); y13=exp(-rates(13).\x); y14=exp(-rates(14).\x); y15=exp(-rates(15).\x); y16=exp(-rates(16).\x); y17=exp(-rates(17).\x); y18=exp(-rates(18).\x);
R=[y1,y2,y3,y4,y5,y6,y7,y8,y9,y10,y11,y12,y13,y14,y15,y16,y17,y18];
%Known Y-Data C =-1035823.02839571 847374.054004519 3549764.66839471 6201540.15418506 9487905.85664665 11403261.1885086 14856766.4338426 17855334.2231497 21603166.0901448 23184839.8788382 23784630.1433765 23374945.0221579 21273930.1796291 19189277.0203142 13196478.7352441 9301576.70628163 3128301.20806591 1256379.88841090
[U, S, V]=svd(R); %get svd
Ut=transpose(U); %transpose U
P=V*S*U'; A=inv(P)*C;
y_SVD=R*A;
figure(1) hold on; semilogx(tmix,-y_SVD,'-r') semilogx(tmix,C,'-bl') hold off;

Answers (0)

Categories

Find more on Eigenvalues 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!