MATLAB: Cosine with drift in time series.

cosinedriftfinanceseasonallity

Hi!
I am currently working with some electricity system price data.
The data exhibits quite a bit of seasonality and drift. I need to capture this to build my model. I want to use a cosine for the seasonality and a linear function to capture the drift.
Does anybody have any tips for how i can implement this? For most I need some articles or books that explain how to implement this. But if anybody has some tips for code, this would also be very useful.
I have seen that the business cycle literature speaks of the decomposition of trend and cycle, so if anybody has some tips that include liner drift and a cosine, that would be great. Tried the HP filter, but its too rough.
Hope you got any tips!
Best Martin

Best Answer

I suggest you peruse this site: