[英]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).
我不是在寻找时间序列统计分析(例如ARIMA,Forcasting等)。 Instead, I want to extract a portion of data based on a time segment.
相反,我想根据时间段提取一部分数据。
Thanks Dirk & Mohsen! 感谢Dirk&Mohsen! @Dirk: I'll definitely try zoo.
@Dirk:我一定会去动物园的。 I heard that it's good for TS, but for some reason just slip out of my mind.
我听说这对TS很有好处,但是出于某种原因,我才想出来。 @Mohsen: I didn't use decomposition method.
@Mohsen:我没有使用分解方法。 But I tried stl, & it gives me lot of errors.
但是我尝试了stl,它给了我很多错误。 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.
但这正在使用其他软件在TS上运行。 I don't have problem with statistical analysis with TS.
我对TS的统计分析没有问题。 But I'm having problem in TS data manipulation in R.
但是我在R中的TS数据操作中遇到问题。
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) data <-ts(data [,1],start = 1956,freq = 12)
请查看Zoo软件包的文档,其中包含许多子集和聚合操作。
Here are some links to some previous stl() questions: 以下是一些以前的stl()问题的链接:
Calculating Start for stl() 计算stl()的开始
Feeding an hourly zoo time-series into function stl() 将每小时的动物园时间序列馈入函数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? 使用哪个R时间/日期类和包?
http://cran.r-project.org/web/views/TimeSeries.html http://cran.r-project.org/web/views/TimeSeries.html
http://www.stat.pitt.edu/stoffer/tsa2/R_time_series_quick_fix.htm http://www.stat.pitt.edu/stoffer/tsa2/R_time_series_quick_fix.htm
http://casoilresource.lawr.ucdavis.edu/drupal/book/export/html/100 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 如果您熟悉Python,我建议您使用scikits.timeseries或最近维护的熊猫的时间序列功能
Specifically for time segments, panda provides the follows construct: 专门针对时间段,panda提供以下构造:
A truncate convenience function is provided that is equivalent to slicing:
ts.truncate(before='10/31/2011', after='12/31/2011')
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.