You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for the feedback. Fyi, I typically use the min_obs argument when there are many NA’s in a data set, yet I’m comfortable with a certain threshold of missing values. For example, rolling regressions with a 252-day window and min_obs = 63 days, i.e. a quarter. My sense is that most users don’t change the default min_obs = width argument though.
Anyway, in your example, I could just use width = min(100, nrow(x)) instead of width = 100 to satisfy the condition; however, I understand the latter is easier to write and, if a user has determined a reasonable min_obs threshold, then he/she should understand the concept of an expanding window and wants to get the desired result.
My concern is when users, who don’t change min_obs, see an error message about min_obs. Something like the following message could be confusing if the default arguments remain untouched: value of 'min_obs' must be between one and number of rows in 'x' and 'y'
In general, maybe a better solution is dependent on whether the min_obs is changed from the default or not. That is, if a user does not specify min_obs, then the error message stays the same as it is currently, otherwise a min_obs specific error message is returned like above. And then you can get the result, like in your example, if satisfied. What do you think?
Specifically, if the min_obs argument is different than the width argument, then there is a check whether the value of min_obs is between one and the minimum of either the number of rows in data or width.
Right now roll_lm throws the error when you try to run a rolling regression on data that is shorter than width:
It seems more appropriate to check the nrow(x) and nrow(y) are just greater than min_obs. Here's an example:
The text was updated successfully, but these errors were encountered: