In this task I was presented with data that shows how much revenue was taken in by the telecommunication company I am consulting. A question that I get when looking at the data is: Are there any patterns hidden in the data that will help the stakeholders better understand the company’s revenue trends that can help make more accurate forecasts? Some publicly traded companies are required to report earnings and in doing so they will give forecasts of their expected earnings. It is important for a company to be as accurate as possible when reporting their financial information. The goal for this data set analysis is to find any patterns and make specific, actionable recommendations to the decision makers of the company.

Time series modeling comes with a few assumptions and these assumptions vary depending on the type of series being presented. A white noise series is one that is random with independent variables that are distributed the same. It is also assumed that the mean for a white noise series in zero. A stationary series is one that does not change over time. The variance of the series is fairly the same over time, it may fluctuate but it will behave the same from one period to another. With all of the time series data types, there is an assumption of normality because a time series is a sequence of data in chronological order. Some time series are auto-correlated which assumes that each observation is related to it’s past. The greater the auto-correlation the greater the predictability of the data set.

The first step in the analysis of the data set was to import it into R. The data on the Excel spreadsheet had two columns, “Day” and “Revenue.” When it was imported into R there was a third column added by R that was the row numbers.

Import and view data from Excel.

time_series_data <- read.csv("C:\\Users\\tncol\\teleco_ts.csv", sep = ",")
View(time_series_data)
print(time_series_data)
##     Day      Revenue
## 1     1  0.000000000
## 2     2  0.000793191
## 3     3  0.825541786
## 4     4  0.320332280
## 5     5  1.082554085
## 6     6  0.107653784
## 7     7  0.493901361
## 8     8  0.376698452
## 9     9  0.304074848
## 10   10  0.591747849
## 11   11  0.731018901
## 12   12  1.111586215
## 13   13  0.960902689
## 14   14  0.964013419
## 15   15  0.979731886
## 16   16  1.085546892
## 17   17  1.262549787
## 18   18  1.331183307
## 19   19  1.411429732
## 20   20  1.709116779
## 21   21  1.735783527
## 22   22  1.760959886
## 23   23  2.558601513
## 24   24  1.484204950
## 25   25  2.089944633
## 26   26  2.840568572
## 27   27  2.162204307
## 28   28  3.113269737
## 29   29  2.746580938
## 30   30  3.079242819
## 31   31  2.647838543
## 32   32  3.118230798
## 33   33  2.442888497
## 34   34  3.042407809
## 35   35  3.012894439
## 36   36  3.290825745
## 37   37  3.274029416
## 38   38  3.586805202
## 39   39  3.170426377
## 40   40  3.572077947
## 41   41  2.693130469
## 42   42  2.399656142
## 43   43  2.433776379
## 44   44  2.593848576
## 45   45  3.323496491
## 46   46  2.951387252
## 47   47  3.216948781
## 48   48  2.877026963
## 49   49  3.057523831
## 50   50  2.858495329
## 51   51  2.533082553
## 52   52  3.223959721
## 53   53  2.973617615
## 54   54  3.360834071
## 55   55  2.310401570
## 56   56  1.843596513
## 57   57  1.631977575
## 58   58  1.644604449
## 59   59  1.497246827
## 60   60  1.267859555
## 61   61  1.587253694
## 62   62  2.131085418
## 63   63  1.995083459
## 64   64  2.330776602
## 65   65  1.742724907
## 66   66  2.588660848
## 67   67  1.505169543
## 68   68  2.226315816
## 69   69  2.973069578
## 70   70  2.723880590
## 71   71  2.964093274
## 72   72  3.888201920
## 73   73  3.938590458
## 74   74  5.138308366
## 75   75  5.482323172
## 76   76  6.133334991
## 77   77  6.366939393
## 78   78  6.434758029
## 79   79  6.102308899
## 80   80  6.236527145
## 81   81  6.815921859
## 82   82  7.072864650
## 83   83  6.274130876
## 84   84  7.375977982
## 85   85  6.916245052
## 86   86  7.408050282
## 87   87  7.863842943
## 88   88  6.783895049
## 89   89  7.583081086
## 90   90  7.763779393
## 91   91  7.344577122
## 92   92  7.982311471
## 93   93  6.946042709
## 94   94  7.495289393
## 95   95  7.450862838
## 96   96  6.827344290
## 97   97  7.095401048
## 98   98  6.322858273
## 99   99  6.453783819
## 100 100  6.901420390
## 101 101  6.364222316
## 102 102  6.487956156
## 103 103  6.055526889
## 104 104  6.416777674
## 105 105  6.695885552
## 106 106  6.381637205
## 107 107  6.151061938
## 108 108  6.604086168
## 109 109  7.181114215
## 110 110  7.946744172
## 111 111  8.034009599
## 112 112  8.034351705
## 113 113  7.944531429
## 114 114  7.573324241
## 115 115  7.164514393
## 116 116  6.309727531
## 117 117  7.418626769
## 118 118  7.001823150
## 119 119  8.029547488
## 120 120  7.330337859
## 121 121  7.606007772
## 122 122  7.110366293
## 123 123  7.131337879
## 124 124  6.764886020
## 125 125  7.260526894
## 126 126  7.544141343
## 127 127  7.330936080
## 128 128  7.568258573
## 129 129  7.486801358
## 130 130  8.117012517
## 131 131  7.415766826
## 132 132  7.780389211
## 133 133  7.830950713
## 134 134  7.922069280
## 135 135  7.769710310
## 136 136  8.176501818
## 137 137  7.753128355
## 138 138  7.447803280
## 139 139  6.606752799
## 140 140  7.606778130
## 141 141  7.157498503
## 142 142  7.218478047
## 143 143  7.485049457
## 144 144  7.152312945
## 145 145  7.506441261
## 146 146  7.029261517
## 147 147  7.065160910
## 148 148  6.585496947
## 149 149  6.108246159
## 150 150  5.913673164
## 151 151  6.844251596
## 152 152  5.936896508
## 153 153  7.146617054
## 154 154  5.698388374
## 155 155  6.419385890
## 156 156  5.351951701
## 157 157  6.013657257
## 158 158  5.676967765
## 159 159  5.362054145
## 160 160  5.136908683
## 161 161  6.138729310
## 162 162  5.468684959
## 163 163  5.457250359
## 164 164  6.305916197
## 165 165  6.150076530
## 166 166  6.565829307
## 167 167  6.966321242
## 168 168  6.311706340
## 169 169  5.943952602
## 170 170  5.841843614
## 171 171  6.681780332
## 172 172  5.664625151
## 173 173  5.481281548
## 174 174  5.671976498
## 175 175  5.188018593
## 176 176  5.609863758
## 177 177  4.907574806
## 178 178  5.437139336
## 179 179  5.298284266
## 180 180  5.412603871
## 181 181  5.674703941
## 182 182  6.233395622
## 183 183  5.964008868
## 184 184  6.223849962
## 185 185  6.179556586
## 186 186  5.921670524
## 187 187  6.277405791
## 188 188  5.871568903
## 189 189  5.816199182
## 190 190  6.438534430
## 191 191  5.900740560
## 192 192  6.213554554
## 193 193  5.561818866
## 194 194  6.015062568
## 195 195  6.245567733
## 196 196  5.617964732
## 197 197  6.047722333
## 198 198  5.328600654
## 199 199  5.984050593
## 200 200  5.718670217
## 201 201  6.168549778
## 202 202  6.419179952
## 203 203  6.770455873
## 204 204  6.460004712
## 205 205  5.973167431
## 206 206  5.589806569
## 207 207  5.966559897
## 208 208  6.508410710
## 209 209  5.914158993
## 210 210  6.137185499
## 211 211  6.701932741
## 212 212  6.481133865
## 213 213  6.502357716
## 214 214  7.223705866
## 215 215  6.832373048
## 216 216  6.946346894
## 217 217  6.239278536
## 218 218  7.064640345
## 219 219  6.695172714
## 220 220  5.680079038
## 221 221  6.412772263
## 222 222  5.811691619
## 223 223  6.188332410
## 224 224  5.280124523
## 225 225  6.278287558
## 226 226  6.708512399
## 227 227  6.524116876
## 228 228  6.378960244
## 229 229  6.434691767
## 230 230  6.475201270
## 231 231  7.384317349
## 232 232  7.651861894
## 233 233  8.701207113
## 234 234  7.591809144
## 235 235  8.133817813
## 236 236  7.353039585
## 237 237  7.544987314
## 238 238  7.065749819
## 239 239  7.550080449
## 240 240  7.568530826
## 241 241  6.781578804
## 242 242  6.518598196
## 243 243  6.365795463
## 244 244  6.779827762
## 245 245  6.517114237
## 246 246  6.705527436
## 247 247  7.092380299
## 248 248  7.058309661
## 249 249  6.544608743
## 250 250  7.429563290
## 251 251  7.721857658
## 252 252  6.502133156
## 253 253  7.391609269
## 254 254  6.989221405
## 255 255  7.453399290
## 256 256  7.591757865
## 257 257  7.766084958
## 258 258  8.361602643
## 259 259  8.037333381
## 260 260  8.959983524
## 261 261  9.151138020
## 262 262  8.905577837
## 263 263  9.415349311
## 264 264  9.724684431
## 265 265 10.090115070
## 266 266 10.254659610
## 267 267  9.549328447
## 268 268 10.085317750
## 269 269 10.868216210
## 270 270 10.432826170
## 271 271 11.151565920
## 272 272 10.644849630
## 273 273 10.964877370
## 274 274 11.689646230
## 275 275 10.898026480
## 276 276 11.155951370
## 277 277 11.124507660
## 278 278 11.454539950
## 279 279 10.880663250
## 280 280 11.393060980
## 281 281 11.550300410
## 282 282 11.358772120
## 283 283 11.400129340
## 284 284 10.804153190
## 285 285 10.951139570
## 286 286 10.009654520
## 287 287 10.638526160
## 288 288 10.113053640
## 289 289 10.009553600
## 290 290 10.211520700
## 291 291 10.173546970
## 292 292  9.849481019
## 293 293 10.246766630
## 294 294  9.835264689
## 295 295 10.493143220
## 296 296  9.603350087
## 297 297  9.248760060
## 298 298  9.401037919
## 299 299  9.939871378
## 300 300 10.135351120
## 301 301  9.647129671
## 302 302 10.785570550
## 303 303  9.760365268
## 304 304 10.386943700
## 305 305 10.478863500
## 306 306 10.577523360
## 307 307 10.472916620
## 308 308 10.408936970
## 309 309  9.654938495
## 310 310  9.834805834
## 311 311  9.425696511
## 312 312  9.554565120
## 313 313 10.108556670
## 314 314  9.526518729
## 315 315 10.031601030
## 316 316  9.680840970
## 317 317  9.706378830
## 318 318  8.587347032
## 319 319  9.048395345
## 320 320  8.263694395
## 321 321  9.039981900
## 322 322  9.163766036
## 323 323  9.518616967
## 324 324  8.592423729
## 325 325  8.600153773
## 326 326  8.899976886
## 327 327  9.491880902
## 328 328  9.119437222
## 329 329 10.171820490
## 330 330 10.158989410
## 331 331 10.885220350
## 332 332 10.052281720
## 333 333 10.229875020
## 334 334  9.841212706
## 335 335 10.490749930
## 336 336 10.191918510
## 337 337 10.014364230
## 338 338  9.990859230
## 339 339 10.026811310
## 340 340  9.525744753
## 341 341  9.765642634
## 342 342  9.555497572
## 343 343  9.112280150
## 344 344  8.759691125
## 345 345  9.249328093
## 346 346  8.775523170
## 347 347  9.854105527
## 348 348 10.253357720
## 349 349  9.984374800
## 350 350 11.063980760
## 351 351 10.710106190
## 352 352 11.257614090
## 353 353 10.609282670
## 354 354 11.329328840
## 355 355 11.160532420
## 356 356 11.339960040
## 357 357 11.542398280
## 358 358 11.792706840
## 359 359 11.705268350
## 360 360 11.897535870
## 361 361 11.789672520
## 362 362 11.619947870
## 363 363 11.968260330
## 364 364 12.287926210
## 365 365 12.438133680
## 366 366 11.991890830
## 367 367 11.850686710
## 368 368 12.266225860
## 369 369 11.158031830
## 370 370 12.119979330
## 371 371 11.768732330
## 372 372 11.128035780
## 373 373 10.866032660
## 374 374 10.237577120
## 375 375 10.143207480
## 376 376 10.466890750
## 377 377 10.696259350
## 378 378 10.455341820
## 379 379 10.836525790
## 380 380 10.710435530
## 381 381 11.516800640
## 382 382 11.299625260
## 383 383 12.043572660
## 384 384 12.379342180
## 385 385 12.067343660
## 386 386 11.212162570
## 387 387 10.756170640
## 388 388 10.854462090
## 389 389 10.621930780
## 390 390 10.390524560
## 391 391 11.324020280
## 392 392 11.234358570
## 393 393 10.635055920
## 394 394 11.865072450
## 395 395 11.641720290
## 396 396 12.272688430
## 397 397 12.120513530
## 398 398 12.516345780
## 399 399 11.950560550
## 400 400 12.221187080
## 401 401 12.271820080
## 402 402 12.281446340
## 403 403 12.052704780
## 404 404 12.423381330
## 405 405 11.859326980
## 406 406 11.739126580
## 407 407 11.922910000
## 408 408 12.157616000
## 409 409 11.793468720
## 410 410 11.943077800
## 411 411 11.369536390
## 412 412 11.642931020
## 413 413 10.899650940
## 414 414 11.513580950
## 415 415 10.959126820
## 416 416 10.312317370
## 417 417 10.777737880
## 418 418 11.035818560
## 419 419 11.045436690
## 420 420 11.637358710
## 421 421 11.848177740
## 422 422 11.303171250
## 423 423 10.851964520
## 424 424 11.581852140
## 425 425 10.925164900
## 426 426 11.582423180
## 427 427 11.714175000
## 428 428 11.858709910
## 429 429 12.474353800
## 430 430 13.281813590
## 431 431 12.388850910
## 432 432 12.696662020
## 433 433 12.758915550
## 434 434 12.794365340
## 435 435 13.036264920
## 436 436 12.613890510
## 437 437 13.206182880
## 438 438 11.336464210
## 439 439 12.334940460
## 440 440 12.295265800
## 441 441 12.279808450
## 442 442 12.426009820
## 443 443 12.257762780
## 444 444 11.871919960
## 445 445 12.676184830
## 446 446 12.114283700
## 447 447 11.963381460
## 448 448 12.447432290
## 449 449 12.725119520
## 450 450 12.511633300
## 451 451 12.172348370
## 452 452 11.977717420
## 453 453 12.232453680
## 454 454 12.374109850
## 455 455 12.981959120
## 456 456 12.495769310
## 457 457 13.418552170
## 458 458 12.310697000
## 459 459 11.701793910
## 460 460 12.474609800
## 461 461 12.304473280
## 462 462 11.912324840
## 463 463 12.061821550
## 464 464 11.829172640
## 465 465 11.827164120
## 466 466 12.189553500
## 467 467 11.785372860
## 468 468 11.638848450
## 469 469 11.638964130
## 470 470 11.886422460
## 471 471 11.854884620
## 472 472 11.846090150
## 473 473 11.748621670
## 474 474 11.878114090
## 475 475 12.201984350
## 476 476 11.459120150
## 477 477 12.349537650
## 478 478 11.870791890
## 479 479 12.420810870
## 480 480 12.852185920
## 481 481 12.794601210
## 482 482 13.626088980
## 483 483 13.227687060
## 484 484 13.670488930
## 485 485 13.020400720
## 486 486 14.028559630
## 487 487 13.703735580
## 488 488 13.141411660
## 489 489 14.584391350
## 490 490 12.998601490
## 491 491 13.942330270
## 492 492 13.358833360
## 493 493 13.145836760
## 494 494 13.141945390
## 495 495 13.782884810
## 496 496 13.247101400
## 497 497 12.917917950
## 498 498 13.081708230
## 499 499 12.568040830
## 500 500 12.746942610
## 501 501 12.352843670
## 502 502 12.980904830
## 503 503 12.909133530
## 504 504 12.592062300
## 505 505 12.535047850
## 506 506 12.856745120
## 507 507 12.267609490
## 508 508 11.986615480
## 509 509 12.524120420
## 510 510 12.667453990
## 511 511 12.256482140
## 512 512 11.910791430
## 513 513 11.783974330
## 514 514 11.921274570
## 515 515 12.158925000
## 516 516 11.810574680
## 517 517 11.889752260
## 518 518 11.698254610
## 519 519 12.171675020
## 520 520 11.820527510
## 521 521 11.153478850
## 522 522 11.237177090
## 523 523 11.151074110
## 524 524 11.080645130
## 525 525 11.641384630
## 526 526 11.642444690
## 527 527 11.377260130
## 528 528 12.706181170
## 529 529 12.650997240
## 530 530 12.690308400
## 531 531 13.027869150
## 532 532 12.801782340
## 533 533 13.422653580
## 534 534 12.807276650
## 535 535 12.805677030
## 536 536 11.923658810
## 537 537 12.490312060
## 538 538 12.713899210
## 539 539 12.534822730
## 540 540 13.437231760
## 541 541 13.638007340
## 542 542 12.958511210
## 543 543 13.002093540
## 544 544 12.194534380
## 545 545 12.656581970
## 546 546 12.267253630
## 547 547 12.465385580
## 548 548 11.529446280
## 549 549 11.917409430
## 550 550 11.382198860
## 551 551 11.266267670
## 552 552 11.768287490
## 553 553 11.875387440
## 554 554 12.587306850
## 555 555 12.396291380
## 556 556 12.802828870
## 557 557 12.243856540
## 558 558 12.670309020
## 559 559 13.312197960
## 560 560 13.316038260
## 561 561 13.046271030
## 562 562 12.751325670
## 563 563 12.786867860
## 564 564 13.444389840
## 565 565 13.731782440
## 566 566 13.108763410
## 567 567 14.050925710
## 568 568 13.782693380
## 569 569 14.174502120
## 570 570 14.569676410
## 571 571 13.670985920
## 572 572 13.989106170
## 573 573 14.240293350
## 574 574 13.934752050
## 575 575 14.024697160
## 576 576 14.418398010
## 577 577 13.535650100
## 578 578 13.668491780
## 579 579 13.600882120
## 580 580 13.938919580
## 581 581 14.052183560
## 582 582 13.520478370
## 583 583 13.082642990
## 584 584 13.504885750
## 585 585 13.684825910
## 586 586 13.152903190
## 587 587 13.310290280
## 588 588 12.665600820
## 589 589 13.660657690
## 590 590 13.221882210
## 591 591 13.667266950
## 592 592 13.902720620
## 593 593 13.081609730
## 594 594 14.041969430
## 595 595 14.313228060
## 596 596 15.113707080
## 597 597 14.559375270
## 598 598 14.471910870
## 599 599 14.007738340
## 600 600 14.387439990
## 601 601 14.488401670
## 602 602 14.651650770
## 603 603 14.514572250
## 604 604 14.922248780
## 605 605 14.194652120
## 606 606 14.113792700
## 607 607 13.644364820
## 608 608 14.570065970
## 609 609 13.709527290
## 610 610 14.010553500
## 611 611 14.424843550
## 612 612 13.710719690
## 613 613 13.305902940
## 614 614 13.701842620
## 615 615 13.493932300
## 616 616 13.603215360
## 617 617 12.709116000
## 618 618 12.565781730
## 619 619 12.292045110
## 620 620 12.493722940
## 621 621 12.224760140
## 622 622 12.378837360
## 623 623 11.863188220
## 624 624 11.959176610
## 625 625 11.613640400
## 626 626 10.922316130
## 627 627 10.693817060
## 628 628  9.796640702
## 629 629 10.024550820
## 630 630 10.251294180
## 631 631 10.168377210
## 632 632 10.129223940
## 633 633 10.038176460
## 634 634  9.946258256
## 635 635  9.819163247
## 636 636 10.966138070
## 637 637 10.278450190
## 638 638 10.872164550
## 639 639 10.582982210
## 640 640 10.505170100
## 641 641 10.584896950
## 642 642 10.310465830
## 643 643 10.186559920
## 644 644 10.635669810
## 645 645 10.586234850
## 646 646 10.494701460
## 647 647 10.530127820
## 648 648 11.669728400
## 649 649 10.939105660
## 650 650 11.250433490
## 651 651 11.100824390
## 652 652 11.561937980
## 653 653 12.001359440
## 654 654 11.963643700
## 655 655 12.676517160
## 656 656 12.595891180
## 657 657 13.503725380
## 658 658 12.524809660
## 659 659 13.586171030
## 660 660 13.651520940
## 661 661 13.507473490
## 662 662 13.600322600
## 663 663 12.911725750
## 664 664 13.129421530
## 665 665 12.887471540
## 666 666 12.570043730
## 667 667 12.389216090
## 668 668 12.523036130
## 669 669 12.786987650
## 670 670 12.900532840
## 671 671 13.724205840
## 672 672 13.539276920
## 673 673 12.961442010
## 674 674 12.601902220
## 675 675 13.194033820
## 676 676 13.024946030
## 677 677 11.959784350
## 678 678 13.048563330
## 679 679 12.092738470
## 680 680 12.748805650
## 681 681 12.151948170
## 682 682 13.688017580
## 683 683 12.681747280
## 684 684 13.250070710
## 685 685 12.522334210
## 686 686 12.877971760
## 687 687 12.747609060
## 688 688 13.959469050
## 689 689 12.957349480
## 690 690 14.357570100
## 691 691 14.313675330
## 692 692 14.441750200
## 693 693 14.896644470
## 694 694 15.495969540
## 695 695 15.121205360
## 696 696 15.814724790
## 697 697 14.951802430
## 698 698 15.692242060
## 699 699 15.322562730
## 700 700 15.481488980
## 701 701 15.077929900
## 702 702 15.269828820
## 703 703 15.563934860
## 704 704 15.709683550
## 705 705 16.270576130
## 706 706 15.864648010
## 707 707 16.791980880
## 708 708 16.446697680
## 709 709 15.576833140
## 710 710 16.517374880
## 711 711 16.792900340
## 712 712 16.692964830
## 713 713 17.152341380
## 714 714 17.903188990
## 715 715 17.471066730
## 716 716 17.145850130
## 717 717 17.948834030
## 718 718 18.154769090
## 719 719 17.768817030
## 720 720 17.250846320
## 721 721 17.952277840
## 722 722 17.255934220
## 723 723 17.583626510
## 724 724 16.821758070
## 725 725 17.459056140
## 726 726 16.761278250
## 727 727 16.931558660
## 728 728 17.490666180
## 729 729 16.803637980
## 730 730 16.194813500
## 731 731 16.620798500

