简体   繁体   English

每 15 分钟用数据创建时间序列模型

[英]Create Time-Series Model with data every 15minutes

I'm working on a SHM system where I have data every 15 minutes that came from sensors on a structure.我正在开发一个 SHM 系统,其中每 15 分钟就有一次来自结构传感器的数据。 I have a set of observations where there is no damage and another where some kind of damage was simulated.我有一组观察结果,其中没有损坏,另一组观察到模拟了某种损坏。 My objective is to take the undamaged data and use it to forecast.我的目标是获取未损坏的数据并使用它进行预测。 This forecasted data is then compared to the undamaged one and this difference will then be used to create control charts.然后将此预测数据与未损坏的数据进行比较,然后将使用这种差异来创建控制图。

However my undamaged data is of around 5 months and the damaged state is of 8 months.但是,我的未损坏数据大约为 5 个月,损坏状态为 8 个月。 I tried to explore the forecast package using multiple seasonality ( msts ) of 96 (1 day) and 35060 (1 year) since I believe it has a connection to temperature.我尝试使用 96(1 天)和 35060(1 年)的多个季节性 ( msts ) 来探索forecast包,因为我相信它与温度有关。

The models that I created that followed some kind of pattern that could resemble reality had a small amplitude, while the real data was much more volatile.我创建的模型遵循某种可能类似于现实的模式,其幅度很小,而真实数据的波动性要大得多。

Can someone point me in the right direction as to what to do next and how to do it?有人可以指出我下一步要做什么以及如何做的正确方向吗?

PS: When using the ts function even though I try to make it start at 2018-04-27 14:15:00 , when plotting the ts object always starts at 1-1-2018 . PS:当使用ts函数时,即使我试图让它从2018-04-27 14:15:00开始,在绘制ts对象时总是从1-1-2018开始。 I think this is more aesthetic than anything but setting it right would be appreciated.我认为这比任何事情都更美观,但将其设置正确将不胜感激。

ts and msts objects are not well suited to high frequency data. tsmsts对象不太适合高频数据。 I suggest you try using tsibble objects via the tsibble package ( http://tsibble.tidyverts.org ).我建议您尝试通过tsibble包( http://tsibble.tidyverts.org )使用tsibble对象。 With tsibble , the time index is explicit.使用tsibble ,时间索引是明确的。 Here is an example using 30 minute data.这是一个使用 30 分钟数据的示例。

library(tsibble)
library(feasts)
library(ggplot2)
tsibbledata::vic_elec
#> # A tsibble: 52,608 x 5 [30m] <UTC>
#>    Time                Demand Temperature Date       Holiday
#>    <dttm>               <dbl>       <dbl> <date>     <lgl>  
#>  1 2012-01-01 00:00:00  4263.        21.0 2012-01-01 TRUE   
#>  2 2012-01-01 00:30:00  4049.        20.7 2012-01-01 TRUE   
#>  3 2012-01-01 01:00:00  3878.        20.6 2012-01-01 TRUE   
#>  4 2012-01-01 01:30:00  4036.        20.4 2012-01-01 TRUE   
#>  5 2012-01-01 02:00:00  3866.        20.2 2012-01-01 TRUE   
#>  6 2012-01-01 02:30:00  3694.        20.1 2012-01-01 TRUE   
#>  7 2012-01-01 03:00:00  3562.        19.6 2012-01-01 TRUE   
#>  8 2012-01-01 03:30:00  3433.        19.1 2012-01-01 TRUE   
#>  9 2012-01-01 04:00:00  3359.        19.0 2012-01-01 TRUE   
#> 10 2012-01-01 04:30:00  3331.        18.8 2012-01-01 TRUE   
#> # … with 52,598 more rows
tsibbledata::vic_elec %>% autoplot(Demand)

在此处输入图片说明

Created on 2019-11-27 by the reprex package (v0.3.0)reprex 包(v0.3.0) 于 2019 年 11 月 27 日创建

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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