Re: Curve Fitting to timeseries using a set of 8 sine and cosine functions [message #89555 is a reply to message #89550] |
Sat, 25 October 2014 16:00   |
siumtesfai
Messages: 62 Registered: April 2013
|
Member |
|
|
On Saturday, October 25, 2014 1:47:17 AM UTC-4, siumt...@gmail.com wrote:
> I think you should try to be for specific to ask question here.
>
> Suppose I have a timeseries with the S size.
>
> I want to do nonlinear fitting to the timeseries using the following fourier series ( harmonic function)
>
> F(X) = ∑((Ancos(nπx/L)+Bnsin(nπx/L) ) , Where n = 1,2,3,4
>
> And I would find 8 coefficients such as An and Bn where n = 1,2,3,4
>
> That is.
>
> A1,A2,A3,A4
> B1,B2,B3,B4
>
> I have attempted to understand how it works mpfit by Craig and curvefit . Unfortunately, I did not because I am not IDL expert. So I posted this if anyone can help
>
>
> Best Wishes
>
>
> Thanks for you help
Hello,
I do not use FFT because I have missing data . I provided you with monthly timeseries which does not have missing data. But generally, I use monthly datasets that have missing values.
That is why I used multiple regression.
Assumption about regression is though that the dataset follow gaussian distribution. Maybe I am not getting the correct coefficients of the sine and cosine terms because my data is skewed ( I can not think any thing else)
Second, I believe my model is correct because Suppose you have monthly temperature datasets. You can represent your seasonal cycle using the harmonics as I have .
Thanks
|
|
|