I made sure I installed the packages I would need and added their libraries.

library(astsa)
library(ggplot2)
library(forecast)
## Registered S3 method overwritten by 'quantmod':
##   method            from
##   as.zoo.data.frame zoo
## 
## Attaching package: 'forecast'
## The following object is masked from 'package:astsa':
## 
##     gas

I ran an auto correlation function on the revenue column using, acf(). This was to see how the data was correlated. I wanted to get the measure of the correlation for different lags.

acf(time_series_data$Revenue, plot = FALSE)
## 
## Autocorrelations of series 'time_series_data$Revenue', by lag
## 
##     0     1     2     3     4     5     6     7     8     9    10    11    12 
## 1.000 0.984 0.977 0.966 0.955 0.945 0.935 0.924 0.913 0.901 0.890 0.878 0.868 
##    13    14    15    16    17    18    19    20    21    22    23    24    25 
## 0.857 0.846 0.834 0.824 0.813 0.803 0.792 0.784 0.775 0.766 0.760 0.751 0.743 
##    26    27    28 
## 0.735 0.727 0.721

The 1st lag has a correlation of .984 and the 28th lag in the series has a correlation of .721. This high correlation through 28 lags indicates the data has high predictability.

Next, I printed the first 10 observations and a plot of all of the observations.

