Skip to content

Instantly share code, notes, and snippets.

@nburger
Created April 26, 2013 21:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nburger/5470646 to your computer and use it in GitHub Desktop.
Save nburger/5470646 to your computer and use it in GitHub Desktop.
v <- c(2560, 6480, 10220, 12680, 16820, 18100, 19940, 20280, 20460, 21020, 21760, 25980, 26360, 29160, 26620, 25420, 19040, 16080, 7821, 4160, 3060, 2640, 2500, 2420, 3020, 5960, 10980, 10920, 14605, 14590, 15380, 17260, 17480, 17760, 21700, 23580, 26000, 27400, 27800, 25100, 17360, 11240, 7840, 4060, 3000, 2580, 2300, 1660, 2560, 5020, 8220, 9300, 13405, 14380, 14680, 12800, 15300, 16021, 23522, 24540, 24640, 31682, 30780, 25420, 17740, 14100, 7540, 4860, 3080, 2940, 2340, 2200, 3140, 6940, 8540, 10020, 13580, 12980, 14924, 17360, 17460, 20000, 22080, 27580, 28600, 28800, 29180, 24200, 17760, 14160, 8280, 5740, 4800, 3500, 2260, 2740, 3660, 7680, 9800, 12820, 14160, 16640, 14540, 16140, 19700, 21520, 26340, 19240, 23900, 27560, 30100, 25620, 22800, 18125, 14180, 8200, 5240, 3080, 2660, 2240, 4000, 8540, 14860, 20980, 26260, 29800, 27580, 28120, 29480, 28540, 28200, 27120, 28460, 28582, 29140, 28740, 25000, 20500, 12260, 8060, 5340, 3220, 3140, 2980, 4020, 7660, 15540, 19560, 24420, 23160, 25160, 23860, 24940, 23060, 26960, 26560, 26440, 24860, 25665, 22305, 17320, 11060, 6940, 3420, 3220, 1860, 1540, 1500, 2640, 4820, 6000, 6900, 8000, 8200, 9561, 10921, 11220, 13780, 17420, 22680, 23320, 26020, 26180, 20420, 18020, 10380, 5640, 3440, 2500, 2540, 2340, 1720, 3400, 5280, 8200, 8260, 9580, 11280, 10900, 11820, 11440, 15320, 20820, 24160, 22980, 26840, 30020, 24080, 17740, 11085, 5460, 3740, 2480, 2240, 2040, 1680, 3000, 6900, 7780, 7925, 9460, 9360, 10100, 11020, 13640, 16440, 19520, 24320, 29480, 26940, 28960, 25020, 17540, 11900, 8180, 3500, 2800, 2680, 1640, 1760, 3620, 6980, 7140, 8740, 10540, 11040, 10240, 11480, 12100, 14700, 21963, 25820, 29160, 28960, 29080, 22660, 15740, 11560, 7680, 4600, 2380, 2020, 1960, 1340, 3340, 6860, 8160, 9980, 11780, 11540, 10600, 10920, 14660, 16640, 22680, 30700, 30540, 31960, 30340, 29560, 27460, 19200, 10880, 8480, 4980, 5040, 3580, 2780, 3980, 8420, 16980, 24720, 23460, 26360, 30740, 26720, 26860, 27120, 28880, 26980, 24600, 28860, 23080, 20340, 16400, 17120, 9040, 7920, 5380, 3320, 3360, 1800, 3140, 6900, 12600, 16900, 25220, 26800, 26940, 27740, 24320, 26980, 30300, 27560, 28560, 27360, 21780, 17980, 13200, 9180, 6560, 2820, 2180, 1560, 1660, 1440, 2860, 4620, 6080, 7020, 11080, 10582, 11620, 11360, 11460, 13840, 18540, 23020, 24340, 24400, 21640, 14300, 11440, 6440, 5640, 3620, 2480, 1980, 1540, 1180, 3260, 7280, 7460, 7480, 10620, 10180, 11060, 11220, 12920, 15640, 20580, 22480, 26460, 28120, 29480, 21900, 15720, 11060, 5900, 3280, 3600, 2100, 1260, 1480, 3220, 6900, 7400, 8680, 9220, 8500, 10460, 12001, 13340, 14740, 19860, 25900, 29560, 30400, 27480, 24860, 17060, 13020, 6160, 3360, 3060, 2980, 2240, 2660, 3300, 6080, 8020, 8680, 10380, 10880, 11340, 10760, 12880, 14820, 18860, 22560, 25340, 30220, 28380, 24520, 17180, 12360, 6220, 3300, 2340, 2240, 1600, 1840, 2920, 7800, 8560, 10160, 12540, 12060, 12160, 14140, 13880, 19120, 23280, 30940, 30260, 30360, 31720, 31740, 25420, 18140, 12520, 7320, 3680, 3640, 2660, 2520, 3240, 9820, 17080, 22500, 28980, 31800, 34220, 30640, 30540, 27480, 30440, 29560, 28140, 31720, 31160, 30220, 23620, 18140, 11820, 7700, 5820, 3600, 2540, 3000, 3380, 7880, 14060, 20960, 17080, 15420, 14960, 16640, 15860, 22960, 25540, 28140, 29080, 28440, 26200, 23840, 15260, 11740, 5380, 3500, 2640, 2440, 1840, 1680, 2420)
vts <- ts(v, frequency=168)
fit <- HoltWinters(vts)
library(forecast)
fitfor <- forecast.HoltWinters(fit, h=168)
png(filename="/tmp/figure.png", height=250, width=800, bg="white")
plot(fitfor, main="Predicting prop|cn traffic")
dev.off()
quit()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment