简体   繁体   中英

Time-Series Data manipulation

Can anybody suggest resources for time-series data manipulation. I'm not looking for time-series statistical analysis (eg ARIMA,Forcasting, etc). Instead, I want to extract a portion of data based on a time segment.


Thanks Dirk & Mohsen! @Dirk: I'll definitely try zoo. I heard that it's good for TS, but for some reason just slip out of my mind. @Mohsen: I didn't use decomposition method. But I tried stl, & it gives me lot of errors. I wish I can get more details on it.Also, I looked for the link that you provided me. But that is working on TS using other software. I don't have problem with statistical analysis with TS. But I'm having problem in TS data manipulation in R.

Also, majority of the time I deal with daily,weekly & monthly data. But the examples that I come across is yearly data. So, whn I try to replicate the examples in my dats set I get set I get lots of errors. i can't able to format the daily,weekly & monthly stats. Eg I want the following code in weekly format. But when I put the date in "start" segment, it gives me error. That's why I'm looking for some resources which gives examples only on time-series data manipulation All kind of manipulation. Once I can extract required data in time-series fromat I can run statistical analysis.

data<-ts(data[,1],start=1956,freq=12)

请查看Zoo软件包的文档,其中包含许多子集和聚合操作。

Here are some links to some previous stl() questions:

Calculating Start for stl()

Feeding an hourly zoo time-series into function stl()

Be careful how you model seasonal data. It gives a whole new meaning to the term "spurious regression".

x <- rnorm(200)
x.ts <- ts(x, start=1956, freq=12)
x.stl <- stl(x.ts, s.window = "periodic")
plot(x.stl)

x.dec <- decompose(x.ts)
plot(x.dec)

Here are some additional time series links:

Which R time/date class and package to use?

http://cran.r-project.org/web/views/TimeSeries.html

http://www.stat.pitt.edu/stoffer/tsa2/R_time_series_quick_fix.htm

http://casoilresource.lawr.ucdavis.edu/drupal/book/export/html/100

If you are familiar with Python, I would suggest using scikits.timeseries OR the timeseries features of the more-recently-maintained panda

Specifically for time segments, panda provides the follows construct:

A truncate convenience function is provided that is equivalent to slicing:

ts.truncate(before='10/31/2011', after='12/31/2011')

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM