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

Resampling timeseries #9

Open
femtotrader opened this issue Nov 3, 2016 · 6 comments
Open

Resampling timeseries #9

femtotrader opened this issue Nov 3, 2016 · 6 comments

Comments

@femtotrader
Copy link
Collaborator

femtotrader commented Nov 3, 2016

Hello,

Resampling timeseries will be a great feature to have.
Ideally API should provide the concept of DateTimeOffset or TimeFrame (timeframe could be yearly, monthly, weekly, daily, hourly, minutely... or a multiple of)

See an analog question with TimeSeries.jl JuliaStats/TimeSeries.jl#257

Kind regards

@femtotrader
Copy link
Collaborator Author

femtotrader commented Nov 4, 2016

an example API design could be

Define a timeframe

tf = Yearly(5, boundary=End)

or

tf = Yearly(5, boundary=Begin)

Downscaling using mean values

mean(resample(ta, tf))

Downscaling using OHLC values

ohlc(resample(ta, tf)

which use internally

downscaling using

  • min
min(resample(ta, tf)
  • max
max(resample(ta, tf)
  • first
first(resample(ta, tf)
  • last
last(resample(ta, tf)

Downscaling using sum might also be required (to sum volume for example in OHLCV data)

sum(resample(ta, tf)

resample function need to return an object
let's call it TArraySampler on which mean, ohlc, min, max, first, last... this is lazy evaluation and behave like Pandas new resample API

@femtotrader
Copy link
Collaborator Author

femtotrader commented Nov 6, 2016

I've post an example of this API usage with TimeSeries.jl (but a similar approach could be done with JuliaTS) http://stackoverflow.com/questions/20816813/resampling-a-dataframe-to-hourly-15min-and-5min-periods-in-julia/40444762#40444762

Maybe we should have a shared package (let's call it TimeFrames.jl) to define timeframes.

So timeframes could be used both for JuliaTS and TimeSeries.jl (and maybe some other packages)

What is your opinion @tanmaykm @milktrader @JeffBezanson ?

@femtotrader
Copy link
Collaborator Author

TimeFrames.jl created
https://github.com/femtotrader/TimeFrames.jl

@tanmaykm
Copy link
Owner

tanmaykm commented Nov 8, 2016

@femtotrader Sorry, I am unable to actively participate at the moment because of other involvements.
I shall add you (and others if they wish) as a collaborator to JuliaTS so that I am not the bottleneck.
Thanks for your initiatives!

@femtotrader
Copy link
Collaborator Author

Thanks @tanmaykm for this

I want to first work on TimeSeries.jl resampling as it seems to be a in a more stable state for now than JuliaTS.jl

but I'm definitely interested in working on JuliaTS when it will we work with latest IndexedTables

@tanmaykm
Copy link
Owner

tanmaykm commented Nov 8, 2016

Sure! I can take a look at this in a few weeks.

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

No branches or pull requests

2 participants