head(time_series_data, 10)
##    Day     Revenue
## 1    1 0.000000000
## 2    2 0.000793191
## 3    3 0.825541786
## 4    4 0.320332280
## 5    5 1.082554085
## 6    6 0.107653784
## 7    7 0.493901361
## 8    8 0.376698452
## 9    9 0.304074848
## 10  10 0.591747849
plot(time_series_data, xlab = "Time Series Analysis", ylab = "Revenue (Millions)")

When the data was imported into R, there was a third column added that represented each row numbers. I wanted keep the original two column data set for the analysis.To do that when I converted it to a time series, I only used the “Revenue” column. This gave me two columns, the first is the row number, the second the Revenue column. The integrity of the original data set remained because the number for the rows matched the days in the time sequence of the data set. I used the ts() function with the as.numeric() function to convert time_series_data to time_series that started at 0 because that is the revenue reported in the first year.

time_series <- ts(as.numeric(time_series_data$Revenue), start = 0)
summary(time_series)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##   0.000   6.873  10.786   9.823  12.567  18.155

Next, I ran a quick analysis of the this new data set. I printed the length of the series, the first and last few observations and a plot with labels.

length(time_series)
## [1] 731
head(time_series)
## Time Series:
## Start = 0 
## End = 5 
## Frequency = 1 
## [1] 0.000000000 0.000793191 0.825541786 0.320332280 1.082554085 0.107653784
tail(time_series)
## Time Series:
## Start = 725 
## End = 730 
## Frequency = 1 
## [1] 16.76128 16.93156 17.49067 16.80364 16.19481 16.62080
ts.plot(time_series, xlab = "Days", ylab = "Revenue (Millions)", main = "Telecom Revenue (Years 1&2)")

Next, is an analysis of the data to evaluate the stationarity of the data set. I used the auto correlate function with lags out to 700, the number of observations. I plotted the time_series using the acf() function, acf(time_series, lag = 700, plot =TRUE) and acf(time_series, lag=150, plot=TRUE).

acf(time_series, lag = 700, plot =TRUE)

acf(time_series, lag = 150, plot = TRUE)

These two plots show the correlation tailing off with an increase in number of lags observed. Overall, the predictability will be high because 1 lag is .984 and 50 lags the correlation is still at .599. The correlation reduces to zero, this reduction means the time series is not stationary.

To determine the best model to use I need to test if the time series is Auto regressive or Moving average. AR and MA respectively. To do that I used the acf2() function to see what the data does when plugged into ACF and PACF graphs.Because there is a trend I will use diff(time_series) to eliminate it. I only needed to difference once because there is no seasonality.

acf2(diff(time_series))

##       [,1] [,2]  [,3] [,4]  [,5] [,6] [,7] [,8]  [,9] [,10] [,11] [,12] [,13]
## ACF  -0.47 0.22 -0.08 0.05 -0.03 0.03 0.00 0.02 -0.03  0.02 -0.03  0.01 -0.02
## PACF -0.47 0.00  0.04 0.03 -0.01 0.01 0.03 0.04 -0.02 -0.01 -0.02 -0.01 -0.02
##      [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25]
## ACF   0.02 -0.01  0.02 -0.06  0.04 -0.05 -0.02  0.07 -0.13  0.10 -0.05  0.03
## PACF  0.01  0.01  0.02 -0.06 -0.03 -0.03 -0.07  0.05 -0.09 -0.01  0.02  0.02
##      [,26] [,27] [,28] [,29] [,30] [,31] [,32] [,33] [,34] [,35] [,36] [,37]
## ACF  -0.02 -0.01 -0.01  0.00 -0.03  0.01  0.00 -0.02  0.01  0.01  0.05  0.00
## PACF  0.01 -0.02 -0.04 -0.02 -0.04 -0.02  0.01 -0.02 -0.01  0.01  0.08  0.06
##      [,38]
## ACF  -0.03
## PACF -0.03

