Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, is already up and running.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: rolling moments

From   annoporci <>
Subject   Re: st: rolling moments
Date   Sun, 23 Dec 2012 05:57:55 +0800

I forgot to add, this is my best shot:

rolling sd=r(sd) skewness=r(skewness) kurtosis=r(kurtosis), window (60) clear: summarize, detail

The problem is that it generates a lot of gaps because of missing data.

On Sat, 22 Dec 2012 23:28:22 +0800, annoporci <> wrote:

Dear Statalist,

I have financial data whose statistical properties I'd like to analyze. I'm new to this so any pointer would be appreciated.

I would like to do the following:

plot a moving average of the mean/sd/skewness/kurtosis, where either I would use a fixed horizon, e.g. 60 observations (add one drop one as you move with time) or I would use exponentially declining weights on distant observations, for a fixed predetermined weight parameter.

I have found user-contributed programs to do that for the mean/sd, but not for the skewness and kurtosis. I'm especially interested in the kurtosis. In fact, I would like to also compute semi-kurtosis, e.g. semi-kurtosis for negative returns or for returns below average.

I could probably work this out on my own by writing down the formulas in terms of the first 4 moments, but I have read exchanges that suggest that efficiency issues may be important, so I'd like to start on the right track, and would thus appreciate your suggestions.

my dataset has the date and the daily return for different portfolios x1, x2, x3, etc. over a 30 year period, so efficiency in the code is likely to be necessary.

many thanks,


my main reference:
*   For searches and help try:

© Copyright 1996–2016 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index