rstudio-conf-2020 / time-series-forecasting

Creative Commons Attribution Share Alike 4.0 International
222 stars 131 forks source link

How to Forecast Daily time series data using R ? #9

Closed VineelaKantamneni closed 3 years ago

VineelaKantamneni commented 3 years ago

I had data from 1st jan 2020 to 31st dec 2020. I have to forecast it for nextyear i.e, 1st jan 2021 to 31st dec 2021. Using the ARIMA model for forecasting got forecasted points as below. But I would like to get the points corresponding to day as 1st jan 2021 not like 2021.0021 as shown below. And suggest any other best method to forecast daily data.

Input:

Date Data
1/1/2020 147066
1/2/2020 59850
1/3/2020 60166
1/4/2020 20273
1/5/2020 166577
1/6/2020 57629
1/7/2020 50974
1/8/2020 53122
1/9/2020 75639
1/10/2020 51705
1/11/2020 19389
1/12/2020 33566
1/13/2020 58759
1/14/2020 63462
1/15/2020 131582
1/16/2020 124749
1/17/2020 45090
1/18/2020 18678
1/19/2020 19167
1/20/2020 262251
1/21/2020 76637
1/22/2020 45754
1/23/2020 50580
1/24/2020 44655
1/25/2020 24645
1/26/2020 84294
1/27/2020 48365
1/28/2020 47998
1/29/2020 49123
1/30/2020 87312
1/31/2020 63287
2/1/2020 149463
2/2/2020 24460
2/3/2020 64500
2/4/2020 48250
2/5/2020 186274
2/6/2020 45210
2/7/2020 44898
2/8/2020 23836
2/9/2020 46089
2/10/2020 60875
2/11/2020 46063
2/12/2020 55578
2/13/2020 59496
2/14/2020 49173
2/15/2020 30474
2/16/2020 15472
2/17/2020 58502
2/18/2020 111990
2/19/2020 135940
2/20/2020 201198
2/21/2020 49497
2/22/2020 21158
2/23/2020 23555
2/24/2020 48559
2/25/2020 49984
2/26/2020 111560
2/27/2020 50044
2/28/2020 64995
2/29/2020 51083
3/1/2020 151229
3/2/2020 62876
3/3/2020 61260
3/4/2020 48123
3/5/2020 190471
3/6/2020 45043
3/7/2020 20795
3/8/2020 28315
3/9/2020 77523
3/10/2020 58159
3/11/2020 47395
3/12/2020 59635
3/13/2020 47636
3/14/2020 20240
3/15/2020 43008
3/16/2020 67633
3/17/2020 64285
3/18/2020 82462
3/19/2020 129412
3/20/2020 189083
3/21/2020 20762
3/22/2020 23342
3/23/2020 45992
3/24/2020 40555
3/25/2020 43409
3/26/2020 102471
3/27/2020 43446
3/28/2020 23211
3/29/2020 16727
3/30/2020 55652
3/31/2020 55557
4/1/2020 182078
4/2/2020 50299
4/3/2020 53609
4/4/2020 20900
4/5/2020 168210
4/6/2020 50997
4/7/2020 43996
4/8/2020 47673
4/9/2020 75915
4/10/2020 45595
4/11/2020 17621
4/12/2020 30657
4/13/2020 54110
4/14/2020 62350
4/15/2020 80868
4/16/2020 95267
4/17/2020 44600
4/18/2020 20156
4/19/2020 113512
4/20/2020 215589
4/21/2020 46804
4/22/2020 43131
4/23/2020 53192
4/24/2020 42365
4/25/2020 24650
4/26/2020 90092
4/27/2020 57752
4/28/2020 65542
4/29/2020 127334
4/30/2020 86453
5/1/2020 187090
5/2/2020 25120
5/3/2020 32763
5/4/2020 56475
5/5/2020 192286
5/6/2020 45438
5/7/2020 47892
5/8/2020 47976
5/9/2020 42368
5/10/2020 32087
5/11/2020 51726
5/12/2020 53068
5/13/2020 46524
5/14/2020 59868
5/15/2020 60363
5/16/2020 20488
5/17/2020 40129
5/18/2020 85703
5/19/2020 122119
5/20/2020 199290
5/21/2020 42773
5/22/2020 42679
5/23/2020 22750
5/24/2020 15560
5/25/2020 32606
5/26/2020 112392
5/27/2020 47409
5/28/2020 50319
5/29/2020 54198
5/30/2020 31921
5/31/2020 25705
6/1/2020 192401
6/2/2020 54330
6/3/2020 56471
6/4/2020 50622
6/5/2020 186657
6/6/2020 19821
6/7/2020 24441
6/8/2020 56974
6/9/2020 70455
6/10/2020 55864
6/11/2020 50829
6/12/2020 49864
6/13/2020 19208
6/14/2020 28567
6/15/2020 72854
6/16/2020 58871
6/17/2020 65268
6/18/2020 106794
6/19/2020 40660
6/20/2020 170340
6/21/2020 76242
6/22/2020 50996
6/23/2020 49036
6/24/2020 44413
6/25/2020 54892
6/26/2020 110668
6/27/2020 24229
6/28/2020 22396
6/29/2020 50783
6/30/2020 76521
7/1/2020 197520
7/2/2020 49662
7/3/2020 40002
7/4/2020 16597
7/5/2020 171065
7/6/2020 63412
7/7/2020 54906
7/8/2020 57113
7/9/2020 79646
7/10/2020 56296
7/11/2020 21419
7/12/2020 38419
7/13/2020 63717
7/14/2020 69842
7/15/2020 83631
7/16/2020 107375
7/17/2020 46591
7/18/2020 20410
7/19/2020 127204
7/20/2020 226128
7/21/2020 51765
7/22/2020 48971
7/23/2020 56225
7/24/2020 47348
7/25/2020 31648
7/26/2020 91207
7/27/2020 56451
7/28/2020 55893
7/29/2020 61156
7/30/2020 102587
7/31/2020 61780
8/1/2020 158647
8/2/2020 27953
8/3/2020 71816
8/4/2020 53988
8/5/2020 192018
8/6/2020 49887
8/7/2020 46367
8/8/2020 25461
8/9/2020 47538
8/10/2020 64670
8/11/2020 50160
8/12/2020 55324
8/13/2020 61299
8/14/2020 50716
8/15/2020 28399
8/16/2020 37757
8/17/2020 78375
8/18/2020 89222
8/19/2020 132254
8/20/2020 204333
8/21/2020 44620
8/22/2020 20828
8/23/2020 21579
8/24/2020 49954
8/25/2020 58065
8/26/2020 111042
8/27/2020 47203
8/28/2020 52111
8/29/2020 20283
8/30/2020 29826
8/31/2020 64518
9/1/2020 195437
9/2/2020 53588
9/3/2020 64077
9/4/2020 48060
9/5/2020 162385
9/6/2020 15730
9/7/2020 28289
9/8/2020 61829
9/9/2020 77105
9/10/2020 66984
9/11/2020 44326
9/12/2020 26914
9/13/2020 26905
9/14/2020 63628
9/15/2020 75224
9/16/2020 66779
9/17/2020 116278
9/18/2020 46236
9/19/2020 19777
9/20/2020 246273
9/21/2020 56409
9/22/2020 46335
9/23/2020 44553
9/24/2020 46273
9/25/2020 59703
9/26/2020 88080
9/27/2020 22401
9/28/2020 54964
9/29/2020 49632
9/30/2020 77797
10/1/2020 203090
10/2/2020 57524
10/3/2020 32400
10/4/2020 28623
10/5/2020 208642
10/6/2020 52883
10/7/2020 50603
10/8/2020 61617
10/9/2020 67601
10/10/2020 31550
10/11/2020 17141
10/12/2020 53051
10/13/2020 71005
10/14/2020 67803
10/15/2020 94461
10/16/2020 47068
10/17/2020 21273
10/18/2020 74941
10/19/2020 161766
10/20/2020 214441
10/21/2020 49944
10/22/2020 48876
10/23/2020 46241
10/24/2020 21420
10/25/2020 37258
10/26/2020 119099
10/27/2020 51471
10/28/2020 57383
10/29/2020 81282
10/30/2020 65851
10/31/2020 27832
11/1/2020 172870
11/2/2020 69680
11/3/2020 65131
11/4/2020 50743
11/5/2020 195423
11/6/2020 47931
11/7/2020 20411
11/8/2020 31166
11/9/2020 80681
11/10/2020 55975
11/11/2020 44767
11/12/2020 70740
11/13/2020 55214
11/14/2020 27041
11/15/2020 44829
11/16/2020 72506
11/17/2020 74123
11/18/2020 92028
11/19/2020 137294
11/20/2020 210740
11/21/2020 24551
11/22/2020 27608
11/23/2020 53779
11/24/2020 51280
11/25/2020 58860
11/26/2020 88730
11/27/2020 40049
11/28/2020 29224
11/29/2020 24123
11/30/2020 95647
12/1/2020 209962
12/2/2020 64368
12/3/2020 73783
12/4/2020 57757
12/5/2020 167630
12/6/2020 29977
12/7/2020 61988
12/8/2020 61860
12/9/2020 80764
12/10/2020 72496
12/11/2020 53194
12/12/2020 31865
12/13/2020 32981
12/14/2020 72064
12/15/2020 86977
12/16/2020 76722
12/17/2020 125206
12/18/2020 58990
12/19/2020 25574
12/20/2020 253838
12/21/2020 65194
12/22/2020 51897
12/23/2020 51495
12/24/2020 35467
12/25/2020 29471
12/26/2020 92382
12/27/2020 27307
12/28/2020 74560
12/29/2020 62177
12/30/2020 81735
12/31/2020 85819

I had took the above data as a dataframe and forecasted model <- ts(df$data,start = c(2020,1),frequency = 365.25) auto.arima(model) forecast(auto.arima(model),h=60) # First forecasted for next 60 days

output: Screenshot from 2021-06-07 11-57-19

robjhyndman commented 3 years ago

This is not a help site. Please ask at https://community.rstudio.com/

VineelaKantamneni commented 3 years ago

Thank you

VineelaKantamneni commented 3 years ago

Can you please help me with posting this question in above link?