The ACF and PACF both cut off at 1, so I will use the ARIMA model, sarima(time_series, 1, 1, 1).

sarima(time_series, 1 , 1, 1)
## initial  value -0.624543 
## iter   2 value -0.697696
## iter   3 value -0.740976
## iter   4 value -0.744623
## iter   5 value -0.746188
## iter   6 value -0.749141
## iter   7 value -0.749172
## iter   8 value -0.749175
## iter   8 value -0.749175
## final  value -0.749175 
## converged
## initial  value -0.749687 
## iter   2 value -0.749687
## iter   3 value -0.749687
## iter   4 value -0.749687
## iter   5 value -0.749688
## iter   5 value -0.749688
## iter   5 value -0.749688
## final  value -0.749688 
## converged

## $fit
## 
## Call:
## arima(x = xdata, order = c(p, d, q), seasonal = list(order = c(P, D, Q), period = S), 
##     xreg = constant, transform.pars = trans, fixed = fixed, optim.control = list(trace = trc, 
##         REPORT = 1, reltol = tol))
## 
## Coefficients:
##           ar1     ma1  constant
##       -0.4764  0.0091    0.0226
## s.e.   0.0655  0.0731    0.0120
## 
## sigma^2 estimated as 0.2232:  log likelihood = -488.55,  aic = 985.11
## 
## $degrees_of_freedom
## [1] 727
## 
## $ttable
##          Estimate     SE t.value p.value
## ar1       -0.4764 0.0655 -7.2763  0.0000
## ma1        0.0091 0.0731  0.1248  0.9007
## constant   0.0226 0.0120  1.8917  0.0589
## 
## $AIC
## [1] 1.349461
## 
## $AICc
## [1] 1.349506
## 
## $BIC
## [1] 1.374628

