我有高频商品价格数据需要分析。我的目标是不假设任何季节性因素,只需确定趋势。在这里,我遇到了R的问题。我知道有两个主要函数可以分析此时间序列:decompose()和stl()。问题在于它们都采用频率参数大于或等于2的ts对象类型。是否有一种方法可以假定每个单位时间的频率为1,并仍然使用R分析此时间序列?我担心如果我假设频率大于1每个单位时间,并且季节性是使用频率参数计算的,那么我的预测将取决于该假设。
我希望频率在单位时间内为1,但是使用decompose()和stl()时会出现问题!
names(crude.data)=c('Date','Time','Price')
names(crude.data)
freq = 2
win.graph()
plot(crude.data$Time,crude.data$Price, type="l")
crude.data$Price = ts(crude.data$Price,frequency=freq)
我希望频率在单位时间内为1,但是使用decompose()和stl()时会出现问题!
dim(crude.data$Price)
decom = decompose(crude.data$Price)
win.graph()
plot(decom$random[2:200],type="line")
acf(decom$random[freq:length(decom$random-freq)])
谢谢。