R version 2.15.2 (2012-10-26) -- "Trick or Treat" Copyright (C) 2012 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i686-pc-linux-gnu (32-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > x <- c(15086 + ,20559 + ,39383 + ,68032 + ,42346 + ,40184 + ,29183 + ,18049 + ,24377 + ,48033 + ,61410 + ,40637 + ,37914 + ,22481 + ,17061 + ,21921 + ,34043 + ,36152 + ,38929 + ,36713 + ,27928 + ,14178 + ,19331 + ,35030 + ,37834 + ,45257 + ,39650 + ,33001 + ,22268 + ,34283 + ,63733 + ,54548 + ,31666 + ,32654 + ,28409 + ,16234 + ,19544 + ,33375 + ,30839 + ,27581 + ,28596 + ,28542 + ,14285 + ,20799 + ,28729 + ,30278 + ,31266 + ,38341 + ,24938 + ,15700 + ,17382 + ,34229 + ,29584 + ,33909 + ,29397 + ,24644 + ,14124 + ,18770 + ,32681 + ,30518 + ,34310 + ,24217 + ,15806 + ,12362 + ,13751 + ,25312 + ,23549 + ,30305 + ,30411 + ,15593 + ,17382 + ,15806 + ,29183 + ,33348 + ,33589 + ,30198 + ,23469 + ,15593 + ,16474 + ,27341 + ,26673 + ,33268 + ,26406 + ,23656 + ,15086 + ,18316 + ,27528 + ,30305 + ,34550 + ,34710 + ,23843 + ,12362 + ,21200 + ,27261 + ,31586 + ,33322 + ,32814 + ,21974 + ,17115 + ,14445 + ,26673 + ,31746 + ,28249 + ,29103 + ,21974 + ,17622 + ,21066 + ,28382 + ,32147 + ,35885 + ,40824 + ,28622 + ,24297 + ,30465 + ,47927 + ,51665 + ,57058 + ,48407 + ,30011 + ,21413 + ,30518 + ,41171 + ,37487 + ,44456 + ,41465 + ,28409 + ,34870 + ,29557 + ,44936 + ,44028 + ,45310 + ,39302 + ,28516 + ,19865 + ,30091 + ,38101 + ,44402 + ,52359 + ,71182 + ,60796 + ,43735 + ,63947 + ,89071 + ,86321 + ,90967 + ,54441 + ,36339 + ,29290 + ,65842 + ,99404 + ,83865 + ,84452 + ,76309 + ,69554 + ,44616 + ,67337 + ,94144 + ,84425 + ,76763 + ,73559 + ,60956 + ,46271 + ,74066 + ,91634 + ,63947 + ,56017 + ,53293 + ,54895 + ,48781 + ,60449 + ,99965 + ,84746 + ,81088 + ,77777 + ,60315 + ,46218 + ,62985 + ,92596 + ,78525 + ,72811 + ,62318 + ,48140 + ,45443 + ,66910 + ,90032 + ,91661 + ,103516 + ,100285 + ,72384 + ,51985 + ,72224 + ,99351 + ,108616 + ,102128 + ,97669 + ,71716 + ,51584 + ,63413 + ,88137 + ,86535 + ,91955 + ,84853 + ,54388 + ,40931 + ,58900 + ,76576 + ,80447 + ,60315 + ,52012 + ,37487 + ,19972 + ,25338 + ,23549 + ,19785 + ,29637 + ,34416 + ,26914 + ,25071 + ,24003 + ,19358 + ,28783 + ,46992 + ,49796 + ,40904 + ,33722 + ,42640 + ,56097 + ,62184 + ,63039 + ,61730 + ,44349 + ,32307 + ,45123 + ,63466 + ,71903 + ,73211 + ,67845 + ,51237 + ,31506 + ,45043 + ,74386 + ,76602 + ,72704 + ,71770 + ,52225 + ,40958 + ,55856 + ,79700 + ,81889 + ,82049 + ,66643 + ,54655 + ,36739 + ,53026 + ,78098 + ,81248 + ,84372 + ,75614 + ,63012 + ,38795 + ,55670 + ,81168 + ,85787 + ,88591 + ,75401 + ,63413 + ,42907 + ,62291 + ,86241 + ,85200 + ,84559 + ,75801 + ,72304 + ,50944 + ,70034 + ,104691 + ,88404 + ,93397 + ,88030 + ,60582 + ,50890 + ,69847 + ,90166 + ,84158 + ,82503 + ,83811 + ,66296 + ,42640 + ,55563 + ,82450 + ,84799 + ,82370 + ,83384 + ,60075 + ,41091 + ,55589 + ,79513 + ,87656 + ,74760 + ,64214 + ,47019 + ,34229 + ,45150 + ,64187 + ,73879 + ,76175 + ,83785 + ,52786 + ,43681 + ,61864 + ,74573 + ,79913 + ,78765 + ,79112 + ,62718 + ,40557 + ,57058 + ,88804 + ,89205 + ,82904 + ,78445 + ,62825 + ,57832 + ,70675 + ,102795 + ,107094 + ,105625 + ,98390 + ,74360 + ,64641 + ,82423 + ,116759 + ,101941 + ,101140 + ,98790 + ,65949 + ,49635 + ,77323 + ,109203 + ,102902 + ,93637 + ,89365 + ,72250 + ,53267 + ,73238 + ,99725 + ,69100 + ,66323 + ,80447 + ,80954 + ,48194 + ,52546 + ,91821 + ,84372 + ,90994 + ,72410 + ,62745 + ,47366 + ,63947 + ,82690 + ,89712 + ,79085 + ,80527 + ,61303 + ,40691 + ,58340 + ,79166 + ,82850 + ,82076 + ,73292 + ,60823 + ,51157 + ,61410 + ,64294 + ,67658 + ,66323 + ,66563 + ,52145 + ,36980 + ,50703 + ,68112 + ,68379 + ,65735 + ,60716 + ,50463 + ,33749 + ,39436 + ,66990 + ,70541 + ,75027 + ,69233 + ,53213 + ,31186 + ,41145 + ,67604 + ,68699 + ,71690 + ,60022 + ,51718 + ,32814 + ,42400 + ,71316 + ,70141 + ,64694 + ,60636 + ,37620 + ,35431 + ,41145 + ,69393 + ,72891 + ,62638 + ,63439 + ,54014 + ,37567 + ,38875 + ,64854 + ,75214 + ,72944 + ,71796 + ,60689 + ,53000 + ,50757 + ,71289 + ,75080 + ,77377 + ,68779 + ,49155 + ,30678 + ,49342 + ,67604 + ,63733 + ,71209 + ,59461 + ,49609 + ,30839 + ,39302 + ,67685 + ,67925 + ,66056 + ,60743 + ,49422 + ,30972 + ,34924 + ,56818 + ,62024 + ,59274 + ,59007 + ,43494 + ,26486 + ,41252 + ,63146 + ,70114 + ,57779 + ,61944 + ,48728 + ,32708 + ,40237 + ,67845 + ,68913 + ,66697 + ,68272 + ,51317 + ,30812 + ,37300 + ,63599 + ,72918 + ,74386 + ,73292 + ,56577 + ,41652 + ,58900 + ,86188 + ,88350 + ,85787 + ,86535 + ,67978 + ,42720 + ,64187 + ,98897 + ,108429 + ,92249 + ,111820 + ,77163 + ,59648 + ,83651 + ,103569 + ,108749 + ,96948 + ,90113 + ,75614 + ,52733 + ,78178 + ,103302 + ,96040 + ,98843 + ,93183 + ,75267 + ,54815 + ,93904 + ,110725 + ,107735 + ,100793 + ,102795 + ,73772 + ,63092 + ,82476 + ,162042 + ,108215 + ,100846 + ,104183 + ,82156 + ,59728 + ,97028 + ,148746 + ,101380 + ,100953 + ,100205 + ,73292 + ,57138 + ,63039 + ,135236 + ,104370 + ,109844 + ,104290 + ,78231 + ,58153 + ,88938 + ,132459 + ,107654 + ,113021 + ,117587 + ,85387 + ,64347 + ,88778 + ,130777 + ,159185 + ,139988 + ,136731 + ,90273 + ,61277 + ,81275 + ,82503 + ,74333 + ,77350 + ,102662 + ,76923 + ,62291 + ,97455 + ,127733 + ,101861 + ,87763 + ,80954 + ,72918 + ,67952 + ,96574 + ,148105 + ,151576 + ,132592 + ,117213 + ,102982 + ,92622 + ,114196 + ,145515 + ,157664 + ,129522 + ,121886 + ,99271 + ,76923 + ,103649 + ,111232 + ,123621 + ,104077 + ,112354 + ,69260 + ,47286 + ,66910 + ,78738 + ,62905 + ,44082 + ,25392 + ,31666 + ,30732 + ,35751 + ,47579 + ,44002 + ,30064 + ,28809 + ,44375 + ,39249 + ,48007 + ,73452 + ,91154 + ,71342 + ,63226 + ,58820 + ,50623 + ,63573 + ,75347 + ,80714 + ,88644 + ,82370 + ,63439 + ,44776 + ,62024 + ,86081 + ,95212 + ,88244 + ,80287 + ,61330 + ,47206 + ,64400 + ,89579 + ,97722 + ,109203 + ,120551 + ,80234 + ,52679 + ,76923 + ,99164 + ,100499 + ,101620 + ,94385 + ,75241 + ,58420 + ,72677 + ,76148 + ,70568 + ,76469 + ,71449 + ,49368 + ,33135 + ,62131 + ,77003 + ,81836 + ,75107 + ,112968 + ,84399 + ,65015 + ,83758 + ,116225 + ,104984 + ,115451 + ,115718 + ,82930 + ,61170 + ,88377 + ,118254 + ,124208 + ,124502 + ,109871 + ,81782 + ,59034 + ,79593 + ,117667 + ,107788 + ,108135 + ,104958 + ,78685 + ,57378 + ,76496 + ,104370 + ,102875 + ,99591 + ,97802 + ,79299 + ,57138 + ,78738 + ,123007 + ,117293 + ,147731 + ,156409 + ,85173 + ,66430 + ,85387 + ,123728 + ,114703 + ,113769 + ,96307 + ,79433 + ,58607 + ,75828 + ,108429 + ,104157 + ,99538 + ,90353 + ,69874 + ,53694 + ,66910 + ,102261 + ,104584 + ,109550 + ,99858 + ,83598 + ,64748 + ,86642 + ,84719 + ,79566 + ,93236 + ,81649 + ,61891 + ,44723 + ,62291 + ,78365 + ,127493 + ,123568 + ,114356 + ,88911 + ,63092 + ,85574 + ,115104 + ,115638 + ,107975 + ,117533 + ,80474 + ,58259 + ,78231 + ,70408 + ,73986 + ,78471 + ,83037 + ,52813 + ,34123 + ,45791 + ,64454 + ,61196 + ,63039 + ,59781 + ,50997 + ,31346 + ,37861 + ,53614 + ,66857 + ,73478 + ,82183 + ,51531 + ,35564 + ,42346 + ,75054 + ,81088 + ,76255 + ,71503 + ,57992 + ,46298 + ,58313 + ,92943 + ,97055 + ,93664 + ,79993 + ,67364 + ,53106 + ,63813 + ,87843 + ,95239 + ,91661 + ,85947 + ,70408 + ,47152 + ,56043 + ,79753 + ,82530 + ,76148 + ,71583 + ,59060 + ,38582 + ,54521 + ,81702 + ,81755 + ,77136 + ,64748 + ,51932 + ,34683 + ,39730 + ,68325 + ,71049 + ,68779 + ,72758 + ,51878 + ,35484 + ,47499 + ,68405 + ,77350 + ,59461 + ,67578 + ,56524 + ,35030 + ,41839 + ,68112 + ,61570 + ,76335 + ,68432 + ,46832 + ,36766 + ,42320 + ,66563 + ,67498 + ,71903 + ,63813 + ,53000 + ,32467 + ,41065 + ,64187 + ,69740 + ,68539 + ,59327 + ,49876 + ,35111 + ,48487 + ,71503 + ,68726 + ,66803 + ,65735 + ,54068 + ,30732 + ,47606 + ,72117 + ,80207 + ,77136 + ,67231 + ,54468 + ,39169 + ,53000 + ,78551 + ,76148 + ,78738 + ,74119 + ,54602 + ,41679 + ,52279 + ,79379 + ,90219 + ,83571 + ,86081 + ,58019 + ,41465 + ,56871 + ,83090 + ,96280 + ,94091 + ,97161 + ,70141 + ,50303 + ,66002 + ,84746 + ,88404 + ,119936 + ,97669 + ,78712 + ,59114 + ,85200 + ,101380 + ,103382 + ,111713 + ,106373 + ,75134 + ,63012 + ,77056 + ,100712 + ,117800 + ,118254 + ,102448 + ,79272 + ,68592 + ,93877 + ,133206 + ,147571 + ,144687 + ,111846 + ,87069 + ,65976 + ,95880 + ,150828 + ,128614 + ,122526 + ,105946 + ,82984 + ,66216 + ,98897 + ,128080 + ,140122 + ,125223 + ,122473 + ,85467 + ,66350 + ,86722 + ,106266 + ,123381 + ,128294 + ,117080 + ,84292 + ,70007 + ,101647 + ,151336 + ,149200 + ,143646 + ,106319 + ,78284 + ,58553 + ,88564 + ,114303 + ,120337 + ,123354 + ,117133 + ,101674 + ,60876 + ,87816 + ,118495 + ,114169 + ,117720 + ,120871 + ,84826 + ,64774 + ,91955 + ,115184 + ,103783 + ,96948 + ,89979 + ,84933 + ,72143 + ,87896 + ,122286 + ,131631 + ,132806 + ,139508 + ,102074 + ,74466 + ,104717 + ,132272 + ,130323 + ,138066 + ,119990 + ,102261 + ,78605 + ,104584 + ,127599 + ,111579 + ,123381 + ,103890 + ,61811 + ,47366 + ,53507 + ,75614 + ,60262 + ,47980 + ,28703 + ,20986 + ,29290 + ,37594 + ,48888 + ,50757 + ,56417 + ,30465 + ,30411 + ,38822 + ,50383 + ,73051 + ,68325 + ,84078 + ,93477 + ,72090 + ,56177 + ,77243 + ,102181 + ,93877 + ,90433 + ,88617 + ,65655 + ,67177 + ,62665 + ,95212 + ,103543 + ,109871 + ,105305 + ,78738 + ,56898 + ,109497 + ,168344 + ,123915 + ,120711 + ,113128 + ,83838 + ,67151 + ,85574 + ,116999 + ,136117 + ,127065 + ,111473 + ,80100 + ,74093 + ,102021 + ,146690 + ,150508 + ,135289 + ,116012 + ,78498 + ,59701 + ,86294 + ,107468 + ,115371 + ,118388 + ,110485 + ,100659 + ,79139 + ,109310 + ,139935 + ,126051 + ,141270 + ,118949 + ,97455 + ,77777 + ,107040 + ,149760 + ,147731 + ,159132 + ,124369 + ,98016 + ,73185 + ,102528 + ,242516 + ,293460 + ,320987 + ,268736 + ,239873 + ,189143 + ,248550 + ,269670 + ,278801 + ,272634 + ,181240 + ,90566 + ,67017 + ,92809 + ,134755 + ,137291 + ,138199 + ,125704 + ,107414 + ,75588 + ,100606 + ,120791 + ,124075 + ,101460 + ,105198 + ,70007 + ,58446 + ,70808 + ,101220 + ,127599 + ,120497 + ,110752 + ,90113 + ,70541 + ,84559 + ,120524 + ,118922 + ,123648 + ,113448 + ,84132 + ,65228 + ,101460 + ,125303 + ,141029 + ,130136 + ,124502 + ,97241 + ,71556 + ,97188 + ,141430 + ,134621 + ,134354 + ,113261 + ,74520 + ,70835 + ,87736 + ,128908 + ,118575 + ,118014 + ,111232 + ,79593 + ,56043 + ,81221 + ,115024 + ,91661 + ,110298 + ,99591 + ,70488 + ,50757 + ,69473 + ,117186 + ,82637 + ,91207 + ,76682 + ,66964 + ,44536 + ,64267 + ,99458 + ,89338 + ,104397 + ,90486 + ,70702 + ,58633 + ,68672 + ,93477 + ,110485 + ,155875 + ,86828 + ,74653 + ,57512 + ,88484 + ,78979 + ,84158 + ,76389 + ,77136 + ,55189 + ,36686 + ,50703 + ,75428 + ,78979 + ,78151 + ,69260 + ,56844 + ,39436 + ,51985 + ,73585 + ,67177 + ,65442 + ,61757 + ,50890 + ,29050 + ,48647 + ,70488 + ,63199 + ,62825 + ,66803 + ,49555 + ,30892 + ,40103 + ,59434 + ,67604 + ,70194 + ,63760 + ,53106 + ,34310 + ,44883 + ,68058 + ,74333 + ,71156 + ,67337 + ,52279 + ,37727 + ,43254 + ,74493 + ,77991 + ,68699 + ,66483 + ,62318 + ,35885 + ,49902 + ,78231 + ,67044 + ,71476 + ,68112 + ,52492 + ,41492 + ,46805 + ,69847 + ,73478 + ,78632 + ,74813 + ,60182 + ,41305 + ,39116 + ,72010 + ,79246 + ,71690 + ,69420 + ,57939 + ,46298 + ,60422 + ,81035 + ,82637 + ,79726 + ,86348 + ,66296 + ,33695 + ,52199 + ,72517 + ,72277 + ,73078 + ,76763 + ,65655 + ,34657 + ,56417 + ,68699 + ,77163 + ,79700 + ,78151 + ,59781 + ,44829 + ,46992 + ,77030 + ,92596 + ,84933 + ,83918 + ,63306 + ,47286 + ,77403 + ,102768 + ,118361 + ,107708 + ,94705 + ,76122 + ,45417 + ,79806 + ,106346 + ,95826 + ,93797 + ,99351 + ,83838 + ,54174 + ,84559 + ,116492 + ,114543 + ,123407 + ,114677 + ,110378 + ,96040 + ,141857 + ,233465 + ,146022 + ,142124 + ,118067 + ,83010 + ,75695 + ,104157 + ,150161 + ,174832 + ,139935 + ,108749 + ,109977 + ,78872 + ,126451 + ,161295) > par10 = 'FALSE' > par9 = '1' > par8 = '1' > par7 = '1' > par6 = '1' > par5 = '12' > par4 = '1' > par3 = '0' > par2 = '1' > par1 = '24' > par1 <- as.numeric(par1) #cut off periods > par2 <- as.numeric(par2) #lambda > par3 <- as.numeric(par3) #degree of non-seasonal differencing > par4 <- as.numeric(par4) #degree of seasonal differencing > par5 <- 7 #seasonal period > par6 <- 4 #p > par7 <- as.numeric(par7) #q > par8 <- 4 #P > par9 <- as.numeric(par9) #Q > if (par10 == 'TRUE') par10 <- TRUE > if (par10 == 'FALSE') par10 <- FALSE > if (par2 == 0) x <- log(x) > if (par2 != 0) x <- x^par2 > lx <- length(x) > first <- lx - 2*par1 > nx <- lx - par1 > nx1 <- nx + 1 > fx <- lx - nx > if (fx < 1) { + fx <- par5 + nx1 <- lx + fx - 1 + first <- lx - 2*fx + } > first <- 1 > if (fx < 3) fx <- round(lx/10,0) > (arima.out <- arima(x[1:nx], order=c(par6,par3,par7), seasonal=list(order=c(par8,par4,par9), period=par5), include.mean=par10, method='ML')) Call: arima(x = x[1:nx], order = c(par6, par3, par7), seasonal = list(order = c(par8, par4, par9), period = par5), include.mean = par10, method = "ML") Coefficients: ar1 ar2 ar3 ar4 ma1 sar1 sar2 sar3 sar4 0.1887 0.572 -0.0344 0.0729 0.6800 0.2476 0.1111 -0.0104 0.0751 s.e. 0.2258 0.195 0.0307 0.0307 0.2244 0.0349 0.0312 0.0304 0.0301 sma1 -0.9679 s.e. 0.0101 sigma^2 estimated as 120305326: log likelihood = -12990.93, aic = 26003.87 Warning message: In log(s2) : NaNs produced > (forecast <- predict(arima.out,par1)) $pred Time Series: Start = 1219 End = 1242 Frequency = 1 [1] 58907.14 81556.01 107074.87 106609.29 104646.54 98799.67 79371.74 [8] 57101.83 76899.92 103984.52 104090.63 102700.38 96664.81 76693.75 [15] 56102.49 76171.99 103405.59 105226.00 103856.23 95562.33 75287.59 [22] 54363.28 74739.75 102378.45 $se Time Series: Start = 1219 End = 1242 Frequency = 1 [1] 10968.38 14528.82 16620.70 17881.84 18970.71 19720.47 20344.92 21633.68 [9] 22621.43 23322.63 23845.25 24264.81 24588.23 24845.09 25443.01 25900.80 [17] 26242.16 26493.50 26702.41 26861.61 26991.07 27213.88 27389.28 27521.46 > (lb <- forecast$pred - 1.96 * forecast$se) Time Series: Start = 1219 End = 1242 Frequency = 1 [1] 37409.113 53079.525 74498.296 71560.885 67463.947 60147.544 39495.696 [8] 14699.821 32561.918 58272.169 57353.940 55141.348 48471.874 27997.376 [15] 6234.191 25406.424 51970.964 53298.736 51519.516 42913.575 22385.083 [22] 1024.076 21056.769 48436.395 > (ub <- forecast$pred + 1.96 * forecast$se) Time Series: Start = 1219 End = 1242 Frequency = 1 [1] 80405.17 110032.50 139651.44 141657.70 141829.14 137451.80 119247.78 [8] 99503.85 121237.93 149696.88 150827.33 150259.42 144857.75 125390.13 [15] 105970.79 126937.55 154840.21 157153.27 156192.95 148211.08 128190.09 [22] 107702.48 128422.74 156320.51 > if (par2 == 0) { + x <- exp(x) + forecast$pred <- exp(forecast$pred) + lb <- exp(lb) + ub <- exp(ub) + } > if (par2 != 0) { + x <- x^(1/par2) + forecast$pred <- forecast$pred^(1/par2) + lb <- lb^(1/par2) + ub <- ub^(1/par2) + } > if (par2 < 0) { + olb <- lb + lb <- ub + ub <- olb + } > (actandfor <- c(x[1:nx], forecast$pred)) [1] 15086.00 20559.00 39383.00 68032.00 42346.00 40184.00 29183.00 [8] 18049.00 24377.00 48033.00 61410.00 40637.00 37914.00 22481.00 [15] 17061.00 21921.00 34043.00 36152.00 38929.00 36713.00 27928.00 [22] 14178.00 19331.00 35030.00 37834.00 45257.00 39650.00 33001.00 [29] 22268.00 34283.00 63733.00 54548.00 31666.00 32654.00 28409.00 [36] 16234.00 19544.00 33375.00 30839.00 27581.00 28596.00 28542.00 [43] 14285.00 20799.00 28729.00 30278.00 31266.00 38341.00 24938.00 [50] 15700.00 17382.00 34229.00 29584.00 33909.00 29397.00 24644.00 [57] 14124.00 18770.00 32681.00 30518.00 34310.00 24217.00 15806.00 [64] 12362.00 13751.00 25312.00 23549.00 30305.00 30411.00 15593.00 [71] 17382.00 15806.00 29183.00 33348.00 33589.00 30198.00 23469.00 [78] 15593.00 16474.00 27341.00 26673.00 33268.00 26406.00 23656.00 [85] 15086.00 18316.00 27528.00 30305.00 34550.00 34710.00 23843.00 [92] 12362.00 21200.00 27261.00 31586.00 33322.00 32814.00 21974.00 [99] 17115.00 14445.00 26673.00 31746.00 28249.00 29103.00 21974.00 [106] 17622.00 21066.00 28382.00 32147.00 35885.00 40824.00 28622.00 [113] 24297.00 30465.00 47927.00 51665.00 57058.00 48407.00 30011.00 [120] 21413.00 30518.00 41171.00 37487.00 44456.00 41465.00 28409.00 [127] 34870.00 29557.00 44936.00 44028.00 45310.00 39302.00 28516.00 [134] 19865.00 30091.00 38101.00 44402.00 52359.00 71182.00 60796.00 [141] 43735.00 63947.00 89071.00 86321.00 90967.00 54441.00 36339.00 [148] 29290.00 65842.00 99404.00 83865.00 84452.00 76309.00 69554.00 [155] 44616.00 67337.00 94144.00 84425.00 76763.00 73559.00 60956.00 [162] 46271.00 74066.00 91634.00 63947.00 56017.00 53293.00 54895.00 [169] 48781.00 60449.00 99965.00 84746.00 81088.00 77777.00 60315.00 [176] 46218.00 62985.00 92596.00 78525.00 72811.00 62318.00 48140.00 [183] 45443.00 66910.00 90032.00 91661.00 103516.00 100285.00 72384.00 [190] 51985.00 72224.00 99351.00 108616.00 102128.00 97669.00 71716.00 [197] 51584.00 63413.00 88137.00 86535.00 91955.00 84853.00 54388.00 [204] 40931.00 58900.00 76576.00 80447.00 60315.00 52012.00 37487.00 [211] 19972.00 25338.00 23549.00 19785.00 29637.00 34416.00 26914.00 [218] 25071.00 24003.00 19358.00 28783.00 46992.00 49796.00 40904.00 [225] 33722.00 42640.00 56097.00 62184.00 63039.00 61730.00 44349.00 [232] 32307.00 45123.00 63466.00 71903.00 73211.00 67845.00 51237.00 [239] 31506.00 45043.00 74386.00 76602.00 72704.00 71770.00 52225.00 [246] 40958.00 55856.00 79700.00 81889.00 82049.00 66643.00 54655.00 [253] 36739.00 53026.00 78098.00 81248.00 84372.00 75614.00 63012.00 [260] 38795.00 55670.00 81168.00 85787.00 88591.00 75401.00 63413.00 [267] 42907.00 62291.00 86241.00 85200.00 84559.00 75801.00 72304.00 [274] 50944.00 70034.00 104691.00 88404.00 93397.00 88030.00 60582.00 [281] 50890.00 69847.00 90166.00 84158.00 82503.00 83811.00 66296.00 [288] 42640.00 55563.00 82450.00 84799.00 82370.00 83384.00 60075.00 [295] 41091.00 55589.00 79513.00 87656.00 74760.00 64214.00 47019.00 [302] 34229.00 45150.00 64187.00 73879.00 76175.00 83785.00 52786.00 [309] 43681.00 61864.00 74573.00 79913.00 78765.00 79112.00 62718.00 [316] 40557.00 57058.00 88804.00 89205.00 82904.00 78445.00 62825.00 [323] 57832.00 70675.00 102795.00 107094.00 105625.00 98390.00 74360.00 [330] 64641.00 82423.00 116759.00 101941.00 101140.00 98790.00 65949.00 [337] 49635.00 77323.00 109203.00 102902.00 93637.00 89365.00 72250.00 [344] 53267.00 73238.00 99725.00 69100.00 66323.00 80447.00 80954.00 [351] 48194.00 52546.00 91821.00 84372.00 90994.00 72410.00 62745.00 [358] 47366.00 63947.00 82690.00 89712.00 79085.00 80527.00 61303.00 [365] 40691.00 58340.00 79166.00 82850.00 82076.00 73292.00 60823.00 [372] 51157.00 61410.00 64294.00 67658.00 66323.00 66563.00 52145.00 [379] 36980.00 50703.00 68112.00 68379.00 65735.00 60716.00 50463.00 [386] 33749.00 39436.00 66990.00 70541.00 75027.00 69233.00 53213.00 [393] 31186.00 41145.00 67604.00 68699.00 71690.00 60022.00 51718.00 [400] 32814.00 42400.00 71316.00 70141.00 64694.00 60636.00 37620.00 [407] 35431.00 41145.00 69393.00 72891.00 62638.00 63439.00 54014.00 [414] 37567.00 38875.00 64854.00 75214.00 72944.00 71796.00 60689.00 [421] 53000.00 50757.00 71289.00 75080.00 77377.00 68779.00 49155.00 [428] 30678.00 49342.00 67604.00 63733.00 71209.00 59461.00 49609.00 [435] 30839.00 39302.00 67685.00 67925.00 66056.00 60743.00 49422.00 [442] 30972.00 34924.00 56818.00 62024.00 59274.00 59007.00 43494.00 [449] 26486.00 41252.00 63146.00 70114.00 57779.00 61944.00 48728.00 [456] 32708.00 40237.00 67845.00 68913.00 66697.00 68272.00 51317.00 [463] 30812.00 37300.00 63599.00 72918.00 74386.00 73292.00 56577.00 [470] 41652.00 58900.00 86188.00 88350.00 85787.00 86535.00 67978.00 [477] 42720.00 64187.00 98897.00 108429.00 92249.00 111820.00 77163.00 [484] 59648.00 83651.00 103569.00 108749.00 96948.00 90113.00 75614.00 [491] 52733.00 78178.00 103302.00 96040.00 98843.00 93183.00 75267.00 [498] 54815.00 93904.00 110725.00 107735.00 100793.00 102795.00 73772.00 [505] 63092.00 82476.00 162042.00 108215.00 100846.00 104183.00 82156.00 [512] 59728.00 97028.00 148746.00 101380.00 100953.00 100205.00 73292.00 [519] 57138.00 63039.00 135236.00 104370.00 109844.00 104290.00 78231.00 [526] 58153.00 88938.00 132459.00 107654.00 113021.00 117587.00 85387.00 [533] 64347.00 88778.00 130777.00 159185.00 139988.00 136731.00 90273.00 [540] 61277.00 81275.00 82503.00 74333.00 77350.00 102662.00 76923.00 [547] 62291.00 97455.00 127733.00 101861.00 87763.00 80954.00 72918.00 [554] 67952.00 96574.00 148105.00 151576.00 132592.00 117213.00 102982.00 [561] 92622.00 114196.00 145515.00 157664.00 129522.00 121886.00 99271.00 [568] 76923.00 103649.00 111232.00 123621.00 104077.00 112354.00 69260.00 [575] 47286.00 66910.00 78738.00 62905.00 44082.00 25392.00 31666.00 [582] 30732.00 35751.00 47579.00 44002.00 30064.00 28809.00 44375.00 [589] 39249.00 48007.00 73452.00 91154.00 71342.00 63226.00 58820.00 [596] 50623.00 63573.00 75347.00 80714.00 88644.00 82370.00 63439.00 [603] 44776.00 62024.00 86081.00 95212.00 88244.00 80287.00 61330.00 [610] 47206.00 64400.00 89579.00 97722.00 109203.00 120551.00 80234.00 [617] 52679.00 76923.00 99164.00 100499.00 101620.00 94385.00 75241.00 [624] 58420.00 72677.00 76148.00 70568.00 76469.00 71449.00 49368.00 [631] 33135.00 62131.00 77003.00 81836.00 75107.00 112968.00 84399.00 [638] 65015.00 83758.00 116225.00 104984.00 115451.00 115718.00 82930.00 [645] 61170.00 88377.00 118254.00 124208.00 124502.00 109871.00 81782.00 [652] 59034.00 79593.00 117667.00 107788.00 108135.00 104958.00 78685.00 [659] 57378.00 76496.00 104370.00 102875.00 99591.00 97802.00 79299.00 [666] 57138.00 78738.00 123007.00 117293.00 147731.00 156409.00 85173.00 [673] 66430.00 85387.00 123728.00 114703.00 113769.00 96307.00 79433.00 [680] 58607.00 75828.00 108429.00 104157.00 99538.00 90353.00 69874.00 [687] 53694.00 66910.00 102261.00 104584.00 109550.00 99858.00 83598.00 [694] 64748.00 86642.00 84719.00 79566.00 93236.00 81649.00 61891.00 [701] 44723.00 62291.00 78365.00 127493.00 123568.00 114356.00 88911.00 [708] 63092.00 85574.00 115104.00 115638.00 107975.00 117533.00 80474.00 [715] 58259.00 78231.00 70408.00 73986.00 78471.00 83037.00 52813.00 [722] 34123.00 45791.00 64454.00 61196.00 63039.00 59781.00 50997.00 [729] 31346.00 37861.00 53614.00 66857.00 73478.00 82183.00 51531.00 [736] 35564.00 42346.00 75054.00 81088.00 76255.00 71503.00 57992.00 [743] 46298.00 58313.00 92943.00 97055.00 93664.00 79993.00 67364.00 [750] 53106.00 63813.00 87843.00 95239.00 91661.00 85947.00 70408.00 [757] 47152.00 56043.00 79753.00 82530.00 76148.00 71583.00 59060.00 [764] 38582.00 54521.00 81702.00 81755.00 77136.00 64748.00 51932.00 [771] 34683.00 39730.00 68325.00 71049.00 68779.00 72758.00 51878.00 [778] 35484.00 47499.00 68405.00 77350.00 59461.00 67578.00 56524.00 [785] 35030.00 41839.00 68112.00 61570.00 76335.00 68432.00 46832.00 [792] 36766.00 42320.00 66563.00 67498.00 71903.00 63813.00 53000.00 [799] 32467.00 41065.00 64187.00 69740.00 68539.00 59327.00 49876.00 [806] 35111.00 48487.00 71503.00 68726.00 66803.00 65735.00 54068.00 [813] 30732.00 47606.00 72117.00 80207.00 77136.00 67231.00 54468.00 [820] 39169.00 53000.00 78551.00 76148.00 78738.00 74119.00 54602.00 [827] 41679.00 52279.00 79379.00 90219.00 83571.00 86081.00 58019.00 [834] 41465.00 56871.00 83090.00 96280.00 94091.00 97161.00 70141.00 [841] 50303.00 66002.00 84746.00 88404.00 119936.00 97669.00 78712.00 [848] 59114.00 85200.00 101380.00 103382.00 111713.00 106373.00 75134.00 [855] 63012.00 77056.00 100712.00 117800.00 118254.00 102448.00 79272.00 [862] 68592.00 93877.00 133206.00 147571.00 144687.00 111846.00 87069.00 [869] 65976.00 95880.00 150828.00 128614.00 122526.00 105946.00 82984.00 [876] 66216.00 98897.00 128080.00 140122.00 125223.00 122473.00 85467.00 [883] 66350.00 86722.00 106266.00 123381.00 128294.00 117080.00 84292.00 [890] 70007.00 101647.00 151336.00 149200.00 143646.00 106319.00 78284.00 [897] 58553.00 88564.00 114303.00 120337.00 123354.00 117133.00 101674.00 [904] 60876.00 87816.00 118495.00 114169.00 117720.00 120871.00 84826.00 [911] 64774.00 91955.00 115184.00 103783.00 96948.00 89979.00 84933.00 [918] 72143.00 87896.00 122286.00 131631.00 132806.00 139508.00 102074.00 [925] 74466.00 104717.00 132272.00 130323.00 138066.00 119990.00 102261.00 [932] 78605.00 104584.00 127599.00 111579.00 123381.00 103890.00 61811.00 [939] 47366.00 53507.00 75614.00 60262.00 47980.00 28703.00 20986.00 [946] 29290.00 37594.00 48888.00 50757.00 56417.00 30465.00 30411.00 [953] 38822.00 50383.00 73051.00 68325.00 84078.00 93477.00 72090.00 [960] 56177.00 77243.00 102181.00 93877.00 90433.00 88617.00 65655.00 [967] 67177.00 62665.00 95212.00 103543.00 109871.00 105305.00 78738.00 [974] 56898.00 109497.00 168344.00 123915.00 120711.00 113128.00 83838.00 [981] 67151.00 85574.00 116999.00 136117.00 127065.00 111473.00 80100.00 [988] 74093.00 102021.00 146690.00 150508.00 135289.00 116012.00 78498.00 [995] 59701.00 86294.00 107468.00 115371.00 118388.00 110485.00 100659.00 [1002] 79139.00 109310.00 139935.00 126051.00 141270.00 118949.00 97455.00 [1009] 77777.00 107040.00 149760.00 147731.00 159132.00 124369.00 98016.00 [1016] 73185.00 102528.00 242516.00 293460.00 320987.00 268736.00 239873.00 [1023] 189143.00 248550.00 269670.00 278801.00 272634.00 181240.00 90566.00 [1030] 67017.00 92809.00 134755.00 137291.00 138199.00 125704.00 107414.00 [1037] 75588.00 100606.00 120791.00 124075.00 101460.00 105198.00 70007.00 [1044] 58446.00 70808.00 101220.00 127599.00 120497.00 110752.00 90113.00 [1051] 70541.00 84559.00 120524.00 118922.00 123648.00 113448.00 84132.00 [1058] 65228.00 101460.00 125303.00 141029.00 130136.00 124502.00 97241.00 [1065] 71556.00 97188.00 141430.00 134621.00 134354.00 113261.00 74520.00 [1072] 70835.00 87736.00 128908.00 118575.00 118014.00 111232.00 79593.00 [1079] 56043.00 81221.00 115024.00 91661.00 110298.00 99591.00 70488.00 [1086] 50757.00 69473.00 117186.00 82637.00 91207.00 76682.00 66964.00 [1093] 44536.00 64267.00 99458.00 89338.00 104397.00 90486.00 70702.00 [1100] 58633.00 68672.00 93477.00 110485.00 155875.00 86828.00 74653.00 [1107] 57512.00 88484.00 78979.00 84158.00 76389.00 77136.00 55189.00 [1114] 36686.00 50703.00 75428.00 78979.00 78151.00 69260.00 56844.00 [1121] 39436.00 51985.00 73585.00 67177.00 65442.00 61757.00 50890.00 [1128] 29050.00 48647.00 70488.00 63199.00 62825.00 66803.00 49555.00 [1135] 30892.00 40103.00 59434.00 67604.00 70194.00 63760.00 53106.00 [1142] 34310.00 44883.00 68058.00 74333.00 71156.00 67337.00 52279.00 [1149] 37727.00 43254.00 74493.00 77991.00 68699.00 66483.00 62318.00 [1156] 35885.00 49902.00 78231.00 67044.00 71476.00 68112.00 52492.00 [1163] 41492.00 46805.00 69847.00 73478.00 78632.00 74813.00 60182.00 [1170] 41305.00 39116.00 72010.00 79246.00 71690.00 69420.00 57939.00 [1177] 46298.00 60422.00 81035.00 82637.00 79726.00 86348.00 66296.00 [1184] 33695.00 52199.00 72517.00 72277.00 73078.00 76763.00 65655.00 [1191] 34657.00 56417.00 68699.00 77163.00 79700.00 78151.00 59781.00 [1198] 44829.00 46992.00 77030.00 92596.00 84933.00 83918.00 63306.00 [1205] 47286.00 77403.00 102768.00 118361.00 107708.00 94705.00 76122.00 [1212] 45417.00 79806.00 106346.00 95826.00 93797.00 99351.00 83838.00 [1219] 58907.14 81556.01 107074.87 106609.29 104646.54 98799.67 79371.74 [1226] 57101.83 76899.92 103984.52 104090.63 102700.38 96664.81 76693.75 [1233] 56102.49 76171.99 103405.59 105226.00 103856.23 95562.33 75287.59 [1240] 54363.28 74739.75 102378.45 > (perc.se <- (ub-forecast$pred)/1.96/forecast$pred) Time Series: Start = 1219 End = 1242 Frequency = 1 [1] 0.1861978 0.1781453 0.1552250 0.1677325 0.1812837 0.1996006 0.2563245 [8] 0.3788614 0.2941672 0.2242894 0.2290816 0.2362680 0.2543659 0.3239519 [15] 0.4535095 0.3400305 0.2537789 0.2517772 0.2571093 0.2810899 0.3585063 [22] 0.5005930 0.3664620 0.2688208 > postscript(file="/var/wessaorg/rcomp/tmp/1hfqv1354204277.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > opar <- par(mar=c(4,4,2,2),las=1) > ylim <- c( min(x[first:nx],lb), max(x[first:nx],ub)) > plot(x,ylim=ylim,type='n',xlim=c(first,lx)) > usr <- par('usr') > rect(usr[1],usr[3],nx+1,usr[4],border=NA,col='lemonchiffon') > rect(nx1,usr[3],usr[2],usr[4],border=NA,col='lavender') > abline(h= (-3:3)*2 , col ='gray', lty =3) > polygon( c(nx1:lx,lx:nx1), c(lb,rev(ub)), col = 'orange', lty=2,border=NA) > lines(nx1:lx, lb , lty=2) > lines(nx1:lx, ub , lty=2) > lines(x, lwd=2) > lines(nx1:lx, forecast$pred , lwd=2 , col ='white') > box() > par(opar) > dev.off() null device 1 > prob.dec <- array(NA, dim=fx) > prob.sdec <- array(NA, dim=fx) > prob.ldec <- array(NA, dim=fx) > prob.pval <- array(NA, dim=fx) > perf.pe <- array(0, dim=fx) > perf.mape <- array(0, dim=fx) > perf.mape1 <- array(0, dim=fx) > perf.se <- array(0, dim=fx) > perf.mse <- array(0, dim=fx) > perf.mse1 <- array(0, dim=fx) > perf.rmse <- array(0, dim=fx) > for (i in 1:fx) { + locSD <- (ub[i] - forecast$pred[i]) / 1.96 + perf.pe[i] = (x[nx+i] - forecast$pred[i]) / forecast$pred[i] + perf.se[i] = (x[nx+i] - forecast$pred[i])^2 + prob.dec[i] = pnorm((x[nx+i-1] - forecast$pred[i]) / locSD) + prob.sdec[i] = pnorm((x[nx+i-par5] - forecast$pred[i]) / locSD) + prob.ldec[i] = pnorm((x[nx] - forecast$pred[i]) / locSD) + prob.pval[i] = pnorm(abs(x[nx+i] - forecast$pred[i]) / locSD) + } > perf.mape[1] = abs(perf.pe[1]) > perf.mse[1] = abs(perf.se[1]) > for (i in 2:fx) { + perf.mape[i] = perf.mape[i-1] + abs(perf.pe[i]) + perf.mape1[i] = perf.mape[i] / i + perf.mse[i] = perf.mse[i-1] + perf.se[i] + perf.mse1[i] = perf.mse[i] / i + } > perf.rmse = sqrt(perf.mse1) > postscript(file="/var/wessaorg/rcomp/tmp/2kzh71354204277.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > plot(forecast$pred, pch=19, type='b',main='ARIMA Extrapolation Forecast', ylab='Forecast and 95% CI', xlab='time',ylim=c(min(lb),max(ub))) > dum <- forecast$pred > dum[1:par1] <- x[(nx+1):lx] > lines(dum, lty=1) > lines(ub,lty=3) > lines(lb,lty=3) > dev.off() null device 1 > > #Note: the /var/wessaorg/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/wessaorg/rcomp/createtable") > > a<-table.start() > a<-table.row.start(a) > a<-table.element(a,'Univariate ARIMA Extrapolation Forecast',9,TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'time',1,header=TRUE) > a<-table.element(a,'Y[t]',1,header=TRUE) > a<-table.element(a,'F[t]',1,header=TRUE) > a<-table.element(a,'95% LB',1,header=TRUE) > a<-table.element(a,'95% UB',1,header=TRUE) > a<-table.element(a,'p-value
(H0: Y[t] = F[t])',1,header=TRUE) > a<-table.element(a,'P(F[t]>Y[t-1])',1,header=TRUE) > a<-table.element(a,'P(F[t]>Y[t-s])',1,header=TRUE) > mylab <- paste('P(F[t]>Y[',nx,sep='') > mylab <- paste(mylab,'])',sep='') > a<-table.element(a,mylab,1,header=TRUE) > a<-table.row.end(a) > for (i in (nx-par5):nx) { + a<-table.row.start(a) + a<-table.element(a,i,header=TRUE) + a<-table.element(a,x[i]) + a<-table.element(a,'-') + a<-table.element(a,'-') + a<-table.element(a,'-') + a<-table.element(a,'-') + a<-table.element(a,'-') + a<-table.element(a,'-') + a<-table.element(a,'-') + a<-table.row.end(a) + } > for (i in 1:fx) { + a<-table.row.start(a) + a<-table.element(a,nx+i,header=TRUE) + a<-table.element(a,round(x[nx+i],4)) + a<-table.element(a,round(forecast$pred[i],4)) + a<-table.element(a,round(lb[i],4)) + a<-table.element(a,round(ub[i],4)) + a<-table.element(a,round((1-prob.pval[i]),4)) + a<-table.element(a,round((1-prob.dec[i]),4)) + a<-table.element(a,round((1-prob.sdec[i]),4)) + a<-table.element(a,round((1-prob.ldec[i]),4)) + a<-table.row.end(a) + } > a<-table.end(a) > table.save(a,file="/var/wessaorg/rcomp/tmp/3varw1354204277.tab") > a<-table.start() > a<-table.row.start(a) > a<-table.element(a,'Univariate ARIMA Extrapolation Forecast Performance',7,TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'time',1,header=TRUE) > a<-table.element(a,'% S.E.',1,header=TRUE) > a<-table.element(a,'PE',1,header=TRUE) > a<-table.element(a,'MAPE',1,header=TRUE) > a<-table.element(a,'Sq.E',1,header=TRUE) > a<-table.element(a,'MSE',1,header=TRUE) > a<-table.element(a,'RMSE',1,header=TRUE) > a<-table.row.end(a) > for (i in 1:fx) { + a<-table.row.start(a) + a<-table.element(a,nx+i,header=TRUE) + a<-table.element(a,round(perc.se[i],4)) + a<-table.element(a,round(perf.pe[i],4)) + a<-table.element(a,round(perf.mape1[i],4)) + a<-table.element(a,round(perf.se[i],4)) + a<-table.element(a,round(perf.mse1[i],4)) + a<-table.element(a,round(perf.rmse[i],4)) + a<-table.row.end(a) + } > a<-table.end(a) > table.save(a,file="/var/wessaorg/rcomp/tmp/4ctf91354204277.tab") > > try(system("convert tmp/1hfqv1354204277.ps tmp/1hfqv1354204277.png",intern=TRUE)) character(0) > try(system("convert tmp/2kzh71354204277.ps tmp/2kzh71354204277.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 46.370 3.716 50.070