0

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).

2
  • I believe in the doc, you can find the function used. And the alpha from span is described in this doc. Is it what you look for? Commented Feb 19, 2024 at 21:02
  • @Ben.T The doc describes the theory behind the EWM weighting, but I don't want to re-implement the math from scratch if this is avoidable Commented Feb 19, 2024 at 22:16

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.