What this model shows is AR(1), I(1), and MA(1). To test if this is the best model I added some parameters to see if over-fitting would change the numbers much.

sarima(time_series, 2, 1, 1)
## initial  value -0.625397 
## iter   2 value -0.640302
## iter   3 value -0.741117
## iter   4 value -0.747411
## iter   5 value -0.750320
## iter   6 value -0.750321
## iter   7 value -0.750321
## iter   8 value -0.750322
## iter   9 value -0.750322
## iter  10 value -0.750323
## iter  11 value -0.750324
## iter  12 value -0.750324
## iter  13 value -0.750325
## iter  14 value -0.750325
## iter  15 value -0.750328
## iter  16 value -0.750335
## iter  17 value -0.750349
## iter  18 value -0.750414
## iter  19 value -0.750415
## iter  20 value -0.750431
## iter  21 value -0.750433
## iter  22 value -0.750433
## iter  23 value -0.750434
## iter  24 value -0.750435
## iter  25 value -0.750437
## iter  26 value -0.750446
## iter  27 value -0.750475
## iter  28 value -0.750490
## iter  29 value -0.750519
## iter  30 value -0.750526
## iter  31 value -0.750527
## iter  32 value -0.750528
## iter  33 value -0.750531
## iter  34 value -0.750540
## iter  35 value -0.750566
## iter  36 value -0.750646
## iter  37 value -0.750777
## iter  38 value -0.750823
## iter  39 value -0.750845
## iter  40 value -0.750848
## iter  41 value -0.750851
## iter  42 value -0.750860
## iter  43 value -0.750883
## iter  44 value -0.750940
## iter  45 value -0.751018
## iter  46 value -0.751083
## iter  47 value -0.751150
## iter  48 value -0.751169
## iter  49 value -0.751173
## iter  50 value -0.751174
## iter  51 value -0.751178
## iter  52 value -0.751181
## iter  53 value -0.751184
## iter  54 value -0.751184
## iter  55 value -0.751184
## iter  56 value -0.751184
## iter  56 value -0.751184
## iter  56 value -0.751184
## final  value -0.751184 
## converged
## initial  value -0.749674 
## iter   2 value -0.749679
## iter   3 value -0.749682
## iter   4 value -0.749682
## iter   5 value -0.749682
## iter   5 value -0.749682
## iter   5 value -0.749682
## final  value -0.749682 
## converged

## $fit
## 
## Call:
## arima(x = xdata, order = c(p, d, q), seasonal = list(order = c(P, D, Q), period = S), 
##     xreg = constant, transform.pars = trans, fixed = fixed, optim.control = list(trace = trc, 
##         REPORT = 1, reltol = tol))
## 
## Coefficients:
##           ar1      ar2     ma1  constant
##       -1.0735  -0.2856  0.6030    0.0226
## s.e.   3.5140   1.5932  3.5448    0.0119
## 
## sigma^2 estimated as 0.2232:  log likelihood = -488.56,  aic = 987.11
## 
## $degrees_of_freedom
## [1] 726
## 
## $ttable
##          Estimate     SE t.value p.value
## ar1       -1.0735 3.5140 -0.3055  0.7601
## ar2       -0.2856 1.5932 -0.1792  0.8578
## ma1        0.6030 3.5448  0.1701  0.8650
## constant   0.0226 0.0119  1.9014  0.0576
## 
## $AIC
## [1] 1.352211
## 
## $AICc
## [1] 1.352287
## 
## $BIC
## [1] 1.38367
sarima(time_series, 1, 1, 2)
## initial  value -0.624543 
## iter   2 value -0.648734
## iter   3 value -0.745837
## iter   4 value -0.749127
## iter   5 value -0.750035
## iter   6 value -0.750042
## iter   7 value -0.750071
## iter   8 value -0.750109
## iter   9 value -0.750148
## iter  10 value -0.750166
## iter  11 value -0.750168
## iter  12 value -0.750169
## iter  13 value -0.750169
## iter  14 value -0.750170
## iter  14 value -0.750170
## iter  14 value -0.750170
## final  value -0.750170 
## converged
## initial  value -0.750700 
## iter   2 value -0.750700
## iter   3 value -0.750700
## iter   3 value -0.750700
## iter   3 value -0.750700
## final  value -0.750700 
## converged

## $fit
## 
## Call:
## arima(x = xdata, order = c(p, d, q), seasonal = list(order = c(P, D, Q), period = S), 
##     xreg = constant, transform.pars = trans, fixed = fixed, optim.control = list(trace = trc, 
##         REPORT = 1, reltol = tol))
## 
## Coefficients:
##           ar1      ma1     ma2  constant
##       -0.2982  -0.1708  0.1033    0.0226
## s.e.   0.1675   0.1687  0.0814    0.0126
## 
## sigma^2 estimated as 0.2227:  log likelihood = -487.81,  aic = 985.63
## 
## $degrees_of_freedom
## [1] 726
## 
## $ttable
##          Estimate     SE t.value p.value
## ar1       -0.2982 0.1675 -1.7799  0.0755
## ma1       -0.1708 0.1687 -1.0123  0.3117
## ma2        0.1033 0.0814  1.2700  0.2045
## constant   0.0226 0.0126  1.7978  0.0726
## 
## $AIC
## [1] 1.350175
## 
## $AICc
## [1] 1.350251
## 
## $BIC
## [1] 1.381635

There are no significant changes so the model fits.

