Hello all,
I've been sitting here for hours now and I just can't seem to find a solution. Never really worked with STATA and similar statistic tools. I used to program a little bit when I was younger.
My problem is the following:
I have data of daily returns on assets. What I wanna do now is to calculate the exponential weighted average daily return for each time period t with the formula on the paper shown in the picture.
It doesn't look like there is a sum sign equivalent function in STATA (Capital Sigma). I thought about using for loops and incrementing i each time until t-2 but I don't know yet how I'd apply that with STATA syntax. I read the help content of forval, for each etc. but it didn't really help me.

Short description of the picture:
You can see 3 values with variable t and return. When I want to calculate the EWA Daily Return in period t=3 , i starts at 0, and r_t-1-i would be the return value of period 2 (0.003).
In case you're wondering why 60/61 : delta was chosen so the center of the mass is 60.
I'd appreciate it if anyone could point me in the right direction.
Thank you a lot!
Regards,
- Markus Stein
I've been sitting here for hours now and I just can't seem to find a solution. Never really worked with STATA and similar statistic tools. I used to program a little bit when I was younger.
My problem is the following:
I have data of daily returns on assets. What I wanna do now is to calculate the exponential weighted average daily return for each time period t with the formula on the paper shown in the picture.
It doesn't look like there is a sum sign equivalent function in STATA (Capital Sigma). I thought about using for loops and incrementing i each time until t-2 but I don't know yet how I'd apply that with STATA syntax. I read the help content of forval, for each etc. but it didn't really help me.
Short description of the picture:
You can see 3 values with variable t and return. When I want to calculate the EWA Daily Return in period t=3 , i starts at 0, and r_t-1-i would be the return value of period 2 (0.003).
In case you're wondering why 60/61 : delta was chosen so the center of the mass is 60.
I'd appreciate it if anyone could point me in the right direction.
Thank you a lot!
Regards,
- Markus Stein
Comment