Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: Fitting time series using an annual sine and cosine
Replies: 1   Last Post: Dec 3, 2012 10:36 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Derek Goring

Posts: 3,919
Registered: 12/7/04
Re: Fitting time series using an annual sine and cosine
Posted: Dec 3, 2012 10:36 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

On Tuesday, December 4, 2012 3:27:08 PM UTC+13, University wrote:
> Hi,
>
> I'm working with GRACE data and I want to fit the monthly time series using an annual sine and cosine, and semi-annual sine and cosine.


Say your data are in column vector y which represents nmon months of data:
dtm=365.25/12; % Interval in days
t=[0:nmon-1]'*dtm;
wSat=2*pi/365.25*t;
wSsat=2*pi/(365.25/2)*t;

A=[cos(wSat) sin(wSat) cos(wSsat) sin(wSsat)];
coef=A\y; % Coefficients of cos and sin terms



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.