Cosine with drift in time series.

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

 채택된 답변

the cyclist
the cyclist 2011년 4월 1일

0 개 추천

I suggest you peruse this site:

댓글 수: 4

Martin Gullaksen
Martin Gullaksen 2011년 4월 1일
I have worked a bit with LeSages stuff before, but I am a bit unsure where too look. Can you please be a bit more specific?
the cyclist
the cyclist 2011년 4월 1일
Well, not really. I used that toolbox years ago, when I was working with some economists, and I recall it handled issues you are talking about. However, I don't remember the specifics. I thought maybe you could poke around the site and/or do some keyword searching there.
Sorry I can't be more helpful than that.
Martin Gullaksen
Martin Gullaksen 2011년 4월 1일
Ok, I have started reading LeSage's book. Hope I find something.
Thanks for the tip anyway. Its a great toolbox.
BTW: what happens when you accept an answer in this forum?
Walter Roberson
Walter Roberson 2011년 4월 1일
When you accept an answer, it gets visually marked as accepted, and the person who posted the answer is given 4 reputation points and the number of "accepted" answers is increased by 1 for them.

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

hans
hans 2011년 4월 1일

0 개 추천

'fminsearch' might be a handy tool.
With it You can choose a type of function that You would like extract and calculate the coefficients.
function
...
AStart = [1 2]
ABest = fminsearch(@(AStart) QualFun(AStart,x,P),AStart);
...
end
function [LSqr]=QualFun(A,x,P)
fit = A(1)*x+A(2);
Diff = fit-P;
LSqr = sum(Diff.^2);
end

카테고리

도움말 센터File Exchange에서 Holidays / Seasons에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by