Next I will use the model to forecast. Since my units of time are days I am going to forecast with a day count. I am going to forecast out one year. This gives the stakeholder some indication of potential revenue for the next year so they can plan accordingly. Also it’s not too far out that poor expectations are set should the company have bad month or quarter during the coming year.

sarima.for(time_series, n.ahead = 365, 1, 1, 1)

## $pred
## Time Series:
## Start = 731 
## End = 1095 
## Frequency = 1 
##   [1] 16.45229 16.56595 16.54521 16.58848 16.60126 16.62857 16.64896 16.67264
##   [9] 16.69475 16.71761 16.74012 16.76279 16.78539 16.80802 16.83063 16.85326
##  [17] 16.87587 16.89850 16.92111 16.94373 16.96635 16.98897 17.01159 17.03421
##  [25] 17.05683 17.07945 17.10207 17.12469 17.14731 17.16993 17.19255 17.21517
##  [33] 17.23779 17.26041 17.28303 17.30565 17.32827 17.35089 17.37351 17.39613
##  [41] 17.41875 17.44137 17.46399 17.48661 17.50923 17.53185 17.55447 17.57709
##  [49] 17.59971 17.62233 17.64495 17.66757 17.69019 17.71281 17.73543 17.75805
##  [57] 17.78067 17.80329 17.82591 17.84853 17.87115 17.89377 17.91639 17.93900
##  [65] 17.96162 17.98424 18.00686 18.02948 18.05210 18.07472 18.09734 18.11996
##  [73] 18.14258 18.16520 18.18782 18.21044 18.23306 18.25568 18.27830 18.30092
##  [81] 18.32354 18.34616 18.36878 18.39140 18.41402 18.43664 18.45926 18.48188
##  [89] 18.50450 18.52712 18.54974 18.57236 18.59498 18.61760 18.64022 18.66284
##  [97] 18.68546 18.70808 18.73070 18.75332 18.77594 18.79856 18.82118 18.84380
## [105] 18.86642 18.88904 18.91166 18.93427 18.95689 18.97951 19.00213 19.02475
## [113] 19.04737 19.06999 19.09261 19.11523 19.13785 19.16047 19.18309 19.20571
## [121] 19.22833 19.25095 19.27357 19.29619 19.31881 19.34143 19.36405 19.38667
## [129] 19.40929 19.43191 19.45453 19.47715 19.49977 19.52239 19.54501 19.56763
## [137] 19.59025 19.61287 19.63549 19.65811 19.68073 19.70335 19.72597 19.74859
## [145] 19.77121 19.79383 19.81645 19.83907 19.86169 19.88431 19.90693 19.92954
## [153] 19.95216 19.97478 19.99740 20.02002 20.04264 20.06526 20.08788 20.11050
## [161] 20.13312 20.15574 20.17836 20.20098 20.22360 20.24622 20.26884 20.29146
## [169] 20.31408 20.33670 20.35932 20.38194 20.40456 20.42718 20.44980 20.47242
## [177] 20.49504 20.51766 20.54028 20.56290 20.58552 20.60814 20.63076 20.65338
## [185] 20.67600 20.69862 20.72124 20.74386 20.76648 20.78910 20.81172 20.83434
## [193] 20.85696 20.87958 20.90220 20.92482 20.94743 20.97005 20.99267 21.01529
## [201] 21.03791 21.06053 21.08315 21.10577 21.12839 21.15101 21.17363 21.19625
## [209] 21.21887 21.24149 21.26411 21.28673 21.30935 21.33197 21.35459 21.37721
## [217] 21.39983 21.42245 21.44507 21.46769 21.49031 21.51293 21.53555 21.55817
## [225] 21.58079 21.60341 21.62603 21.64865 21.67127 21.69389 21.71651 21.73913
## [233] 21.76175 21.78437 21.80699 21.82961 21.85223 21.87485 21.89747 21.92009
## [241] 21.94270 21.96532 21.98794 22.01056 22.03318 22.05580 22.07842 22.10104
## [249] 22.12366 22.14628 22.16890 22.19152 22.21414 22.23676 22.25938 22.28200
## [257] 22.30462 22.32724 22.34986 22.37248 22.39510 22.41772 22.44034 22.46296
## [265] 22.48558 22.50820 22.53082 22.55344 22.57606 22.59868 22.62130 22.64392
## [273] 22.66654 22.68916 22.71178 22.73440 22.75702 22.77964 22.80226 22.82488
## [281] 22.84750 22.87012 22.89274 22.91536 22.93797 22.96059 22.98321 23.00583
## [289] 23.02845 23.05107 23.07369 23.09631 23.11893 23.14155 23.16417 23.18679
## [297] 23.20941 23.23203 23.25465 23.27727 23.29989 23.32251 23.34513 23.36775
## [305] 23.39037 23.41299 23.43561 23.45823 23.48085 23.50347 23.52609 23.54871
## [313] 23.57133 23.59395 23.61657 23.63919 23.66181 23.68443 23.70705 23.72967
## [321] 23.75229 23.77491 23.79753 23.82015 23.84277 23.86539 23.88801 23.91063
## [329] 23.93325 23.95586 23.97848 24.00110 24.02372 24.04634 24.06896 24.09158
## [337] 24.11420 24.13682 24.15944 24.18206 24.20468 24.22730 24.24992 24.27254
## [345] 24.29516 24.31778 24.34040 24.36302 24.38564 24.40826 24.43088 24.45350
## [353] 24.47612 24.49874 24.52136 24.54398 24.56660 24.58922 24.61184 24.63446
## [361] 24.65708 24.67970 24.70232 24.72494 24.74756
## 
## $se
## Time Series:
## Start = 731 
## End = 1095 
## Frequency = 1 
##   [1] 0.4724336 0.5353010 0.6433411 0.7127343 0.7856844 0.8480705 0.9080933
##   [8] 0.9635224 1.0163219 1.0663334 1.1141829 1.1600235 1.2041372 1.2466831
##  [15] 1.2878277 1.3276963 1.3664028 1.4040424 1.4406991 1.4764458 1.5113474
##  [22] 1.5454610 1.5788376 1.6115231 1.6435588 1.6749818 1.7058261 1.7361225
##  [29] 1.7658992 1.7951820 1.8239948 1.8523595 1.8802963 1.9078241 1.9349604
##  [36] 1.9617212 1.9881219 2.0141766 2.0398985 2.0653001 2.0903931 2.1151884
##  [43] 2.1396964 2.1639268 2.1878889 2.2115914 2.2350425 2.2582501 2.2812216
##  [50] 2.3039641 2.3264843 2.3487886 2.3708831 2.3927735 2.4144655 2.4359644
##  [57] 2.4572751 2.4784027 2.4993516 2.5201264 2.5407313 2.5611705 2.5814478
##  [64] 2.6015671 2.6215320 2.6413460 2.6610124 2.6805346 2.6999156 2.7191585
##  [71] 2.7382662 2.7572414 2.7760870 2.7948055 2.8133994 2.8318712 2.8502234
##  [78] 2.8684581 2.8865777 2.9045842 2.9224797 2.9402664 2.9579461 2.9755207
##  [85] 2.9929922 3.0103623 3.0276327 3.0448051 3.0618812 3.0788627 3.0957510
##  [92] 3.1125476 3.1292541 3.1458719 3.1624023 3.1788468 3.1952067 3.2114832
##  [99] 3.2276776 3.2437912 3.2598252 3.2757806 3.2916588 3.3074607 3.3231874
## [106] 3.3388401 3.3544197 3.3699274 3.3853639 3.4007305 3.4160279 3.4312570
## [113] 3.4464189 3.4615144 3.4765444 3.4915096 3.5064110 3.5212493 3.5360253
## [120] 3.5507399 3.5653937 3.5799876 3.5945222 3.6089982 3.6234165 3.6377775
## [127] 3.6520822 3.6663310 3.6805246 3.6946637 3.7087489 3.7227808 3.7367601
## [134] 3.7506872 3.7645628 3.7783874 3.7921617 3.8058861 3.8195612 3.8331875
## [141] 3.8467655 3.8602958 3.8737788 3.8872150 3.9006050 3.9139491 3.9272479
## [148] 3.9405019 3.9537114 3.9668769 3.9799989 3.9930777 4.0061138 4.0191077
## [155] 4.0320597 4.0449702 4.0578396 4.0706684 4.0834568 4.0962054 4.1089143
## [162] 4.1215841 4.1342151 4.1468075 4.1593619 4.1718785 4.1843576 4.1967997
## [169] 4.2092049 4.2215737 4.2339064 4.2462032 4.2584646 4.2706907 4.2828819
## [176] 4.2950386 4.3071609 4.3192492 4.3313037 4.3433248 4.3553128 4.3672678
## [183] 4.3791902 4.3910802 4.4029381 4.4147641 4.4265586 4.4383217 4.4500537
## [190] 4.4617549 4.4734255 4.4850657 4.4966757 4.5082559 4.5198064 4.5313275
## [197] 4.5428193 4.5542821 4.5657162 4.5771217 4.5884988 4.5998478 4.6111689
## [204] 4.6224623 4.6337281 4.6449666 4.6561780 4.6673624 4.6785201 4.6896513
## [211] 4.7007561 4.7118347 4.7228874 4.7339142 4.7449154 4.7558912 4.7668417
## [218] 4.7777671 4.7886675 4.7995432 4.8103944 4.8212211 4.8320235 4.8428018
## [225] 4.8535563 4.8642869 4.8749939 4.8856775 4.8963377 4.9069748 4.9175888
## [232] 4.9281801 4.9387486 4.9492945 4.9598180 4.9703192 4.9807983 4.9912554
## [239] 5.0016906 5.0121041 5.0224960 5.0328665 5.0432156 5.0535435 5.0638504
## [246] 5.0741363 5.0844014 5.0946459 5.1048697 5.1150732 5.1252563 5.1354193
## [253] 5.1455621 5.1556850 5.1657881 5.1758715 5.1859352 5.1959795 5.2060043
## [260] 5.2160100 5.2259964 5.2359638 5.2459123 5.2558419 5.2657528 5.2756451
## [267] 5.2855189 5.2953743 5.3052113 5.3150302 5.3248309 5.3346137 5.3443785
## [274] 5.3541256 5.3638549 5.3735666 5.3832607 5.3929375 5.4025969 5.4122391
## [281] 5.4218641 5.4314721 5.4410631 5.4506373 5.4601946 5.4697353 5.4792593
## [288] 5.4887668 5.4982579 5.5077326 5.5171910 5.5266333 5.5360594 5.5454696
## [295] 5.5548638 5.5642421 5.5736046 5.5829515 5.5922827 5.6015984 5.6108986
## [302] 5.6201834 5.6294529 5.6387072 5.6479463 5.6571703 5.6663793 5.6755734
## [309] 5.6847526 5.6939170 5.7030666 5.7122017 5.7213221 5.7304280 5.7395195
## [316] 5.7485965 5.7576593 5.7667079 5.7757422 5.7847625 5.7937687 5.8027609
## [323] 5.8117392 5.8207037 5.8296543 5.8385913 5.8475146 5.8564243 5.8653205
## [330] 5.8742032 5.8830725 5.8919284 5.9007710 5.9096004 5.9184167 5.9272198
## [337] 5.9360099 5.9447869 5.9535511 5.9623023 5.9710407 5.9797664 5.9884793
## [344] 5.9971796 6.0058673 6.0145424 6.0232051 6.0318553 6.0404931 6.0491185
## [351] 6.0577317 6.0663327 6.0749215 6.0834981 6.0920627 6.1006153 6.1091559
## [358] 6.1176845 6.1262013 6.1347063 6.1431995 6.1516810 6.1601507 6.1686089
## [365] 6.1770555