R version 3.0.2 (2013-09-25) -- "Frisbee Sailing" Copyright (C) 2013 The R Foundation for Statistical Computing 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(235.1 + ,280.7 + ,264.6 + ,240.7 + ,201.4 + ,240.8 + ,241.1 + ,223.8 + ,206.1 + ,174.7 + ,203.3 + ,220.5 + ,299.5 + ,347.4 + ,338.3 + ,327.7 + ,351.6 + ,396.6 + ,438.8 + ,395.6 + ,363.5 + ,378.8 + ,357 + ,369 + ,464.8 + ,479.1 + ,431.3 + ,366.5 + ,326.3 + ,355.1 + ,331.6 + ,261.3 + ,249 + ,205.5 + ,235.6 + ,240.9 + ,264.9 + ,253.8 + ,232.3 + ,193.8 + ,177 + ,213.2 + ,207.2 + ,180.6 + ,188.6 + ,175.4 + ,199 + ,179.6 + ,225.8 + ,234 + ,200.2 + ,183.6 + ,178.2 + ,203.2 + ,208.5 + ,191.8 + ,172.8 + ,148 + ,159.4 + ,154.5 + ,213.2 + ,196.4 + ,182.8 + ,176.4 + ,153.6 + ,173.2 + ,171 + ,151.2 + ,161.9 + ,157.2 + ,201.7 + ,236.4 + ,356.1 + ,398.3 + ,403.7 + ,384.6 + ,365.8 + ,368.1 + ,367.9 + ,347 + ,343.3 + ,292.9 + ,311.5 + ,300.9 + ,366.9 + ,356.9 + ,329.7 + ,316.2 + ,269 + ,289.3 + ,266.2 + ,253.6 + ,233.8 + ,228.4 + ,253.6 + ,260.1 + ,306.6 + ,309.2 + ,309.5 + ,271 + ,279.9 + ,317.9 + ,298.4 + ,246.7 + ,227.3 + ,209.1 + ,259.9 + ,266 + ,320.6 + ,308.5 + ,282.2 + ,262.7 + ,263.5 + ,313.1 + ,284.3 + ,252.6 + ,250.3 + ,246.5 + ,312.7 + ,333.2 + ,446.4 + ,511.6 + ,515.5 + ,506.4 + ,483.2 + ,522.3 + ,509.8 + ,460.7 + ,405.8 + ,375 + ,378.5 + ,406.8 + ,467.8 + ,469.8 + ,429.8 + ,355.8 + ,332.7 + ,378 + ,360.5 + ,334.7 + ,319.5 + ,323.1 + ,363.6 + ,352.1 + ,411.9 + ,388.6 + ,416.4 + ,360.7 + ,338 + ,417.2 + ,388.4 + ,371.1 + ,331.5 + ,353.7 + ,396.7 + ,447 + ,533.5 + ,565.4 + ,542.3 + ,488.7 + ,467.1 + ,531.3 + ,496.1 + ,444 + ,403.4 + ,386.3 + ,394.1 + ,404.1 + ,462.1 + ,448.1 + ,432.3 + ,386.3 + ,395.2 + ,421.9 + ,382.9 + ,384.2 + ,345.5 + ,323.4 + ,372.6 + ,376 + ,462.7 + ,487 + ,444.2 + ,399.3 + ,394.9 + ,455.4 + ,414 + ,375.5 + ,347 + ,339.4 + ,385.8 + ,378.8 + ,451.8 + ,446.1 + ,422.5 + ,383.1 + ,352.8 + ,445.3 + ,367.5 + ,355.1 + ,326.2 + ,319.8 + ,331.8 + ,340.9 + ,394.1 + ,417.2 + ,369.9 + ,349.2 + ,321.4 + ,405.7 + ,342.9 + ,316.5 + ,284.2 + ,270.9 + ,288.8 + ,278.8 + ,324.4 + ,310.9 + ,299 + ,273 + ,279.3 + ,359.2 + ,305 + ,282.1 + ,250.3 + ,246.5 + ,257.9 + ,266.5 + ,315.9 + ,318.4 + ,295.4 + ,266.4 + ,245.8 + ,362.8 + ,324.9 + ,294.2 + ,289.5 + ,295.2 + ,290.3 + ,272 + ,307.4 + ,328.7 + ,292.9 + ,249.1 + ,230.4 + ,361.5 + ,321.7 + ,277.2 + ,260.7 + ,251 + ,257.6 + ,241.8 + ,287.5 + ,292.3 + ,274.7 + ,254.2 + ,230 + ,339 + ,318.2 + ,287 + ,295.8 + ,284 + ,271 + ,262.7 + ,340.6 + ,379.4 + ,373.3 + ,355.2 + ,338.4 + ,466.9 + ,451 + ,422 + ,429.2 + ,425.9 + ,460.7 + ,463.6 + ,541.4 + ,544.2 + ,517.5 + ,469.4 + ,439.4 + ,549 + ,533 + ,506.1 + ,484 + ,457 + ,481.5 + ,469.5 + ,544.7 + ,541.2 + ,521.5 + ,469.7 + ,434.4 + ,542.6 + ,517.3 + ,485.7 + ,465.8 + ,447 + ,426.6 + ,411.6 + ,467.5 + ,484.5 + ,451.2 + ,417.4 + ,379.9 + ,484.7 + ,455 + ,420.8 + ,416.5 + ,376.3 + ,405.6 + ,405.8 + ,500.8 + ,514 + ,475.5 + ,430.1 + ,414.4 + ,538 + ,526 + ,488.5 + ,520.2 + ,504.4 + ,568.5 + ,610.6 + ,818 + ,830.9 + ,835.9 + ,782 + ,762.3 + ,856.9 + ,820.9 + ,769.6 + ,752.2 + ,724.4 + ,723.1 + ,719.5 + ,817.4 + ,803.3 + ,752.5 + ,689 + ,630.4 + ,765.5 + ,757.7 + ,732.2 + ,702.6 + ,683.3 + ,709.5 + ,702.2 + ,784.8 + ,810.9 + ,755.6 + ,656.8 + ,615.1 + ,745.3 + ,694.1 + ,675.7 + ,643.7 + ,622.1 + ,634.6 + ,588 + ,689.7 + ,673.9 + ,647.9 + ,568.8 + ,545.7 + ,632.6 + ,643.8 + ,593.1 + ,579.7 + ,546 + ,562.9 + ,572.5) > par9 = '1' > par8 = '0' > par7 = '1' > par6 = '2' > par5 = '12' > par4 = '1' > par3 = '1' > par2 = '1' > par1 = 'FALSE' > par9 <- '1' > par8 <- '0' > par7 <- '1' > par6 <- '2' > par5 <- '12' > par4 <- '1' > par3 <- '1' > par2 <- '1' > par1 <- 'FALSE' > #'GNU S' R Code compiled by R2WASP v. 1.2.327 () > #Author: root > #To cite this work: Wessa P., (2013), ARIMA Backward Selection (v1.0.5) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_arimabackwardselection.wasp/ > #Source of accompanying publication: Office for Research, Development, and Education > # > library(lattice) > if (par1 == 'TRUE') par1 <- TRUE > if (par1 == 'FALSE') par1 <- FALSE > par2 <- as.numeric(par2) #Box-Cox lambda transformation parameter > 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) #degree (p) of the non-seasonal AR(p) polynomial > par7 <- as.numeric(par7) #degree (q) of the non-seasonal MA(q) polynomial > par8 <- as.numeric(par8) #degree (P) of the seasonal AR(P) polynomial > par9 <- as.numeric(par9) #degree (Q) of the seasonal MA(Q) polynomial > armaGR <- function(arima.out, names, n){ + try1 <- arima.out$coef + try2 <- sqrt(diag(arima.out$var.coef)) + try.data.frame <- data.frame(matrix(NA,ncol=4,nrow=length(names))) + dimnames(try.data.frame) <- list(names,c('coef','std','tstat','pv')) + try.data.frame[,1] <- try1 + for(i in 1:length(try2)) try.data.frame[which(rownames(try.data.frame)==names(try2)[i]),2] <- try2[i] + try.data.frame[,3] <- try.data.frame[,1] / try.data.frame[,2] + try.data.frame[,4] <- round((1-pt(abs(try.data.frame[,3]),df=n-(length(try2)+1)))*2,5) + vector <- rep(NA,length(names)) + vector[is.na(try.data.frame[,4])] <- 0 + maxi <- which.max(try.data.frame[,4]) + continue <- max(try.data.frame[,4],na.rm=TRUE) > .05 + vector[maxi] <- 0 + list(summary=try.data.frame,next.vector=vector,continue=continue) + } > arimaSelect <- function(series, order=c(13,0,0), seasonal=list(order=c(2,0,0),period=12), include.mean=F){ + nrc <- order[1]+order[3]+seasonal$order[1]+seasonal$order[3] + coeff <- matrix(NA, nrow=nrc*2, ncol=nrc) + pval <- matrix(NA, nrow=nrc*2, ncol=nrc) + mylist <- rep(list(NULL), nrc) + names <- NULL + if(order[1] > 0) names <- paste('ar',1:order[1],sep='') + if(order[3] > 0) names <- c( names , paste('ma',1:order[3],sep='') ) + if(seasonal$order[1] > 0) names <- c(names, paste('sar',1:seasonal$order[1],sep='')) + if(seasonal$order[3] > 0) names <- c(names, paste('sma',1:seasonal$order[3],sep='')) + arima.out <- arima(series, order=order, seasonal=seasonal, include.mean=include.mean, method='ML') + mylist[[1]] <- arima.out + last.arma <- armaGR(arima.out, names, length(series)) + mystop <- FALSE + i <- 1 + coeff[i,] <- last.arma[[1]][,1] + pval [i,] <- last.arma[[1]][,4] + i <- 2 + aic <- arima.out$aic + while(!mystop){ + mylist[[i]] <- arima.out + arima.out <- arima(series, order=order, seasonal=seasonal, include.mean=include.mean, method='ML', fixed=last.arma$next.vector) + aic <- c(aic, arima.out$aic) + last.arma <- armaGR(arima.out, names, length(series)) + mystop <- !last.arma$continue + coeff[i,] <- last.arma[[1]][,1] + pval [i,] <- last.arma[[1]][,4] + i <- i+1 + } + list(coeff, pval, mylist, aic=aic) + } > arimaSelectplot <- function(arimaSelect.out,noms,choix){ + noms <- names(arimaSelect.out[[3]][[1]]$coef) + coeff <- arimaSelect.out[[1]] + k <- min(which(is.na(coeff[,1])))-1 + coeff <- coeff[1:k,] + pval <- arimaSelect.out[[2]][1:k,] + aic <- arimaSelect.out$aic[1:k] + coeff[coeff==0] <- NA + n <- ncol(coeff) + if(missing(choix)) choix <- k + layout(matrix(c(1,1,1,2, + 3,3,3,2, + 3,3,3,4, + 5,6,7,7),nr=4), + widths=c(10,35,45,15), + heights=c(30,30,15,15)) + couleurs <- rainbow(75)[1:50]#(50) + ticks <- pretty(coeff) + par(mar=c(1,1,3,1)) + plot(aic,k:1-.5,type='o',pch=21,bg='blue',cex=2,axes=F,lty=2,xpd=NA) + points(aic[choix],k-choix+.5,pch=21,cex=4,bg=2,xpd=NA) + title('aic',line=2) + par(mar=c(3,0,0,0)) + plot(0,axes=F,xlab='',ylab='',xlim=range(ticks),ylim=c(.1,1)) + rect(xleft = min(ticks) + (0:49)/50*(max(ticks)-min(ticks)), + xright = min(ticks) + (1:50)/50*(max(ticks)-min(ticks)), + ytop = rep(1,50), + ybottom= rep(0,50),col=couleurs,border=NA) + axis(1,ticks) + rect(xleft=min(ticks),xright=max(ticks),ytop=1,ybottom=0) + text(mean(coeff,na.rm=T),.5,'coefficients',cex=2,font=2) + par(mar=c(1,1,3,1)) + image(1:n,1:k,t(coeff[k:1,]),axes=F,col=couleurs,zlim=range(ticks)) + for(i in 1:n) for(j in 1:k) if(!is.na(coeff[j,i])) { + if(pval[j,i]<.01) symb = 'green' + else if( (pval[j,i]<.05) & (pval[j,i]>=.01)) symb = 'orange' + else if( (pval[j,i]<.1) & (pval[j,i]>=.05)) symb = 'red' + else symb = 'black' + polygon(c(i+.5 ,i+.2 ,i+.5 ,i+.5), + c(k-j+0.5,k-j+0.5,k-j+0.8,k-j+0.5), + col=symb) + if(j==choix) { + rect(xleft=i-.5, + xright=i+.5, + ybottom=k-j+1.5, + ytop=k-j+.5, + lwd=4) + text(i, + k-j+1, + round(coeff[j,i],2), + cex=1.2, + font=2) + } + else{ + rect(xleft=i-.5,xright=i+.5,ybottom=k-j+1.5,ytop=k-j+.5) + text(i,k-j+1,round(coeff[j,i],2),cex=1.2,font=1) + } + } + axis(3,1:n,noms) + par(mar=c(0.5,0,0,0.5)) + plot(0,axes=F,xlab='',ylab='',type='n',xlim=c(0,8),ylim=c(-.2,.8)) + cols <- c('green','orange','red','black') + niv <- c('0','0.01','0.05','0.1') + for(i in 0:3){ + polygon(c(1+2*i ,1+2*i ,1+2*i-.5 ,1+2*i), + c(.4 ,.7 , .4 , .4), + col=cols[i+1]) + text(2*i,0.5,niv[i+1],cex=1.5) + } + text(8,.5,1,cex=1.5) + text(4,0,'p-value',cex=2) + box() + residus <- arimaSelect.out[[3]][[choix]]$res + par(mar=c(1,2,4,1)) + acf(residus,main='') + title('acf',line=.5) + par(mar=c(1,2,4,1)) + pacf(residus,main='') + title('pacf',line=.5) + par(mar=c(2,2,4,1)) + qqnorm(residus,main='') + title('qq-norm',line=.5) + qqline(residus) + residus + } > if (par2 == 0) x <- log(x) > if (par2 != 0) x <- x^par2 > (selection <- arimaSelect(x, order=c(par6,par3,par7), seasonal=list(order=c(par8,par4,par9), period=par5))) [[1]] [,1] [,2] [,3] [,4] [1,] 0.1978422 0.2350068 -0.06682547 -0.6943204 [2,] 0.1350038 0.2464071 0.00000000 -0.6952818 [3,] NA NA NA NA [4,] NA NA NA NA [5,] NA NA NA NA [6,] NA NA NA NA [7,] NA NA NA NA [8,] NA NA NA NA [[2]] [,1] [,2] [,3] [,4] [1,] 0.55572 0.00448 0.84953 0 [2,] 0.00886 0.00000 NA 0 [3,] NA NA NA NA [4,] NA NA NA NA [5,] NA NA NA NA [6,] NA NA NA NA [7,] NA NA NA NA [8,] NA NA NA NA [[3]] [[3]][[1]] Call: arima(x = series, order = order, seasonal = seasonal, include.mean = include.mean, method = "ML") Coefficients: ar1 ar2 ma1 sma1 0.1978 0.2350 -0.0668 -0.6943 s.e. 0.3355 0.0822 0.3520 0.0385 sigma^2 estimated as 449.6: log likelihood = -1609.89, aic = 3229.77 [[3]][[2]] Call: arima(x = series, order = order, seasonal = seasonal, include.mean = include.mean, method = "ML") Coefficients: ar1 ar2 ma1 sma1 0.1978 0.2350 -0.0668 -0.6943 s.e. 0.3355 0.0822 0.3520 0.0385 sigma^2 estimated as 449.6: log likelihood = -1609.89, aic = 3229.77 [[3]][[3]] NULL [[3]][[4]] NULL $aic [1] 3229.775 3227.810 > postscript(file="/var/wessaorg/rcomp/tmp/1r11l1385133095.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > resid <- arimaSelectplot(selection) > dev.off() null device 1 > resid Time Series: Start = 1 End = 372 Frequency = 1 [1] 0.135735011 0.096024059 0.049255374 0.015634844 -0.023075919 [6] 0.017042382 0.014873407 -0.003244155 -0.019624935 -0.047524262 [11] -0.015865845 -0.128516011 -0.535786078 1.803328556 5.247990770 [16] 9.686520004 49.056807573 -4.945025608 21.003643832 -27.719204114 [21] -17.488214184 44.660340093 -42.989743133 -7.793193482 24.594161022 [26] -30.282408148 -31.572230652 -33.084944042 -17.736781138 2.984073063 [31] -32.655807548 -27.317428584 27.445210999 -26.616487886 28.072372215 [36] -4.652289689 -65.309569324 -33.794147092 25.054578823 8.505471731 [41] 2.491557389 -0.544447090 -10.398345796 20.841104220 26.953317356 [46] -0.610311252 1.791491296 -34.065266314 -15.230129821 -0.514117803 [51] -3.105479624 23.834816089 12.680405010 -17.958935947 2.607115294 [56] 24.593381643 -12.577217808 -10.920005429 -3.050449833 -3.555997658 [61] 3.471437728 -30.100487350 17.973223680 29.534677662 -14.491801906 [66] -18.075552150 -0.949562378 16.181157959 23.267202565 9.537663226 [71] 21.044837630 27.208147058 49.457766730 20.075752460 8.169870816 [76] -10.204402167 -9.956972155 -27.478801027 2.811928945 13.919274665 [81] 1.581458363 -36.847091722 -1.849764213 -11.695995888 -6.542240037 [86] -19.748569999 -6.244090999 16.433385724 -27.123131847 1.927634518 [91] -16.416119203 16.976201652 -10.758724822 19.905920032 3.227273156 [96] -2.581693055 -28.557460206 -2.857926195 25.954704040 -19.969624510 [101] 33.658594223 17.306864215 -23.379935017 -32.981553698 -3.158219762 [106] 10.388164585 30.026159310 -2.386848449 -17.655712992 -18.043731380 [111] -8.660399620 12.075721813 19.470305207 20.478317496 -25.336631395 [116] -4.377026190 14.368475308 14.624900785 29.848638653 6.911554878 [121] 40.439303219 53.314778355 -0.471752892 -4.988428454 -20.530880567 [126] 3.741661431 5.731646158 -19.633133011 -44.116390844 -5.966566438 [131] -25.351418396 28.266794848 -9.368775017 -20.195026003 -23.277840699 [136] -46.355135598 6.137161027 25.390016850 -0.747939288 8.886169111 [141] 7.143705571 19.450168591 4.841486504 -34.079791812 -12.113911361 [146] -30.103864904 55.849211508 -16.537701455 -13.847182258 45.935559180 [151] -16.727607110 7.854690672 -18.353101205 33.373900190 9.243141560 [156] 33.665349334 9.306772735 15.677339260 -26.874942963 -16.671031349 [161] 2.685555036 17.003149658 -16.299371820 -24.867891109 -7.379574055 [166] -7.394137522 -22.814455996 -2.679914208 -7.534151486 -20.840975788 [171] 2.299037013 6.768249206 30.370947250 -31.609570330 -17.766470149 [176] 45.267156842 -8.716529916 -23.298963463 24.888298872 -12.754548965 [181] 14.317315984 21.009031423 -37.354666067 -0.462653499 13.569513320 [186] 13.723416666 -15.913214264 -16.077807755 9.411374310 6.691812705 [191] 10.742663820 -22.546048509 -1.958619154 -11.053724698 0.705426936 [196] 10.210707058 -21.374865314 43.301896113 -45.436057738 12.320161545 [201] 11.094300659 0.096411077 -27.388579529 4.640933776 -14.904674278 [206] 20.353691904 -22.381897465 22.181714828 -9.462403621 17.335497638 [211] -16.362980994 -5.471764975 2.610381737 -3.210612485 -11.171286123 [216] -14.899160367 -16.767315032 -16.904733880 26.812823234 14.529088747 [221] 20.201101796 3.924479792 -10.446440700 -0.905441983 -0.207693044 [226] 6.214363423 -15.689195142 6.778512874 -8.849917206 -0.673648496 [231] 4.197510128 4.560208457 -10.041252336 44.243501477 10.803065929 [236] -19.165623794 23.429606147 11.861615233 -34.937175697 -22.808016531 [241] -12.830774824 26.976937490 -8.480919532 -14.280999456 -0.301613962 [246] 48.367093519 3.544031108 -30.309183967 6.508209808 -2.238788093 [251] -7.637703700 -10.881514338 -1.474759445 0.102117983 11.910491307 [256] 14.850719485 -12.941241879 6.243919035 25.298643637 -4.783476675 [261] 23.808987155 -10.496355676 -31.030761842 2.596695317 34.976768195 [266] 28.343598167 7.365180503 2.385296625 -5.292416017 22.054014280 [271] 18.052452852 -6.640773776 13.122450359 0.783917042 25.488460640 [276] 4.691577262 10.928960495 -19.825282712 -10.980313793 -16.883543296 [281] -7.337151529 5.829521882 18.641784396 2.358730838 -20.115039141 [286] -19.805504622 17.611830925 -4.040809271 9.868907946 -15.896697793 [291] 1.091122543 -14.744558283 -11.509309713 4.136960698 5.171860384 [296] -1.412678144 -8.854704381 -4.540502991 -34.195547115 -1.951850127 [301] -1.245432031 13.444846015 -10.726507658 4.868137223 -9.546777773 [306] -4.426448595 -0.107140971 -2.158447804 10.921724200 -25.887191693 [311] 25.005799125 12.298818180 24.460670070 -4.080319869 -21.981084653 [316] -7.269352736 17.976830879 15.784009758 10.043182641 -12.042476755 [321] 39.371839171 2.203491018 40.222813771 39.347929147 114.974518451 [326] -28.669001348 0.156176267 -21.052571667 -1.129018302 -16.161455187 [331] -12.161710916 -11.876626888 -13.627855256 -0.250400291 -23.678512589 [336] -6.069567619 -7.491294460 -20.337173643 -24.645431546 -8.486641914 [341] -24.261558030 37.661992534 24.151675380 4.635121499 -32.532817894 [346] 3.134930081 12.466061164 -13.420749354 -26.847259082 28.529498500 [351] -23.119370697 -50.150888040 5.138473901 27.670771423 -29.531526569 [356] 16.962088779 -15.275146615 -0.828382751 -4.226318668 -46.228176114 [361] 8.987671223 -14.788134607 14.736763618 -9.013286195 13.109156006 [366] -31.759507995 42.684878847 -18.469785390 -2.301229925 -8.209349047 [371] -1.021812867 26.203721654 > postscript(file="/var/wessaorg/rcomp/tmp/2git61385133095.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > acf(resid,length(resid)/2, main='Residual Autocorrelation Function') > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/3eu5f1385133095.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > pacf(resid,length(resid)/2, main='Residual Partial Autocorrelation Function') > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/4x1io1385133095.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > cpgram(resid, main='Residual Cumulative Periodogram') > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/57obi1385133095.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > hist(resid, main='Residual Histogram', xlab='values of Residuals') > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6v3si1385133095.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > densityplot(~resid,col='black',main='Residual Density Plot', xlab='values of Residuals') > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7d5s21385133095.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > qqnorm(resid, main='Residual Normal Q-Q Plot') > qqline(resid) > dev.off() null device 1 > ncols <- length(selection[[1]][1,]) > nrows <- length(selection[[2]][,1])-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,'ARIMA Parameter Estimation and Backward Selection', ncols+1,TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Iteration', header=TRUE) > for (i in 1:ncols) { + a<-table.element(a,names(selection[[3]][[1]]$coef)[i],header=TRUE) + } > a<-table.row.end(a) > for (j in 1:nrows) { + a<-table.row.start(a) + mydum <- 'Estimates (' + mydum <- paste(mydum,j) + mydum <- paste(mydum,')') + a<-table.element(a,mydum, header=TRUE) + for (i in 1:ncols) { + a<-table.element(a,round(selection[[1]][j,i],4)) + } + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'(p-val)', header=TRUE) + for (i in 1:ncols) { + mydum <- '(' + mydum <- paste(mydum,round(selection[[2]][j,i],4),sep='') + mydum <- paste(mydum,')') + a<-table.element(a,mydum) + } + a<-table.row.end(a) + } > a<-table.end(a) > table.save(a,file="/var/wessaorg/rcomp/tmp/8cf851385133095.tab") > a<-table.start() > a<-table.row.start(a) > a<-table.element(a,'Estimated ARIMA Residuals', 1,TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Value', 1,TRUE) > a<-table.row.end(a) > for (i in (par4*par5+par3):length(resid)) { + a<-table.row.start(a) + a<-table.element(a,resid[i]) + a<-table.row.end(a) + } > a<-table.end(a) > table.save(a,file="/var/wessaorg/rcomp/tmp/9zq7s1385133095.tab") > > try(system("convert tmp/1r11l1385133095.ps tmp/1r11l1385133095.png",intern=TRUE)) character(0) > try(system("convert tmp/2git61385133095.ps tmp/2git61385133095.png",intern=TRUE)) character(0) > try(system("convert tmp/3eu5f1385133095.ps tmp/3eu5f1385133095.png",intern=TRUE)) character(0) > try(system("convert tmp/4x1io1385133095.ps tmp/4x1io1385133095.png",intern=TRUE)) character(0) > try(system("convert tmp/57obi1385133095.ps tmp/57obi1385133095.png",intern=TRUE)) character(0) > try(system("convert tmp/6v3si1385133095.ps tmp/6v3si1385133095.png",intern=TRUE)) character(0) > try(system("convert tmp/7d5s21385133095.ps tmp/7d5s21385133095.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 8.131 1.305 9.447