R version 2.9.0 (2009-04-17) Copyright (C) 2009 The R Foundation for Statistical Computing ISBN 3-900051-07-0 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(100.01,103.84,104.48,95.43,104.80,108.64,105.65,108.42,115.35,113.64,115.24,100.33,101.29,104.48,99.26,100.11,103.52,101.18,96.39,97.56,96.39,85.10,79.77,79.13,80.84,82.75,92.55,96.60,96.92,95.32,98.52,100.22,104.91,103.10,97.13,103.42,111.72,118.11,111.62,100.22,102.03,105.76,107.68,110.77,105.44,112.26,114.07,117.90,124.72,126.42,134.73,135.79,143.36,140.37,144.74,151.98,150.92,163.38,154.43,146.66,157.95,162.10,180.42,179.57,171.58,185.43,190.64,203.00,202.36,193.41,186.17,192.24,209.60,206.41,209.82,230.37,235.80,232.07,244.64,242.19,217.48,209.39,211.73,221.00,203.11,214.71,224.19,238.04,238.36,246.24,259.87,249.97,266.48,282.98,306.31,301.73,314.62,332.62,355.51,370.32,408.13,433.58,440.51,386.29,342.84,254.97,203.42,170.09,174.03,167.85,177.01,188.19,211.20,240.91,230.26,251.25,241.66) > par10 = 'FALSE' > par9 = '1' > par8 = '0' > par7 = '0' > par6 = '0' > par5 = '12' > par4 = '0' > par3 = '2' > par2 = '-0.7' > par1 = '24' > #'GNU S' R Code compiled by R2WASP v. 1.0.44 () > #Author: Prof. Dr. P. Wessa > #To cite this work: AUTHOR(S), (YEAR), YOUR SOFTWARE TITLE (vNUMBER) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_YOURPAGE.wasp/ > #Source of accompanying publication: Office for Research, Development, and Education > #Technical description: Write here your technical program description (don't use hard returns!) > 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 <- as.numeric(par5) #seasonal period > par6 <- as.numeric(par6) #p > par7 <- as.numeric(par7) #q > par8 <- as.numeric(par8) #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: sma1 0.0417 s.e. 0.1327 sigma^2 estimated as 2.826e-06: log likelihood = 452.2, aic = -900.41 > (forecast <- predict(arima.out,fx)) $pred Time Series: Start = 94 End = 117 Frequency = 1 [1] 0.0190830329 0.0180865258 0.0170708401 0.0161435833 0.0151168049 [6] 0.0141004227 0.0130765249 0.0120886251 0.0110800045 0.0100609204 [11] 0.0090962955 0.0080673594 0.0070384233 0.0060094872 0.0049805511 [16] 0.0039516150 0.0029226790 0.0018937429 0.0008648068 -0.0001641293 [21] -0.0011930654 -0.0022220015 -0.0032509376 -0.0042798737 $se Time Series: Start = 94 End = 117 Frequency = 1 [1] 0.001681080 0.003759009 0.006290024 0.009207653 0.012467221 0.016036478 [7] 0.019890804 0.024010621 0.028379892 0.032985166 0.037814953 0.042859292 [13] 0.048141326 0.053648012 0.059368494 0.065293546 0.071415194 0.077726441 [19] 0.084221077 0.090893529 0.097738757 0.104752164 0.111929536 0.119266983 > (lb <- forecast$pred - 1.96 * forecast$se) Time Series: Start = 94 End = 117 Frequency = 1 [1] 0.015788117 0.010718869 0.004742392 -0.001903416 -0.009318948 [6] -0.017331075 -0.025909450 -0.034972192 -0.044544584 -0.054590005 [11] -0.065021013 -0.075936852 -0.087318575 -0.099140616 -0.111381696 [16] -0.124023735 -0.137051101 -0.150450082 -0.164208504 -0.178315446 [21] -0.192761028 -0.207536243 -0.222632828 -0.238043161 > (ub <- forecast$pred + 1.96 * forecast$se) Time Series: Start = 94 End = 117 Frequency = 1 [1] 0.02237795 0.02545418 0.02939929 0.03419058 0.03955256 0.04553192 [7] 0.05206250 0.05914944 0.06670459 0.07471185 0.08321360 0.09207157 [13] 0.10139542 0.11115959 0.12134280 0.13192697 0.14289646 0.15423757 [19] 0.16593812 0.17798719 0.19037490 0.20309224 0.21613095 0.22948341 > 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] 100.0100 103.8400 104.4800 95.4300 104.8000 108.6400 [7] 105.6500 108.4200 115.3500 113.6400 115.2400 100.3300 [13] 101.2900 104.4800 99.2600 100.1100 103.5200 101.1800 [19] 96.3900 97.5600 96.3900 85.1000 79.7700 79.1300 [25] 80.8400 82.7500 92.5500 96.6000 96.9200 95.3200 [31] 98.5200 100.2200 104.9100 103.1000 97.1300 103.4200 [37] 111.7200 118.1100 111.6200 100.2200 102.0300 105.7600 [43] 107.6800 110.7700 105.4400 112.2600 114.0700 117.9000 [49] 124.7200 126.4200 134.7300 135.7900 143.3600 140.3700 [55] 144.7400 151.9800 150.9200 163.3800 154.4300 146.6600 [61] 157.9500 162.1000 180.4200 179.5700 171.5800 185.4300 [67] 190.6400 203.0000 202.3600 193.4100 186.1700 192.2400 [73] 209.6000 206.4100 209.8200 230.3700 235.8000 232.0700 [79] 244.6400 242.1900 217.4800 209.3900 211.7300 221.0000 [85] 203.1100 214.7100 224.1900 238.0400 238.3600 246.2400 [91] 259.8700 249.9700 266.4800 285.9025 308.6687 335.2356 [97] 363.0781 398.8149 440.5083 490.5974 548.8600 621.6048 [103] 713.4683 823.9631 978.1010 1188.5985 1489.6677 1948.0662 [109] 2711.3095 4171.6964 7754.2788 23759.0940 NaN NaN [115] NaN NaN NaN > (perc.se <- (ub-forecast$pred)/1.96/forecast$pred) Time Series: Start = 94 End = 117 Frequency = 1 [1] 0.1586629 0.5670650 2.6695781 NaN NaN NaN NaN [8] NaN NaN NaN NaN NaN NaN NaN [15] NaN NaN NaN NaN NaN NaN NaN [22] NaN NaN NaN > postscript(file="/var/www/html/rcomp/tmp/1bhjl1260386940.ps",horizontal=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)) Error in plot.window(...) : need finite 'ylim' values Calls: plot -> plot.default -> localWindow -> plot.window Execution halted