How to recreate or extract weights table from Pandas EWM function

25 views Asked by At

I want to implement a rolling WLS regression such that more recent data points are weighted more heavily than older ones. Pandas has the very convenient EWM object for exponentially-weighted aggregations, but to my knowledge the API only supports accessing the final aggregations. I would like to extract the actual weights matrix that multiplies the original dataframe to create the EWM dataframe, which I can then use to pass weights to some WLS software. If this is impossible, if someone could help me to manually write the function for generating such a matrix it would be much appreciated (I would almost exclusively be using the span parameter to generate weights, if that helps).

0

There are 0 answers