Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
I just included $k<l<T$ for generality. It could be that for instance one asset was very influential during the first half of the lookback window at a given point in time, but then got delisted. Would one not want to include this fact somehow?
I don't really know what kind of different durations are used for FRN's. I have a list with "curve+spread" elements on a quarterly basis that I reckon would be the coupon payments, (thus replacing the cpn term in the code).