pyfinance icon indicating copy to clipboard operation
pyfinance copied to clipboard

min_window option in RollingOLS

Open AlessandroQI opened this issue 5 years ago • 3 comments

i would like to have min_window in the rollingOLS function, because if we have a window of 90 it does not perform OLS on first 90 values. i would like to perform a OLS expanding until 90 observations starting when there is at least 12 observation (min_window), then rolling of 90 (window)

Is it possible to implement that or someone has a quick workaround for this?

Thanks

AlessandroQI avatar Jan 31 '19 17:01 AlessandroQI

Hi @AlessandroQI .. I understand what you're trying to do here, but unfortunately I'm not sure if this can be implemented without sacrificing a lot of speed that is gained through NumPy. NumPy wants equally-sized blocks along all dimensions.

I will keep this open for now, and try to take a stab at it when I have some more time. Sorry that I can't help further at the moment.

bsolomon1124 avatar Feb 01 '19 01:02 bsolomon1124

thanks for your reply!

it would be great if you implent this, even if it will be slower!

thanks again

AlessandroQI avatar Feb 01 '19 08:02 AlessandroQI

It's funny, I was about to open a request for the same feature. I realize that this might not be possible using stride_tricks and have no idea what a working solution would look like.

prd1 avatar Feb 11 '19 21:02 prd1