Skip to content

Lagged / Leading percent changes #152

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

Closed
dajmcdon opened this issue Jan 5, 2023 · 0 comments · Fixed by #153
Closed

Lagged / Leading percent changes #152

dajmcdon opened this issue Jan 5, 2023 · 0 comments · Fixed by #153

Comments

@dajmcdon
Copy link
Contributor

dajmcdon commented Jan 5, 2023

Create a recipe step that does lagged percent changes.

  • Simplest case: given a target time and a reference time, compute (target - reference) / reference. For example, target=0 and reference=7 and signal is cases, we get a column pct_chg_7_cases = (cases_0 - cases_7) / cases_7
  • Allow target and reference to be scalars or vectors.
  • Assert that Reference > target.
  • Allow for padding or some behaviour to deal with 0-valued signal in the reference.
  • Allow for log version as well log(cases_0 / cases_7).

This is helpful for #5 .

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

Successfully merging a pull request may close this issue.

1 participant