I would really appreciate your help with curve fitting. Thank you in advance.
I am trying Fourier Series to following data:
t=[30,60,90,120,150,180,210,240,270,300,330,360,390,420,450,480,510,540,570,600]x=[1.462,0.017,0.132,0.257,0.253,0.472,0.698,0.889,0.809,0.59,0.517,0.503,0.451,0.371,0.198,0.17,0.2781.18,1.364,1.59]
Matlab gives a really nice fit, the result is below. However when I use this equation along with its coefficients and plot them in Excel its a different plot. Is there something I am missing here ? It is no where even close to actual data. But it overlays very well when seen in Matlab. How ?
General model Fourier:
f(x) = a0 + a1*cos(x*w) + b1*sin(x*w) + a2*cos(2*x*w) + b2*sin(2*x*w) + a3*cos(3*x*w) + b3*sin(3*x*w) + a4*cos(4*x*w) + b4*sin(4*x*w) + a5*cos(5*x*w) + b5*sin(5*x*w) + a6*cos(6*x*w) + b6*sin(6*x*w) where x is normalized by mean 315 and std 177.5Coefficients (with 95% confidence bounds):
a0 = 1.886e+08 (-5.755e+10, 5.793e+10) a1 = -3.245e+08 (-9.96e+10, 9.895e+10) b1 = 9.628e+06 (-2.828e+09, 2.848e+09) a2 = 2.05e+08 (-6.239e+10, 6.28e+10) b2 = -1.229e+07 (-3.623e+09, 3.598e+09) a3 = -9.278e+07 (-2.832e+10, 2.813e+10) b3 = 8.495e+06 (-2.47e+09, 2.487e+09) a4 = 2.853e+07 (-8.611e+09, 8.669e+09) b4 = -3.573e+06 (-1.036e+09, 1.029e+09) a5 = -5.352e+06 (-1.617e+09, 1.606e+09) b5 = 8.662e+05 (-2.466e+08, 2.483e+08) a6 = 4.629e+05 (-1.379e+08, 1.388e+08) b6 = -9.378e+04 (-2.648e+07, 2.629e+07) w = 0.3203 (-7.985, 8.626)
Goodness of fit: SSE: 0.03824 R-square: 0.9907 Adjusted R-square: 0.9707 RMSE: 0.07983
Best Answer