How can I fit a `HoltWinters` model with the `fable` package?

  Kiến thức lập trình

I have a tsibble with data every 15 minutes.

I want to simulate:

ts_data <- ts(data$value, deltat = 1/96) # There is a daily seasonality
model <- HoltWinters(ts_data)
predictions <- predict(model , n.ahead = 96)

How can I do this using fable? I have trouble adding the deltat/frequency parameter somewhere.
I tried:

data_train |> 
  model(hw = ETS(consumption ~ trend("A") + season("A"))) |> 
  forecast(h = 96) 

The first model is able to show seasonal predictions (accurate) but the one inside model cannot at all, at stays around the same value.

 hw_failed   predictions
        <num>    <num>
 1:  169.6353 147.8264
 2:  170.0528 146.8748
 3:  169.4447 144.4163
 4:  168.9828 148.3482
 5:  169.1216 150.3192
 6:  169.5391 148.2540
 7:  168.9311 140.0981
 8:  168.4691 139.4991
 9:  168.6079 139.5674
10:  169.0254 142.2911
11:  168.4174 142.9221
12:  167.9554 139.7753
13:  168.0942 137.0976
14:  168.5117 132.5767
15:  167.9037 127.5558
16:  167.4417 129.5384
17:  167.5806 132.2143
18:  167.9981 129.2312
19:  167.3900 127.7812
20:  166.9280 125.2476
21:  167.0669 128.3527
22:  167.4844 129.4398
23:  166.8763 129.7902
24:  166.4143 128.3030
25:  166.5532 131.6526
26:  166.9707 134.2288
27:  166.3626 145.7738
28:  165.9007 143.3738
29:  166.0395 146.6691
30:  166.4570 143.6985
31:  165.8489 135.0897
32:  165.3870 136.5083
33:  165.5258 141.6454
34:  165.9433 219.8764
35:  165.3353 219.7798
36:  164.8733 219.1824

Theme wordpress giá rẻ Theme wordpress giá rẻ Thiết kế website

LEAVE A COMMENT