Date: Aug 28, 2013 10:40 AM
Author: dpb
Subject: Re: Moving average

On 8/28/2013 9:00 AM, Filipa Ferreira wrote:
> Hello!
>
> I am a Matlab begginer. I have for several companies dates on quarterly
> earnings announcements (4 dates per year) and also its daily returns
> (since 1974 until now).
>
> I need to select for each company a quarterly announcement date (eg:
> 25/10/2007) and from that date calculate a moving average of daily
> returns from 120 days before. Should I use the unique function to select
> each company data? They have unique identifying numbers.
>
> I have in excel a collumn with the quarterly dates (6171 rows) and a
> collumn with the daily returns (375930 rows).


How are the data arranged by company? Seems like should have multiple
columns for each -- QDate, DReturn, other?

A quick sanity check says there are <40*4 = 160 quarters total between
now and 1974 so some 6000 rows implies you've got the companies smooshed
together somehow as well. First thing will be to get it organized more
logically; precisely what operations to do so depends on just what shape
it's in now (or was originally to not get it so badly garbled to begin
with).

--