我有一個時間序列數據集,其中包含374天的數據點(每天1個數據點)。我奮力瞭解TS功能的頻率參數,所以我把它空:R時間序列頻率
ts_0615391206 <- ts(demand_rev_0615391206$estimated_demand,
start=as.Date(min(demand_rev_0615391206$date),format = "d%/m%/Y%"),
end=as.Date(max(demand_rev_0615391206$date),format = "d%/m%/Y%"),
#frequency = 1
)
plot.ts(ts_0615391206) 然而,當我嘗試使用分解:
ts_0615391206_components <- decompose(ts_0615391206)
我收到錯誤:
Error in decompose(ts_0615391206) :
time series has no or less than 2 periods
如何確定我的數據中有多少段時間,因此我們的數據段米的「頻率」值應該是?
> dput(head(ts_0615391206))
c(2.71, 2.47, 3.86, 3.61, 5.78, 5.59)
>
> str(ts_0615391206)
Time-Series [1:194] from 16125 to 16318: 2.71 2.47 3.86 3.61 5.78 5.59 3.28 3.4 3.34 3.68 ...