JuliaStats / StatsBase.jl

Basic statistics for Julia
Other
581 stars 191 forks source link

ar() method for fitting an autoregressive time series model #30

Closed papamarkou closed 10 years ago

papamarkou commented 10 years ago

Fitting an autoregressive time series model to data (by default selecting the complexity using AIC) is needed in many different occasions beyond sole time series analysis. For instance it is used for computing MCMC convergence diagnostics and in other cases. R considers the function so important that it ships with its "base" code rather than being part of a package. My view would be that we need this function. Before embarking on coding it, I wanted to discuss it and get your views - do you also find it worth having it somewhere in JuliaStats? If yes, would you want it in Stats or in a separate JuliaStats package called TimeSeries?

andreasnoack commented 10 years ago

I think we should start a TimeSeries package under JuliaStats and see if we can agree on some core functionality there. I am not very satisfied with the time series functionalities in R's Stats and therefore I don't think we should see that as our goal, but I am fine with an ar function similar to the one in R.

StefanKarpinski commented 10 years ago

My rather limited understanding is that Pandas has good time series support, so perhaps that can serve as more of a design guide than R.

nfoti commented 10 years ago

The python module statsmodels has good time series support (it's another Wes McKinney project) that would be good to look at.

Sent from my iPhone

On Oct 13, 2013, at 11:11 AM, Stefan Karpinski notifications@github.com wrote:

My rather limited understanding is that Pandas has good time series support, so perhaps that can serve as more of a design guide than R.

— Reply to this email directly or view it on GitHub.

papamarkou commented 10 years ago

I agree that a standalone TimeSeries package would be a petter place than Stats. I haven't used Pandas or Python's statsmodels package before, but they look a good start at a first look. TISEAN has several routines for non-linear time series analysis (which is a somewhat more specialized toolbox). The functionality I have so far in mind is:

This list is just a start, any help to extend it would be great. Shall we create a TimeSeries template under JuliaStats in the near future as a placeholder and add code incrementally depending on what functionality we agree to support?

papamarkou commented 10 years ago

Thank you for your replies @AndreyKolev, @milktrader. I thought I may reference the older thread JuliaLang/METADATA.jl#336 here, so that we all join the discussion. @andreasnoackjensen, @StefanKarpinski, @nfoti, @johnmyleswhite, @dmbates, @simonster, shall we start forming an idea of what would initially go in a TimeSeries JuliaStats package, and shall we open a project placeholder under JuliaStats to slowly start making some progress? Please include in the discussion anyone I may had missed to add.

StefanKarpinski commented 10 years ago

That sounds like an excellent idea to me.

milktrader commented 10 years ago

I'm happy to move the TimeSeries package over any time. Presumably I need agreement to change the ownership? Also, happy to do the same with TimeModels, which can be a good placeholder for modeling time series until we decide whether it's one package (along with TimeSeries) or two separate ones.

StefanKarpinski commented 10 years ago

Someone in the JuliaStats organization needs to give you admin privilege while you do this.

papamarkou commented 10 years ago

My feeling is that the consensus will be to have a single package TimeSeries, let's wait to see what others will say :+1:

milktrader commented 10 years ago

TimeSeries now is just a handful of utility methods and the title is a bit regal for such a package, so I'm on board with placing time modeling into it.

milktrader commented 10 years ago

Here is a link to the non-trivial code in TimeModels. https://github.com/milktrader/TimeModels.jl/pull/1

andreasnoack commented 10 years ago

I think it would be a good idea to move the TimeModels/TimeSeries repo over to JuliaStats. Maybe it is an idea to keep the two packages separated. The problem of handling time series data is really separate from setting up the statistical modeling functionality.

papamarkou commented 10 years ago

It's true that these are two different functionalities. If a time series type would be designed to be really fundamental (as fundamental as handling even date-time data currently in Datetime, which would be used nearly as broadly as data arrays), it makes sense. Otherwise, handling time series would probably be rather trivial to be justified as a separate entity. How shall we proceed to move the repos over to julia stats?

milktrader commented 10 years ago

I just need an invitation and I'l do it. Let's start with them being separate packages. I'm currently hacking around a TimeFrame type in the TimeFrame branch of TimeSeries. https://github.com/milktrader/TimeSeries.jl/issues/26

papamarkou commented 10 years ago

I am ok with the suggestion to keep them separate. I don't know how to invite you - @andreasnoackjensen, @StefanKarpinski, if you agree, would you like to authorize @milktrader to make the transfer?

milktrader commented 10 years ago

If you have admin privileges, this should do it https://help.github.com/articles/how-do-i-add-a-collaborator

But I've not done it before so not sure.

papamarkou commented 10 years ago

To be honest, because I was added to JuliaStats about 4 months ago, I don't know if I would be allowed to take the liberty and add someone without the consent of one of the older members - Stefan are you ok with this?

johnmyleswhite commented 10 years ago

Please just make a specialized team that has access to the time series stuff. In that case, there's literally no possibility of harm.

StefanKarpinski commented 10 years ago

I don't even have push access to this repo, let alone admin rights in JuliaStats as a whole. @johnmyleswhite or someone else who's an admin here will have to do it. But, yes, I'm ok with this (as a spectator).

johnmyleswhite commented 10 years ago

I've created a team for TimeSeries. What else needs to be done? Transferring some repos to JuliaStats?

papamarkou commented 10 years ago

I followed these instructions https://help.github.com/articles/how-do-i-set-up-a- and the team management link didn't appear. @johnmyleswhite, would you like to do it as I think I don't have the privileges to complete it myself.

papamarkou commented 10 years ago

Yes, the TimeSeries and TimeModels packages need to be transfered to JuliaStats, thanks John.

johnmyleswhite commented 10 years ago

Ok. To do that, I'll give you and @milktrader full control over JuliaStats temporarily. After that's done, we'll go back to teams with more granular control.

papamarkou commented 10 years ago

Thanks a lot John. @milktrader would you like to transfer your 2 repos so that @johnmyleswhite can revert the admin rights afterwards?

milktrader commented 10 years ago

Sure.

milktrader commented 10 years ago

Okay, done. The only privies I'm interested in is with TimeSeries and TimeModels. I presume that's what the teams within JuliaStats organization will enable.

papamarkou commented 10 years ago

Good, I will close this issue now. ar() can be added in TimeModels.

johnmyleswhite commented 10 years ago

All the admin work is done now. @milktrader and @scidom have full control of TimeSeries and TimeModels, both now under JuliaStats.

papamarkou commented 10 years ago

Thanks John, only to double check, do I keep have admin access to MCMC?

johnmyleswhite commented 10 years ago

Yes, none of that should have changed. Let me know if something went wrong.

papamarkou commented 10 years ago

Cheers!