Project

General

Profile

calculating exponentially weighted moving average ewma

Added by Polina Franke about 2 years ago

Hi there!

I need to calculate the exponentially weighted running mean based on the following equation:

I looked through the CDO manual and experimented with runmean and ydrunmean, but these operators don't really get me the results I need.

Is there any other way I could do this with CDO?? I think some combination of expr and operators might work, but I just can't wrap my head around it.

I am using CORDEX data in 3-hourly resolution and attached a sample of my data.

Thanks in advance for any help!


Replies (2)

RE: calculating exponentially weighted moving average ewma - Added by Polina Franke about 2 years ago

Addendum: I forgot to add, that for where there is no value of a running mean (Trm-1) the following equation is to be used:

So I guess for the first few days this equation is used as a proxy for the Trm and these days are then discarded as kind of a spin up.

RE: calculating exponentially weighted moving average ewma - Added by Ralf Mueller about 2 years ago

hi Polina!

in you initial definition of T_{rm} you use its value of the timestep before, which makes your formula recursive. IMO this is not possible in CDO at an operator level.

cheers
ralf

    (1-2/2)