Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

roll_mad() - Mean | Median Absolute Deviation #22

Open
Eluvias opened this issue Sep 12, 2019 · 2 comments
Open

roll_mad() - Mean | Median Absolute Deviation #22

Eluvias opened this issue Sep 12, 2019 · 2 comments

Comments

@Eluvias
Copy link

@Eluvias Eluvias commented Sep 12, 2019

Would that fit to the existing framework / family functions?

@jjf234
Copy link
Owner

@jjf234 jjf234 commented Sep 17, 2019

The current list of functions is mostly from my own survey of rolling statistics that focuses on common use cases and demand, so could you share links to other GH repos or SO questions that discuss something like roll_mad? For more background, the function implementations in roll need to offer an "online" algorithm, which is more difficult, so need to consider the cost-benefit of each function too. Luckily the roll package does some of the heavy-lifting via roll_median that can be used in another function to calculate roll_mad (also as a one-off exercise too), if needed.

@Eluvias
Copy link
Author

@Eluvias Eluvias commented Sep 18, 2019

An R package with a rolling mad implementation is TTR with runMAD() function which has the option stats to return either the rolling median or mean absolute deviation.

Another R implementation is caTools::runmad().

MATLAB has a family of core Moving Statistics which includes a rolling median absolute deviation
via movmad function.

MATHEMATICA has MedianDeviation but offers a generic MovingMap to apply any function, so there is no need for a separate implementation.

Perhaps only for the case of the median absolute deviation, it looks natural for the roll package to offer an additional but more robust measure of dispersion.

Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.