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(1356.876334 + ,1267.205322 + ,1296.765977 + ,1088.768988 + ,974.9813884 + ,901.3596576 + ,697.4384802 + ,619.518781 + ,446.3076104 + ,279.7073872 + ,388.5496968 + ,290.3616669 + ,278.7900756 + ,433.3678289 + ,436.029714 + ,642.0796877 + ,800.8666721 + ,1005.060868 + ,986.1196671 + ,1320.620732 + ,1293.652614 + ,1315.564345 + ,1438.509653 + ,1311.68492 + ,1281.851742 + ,1229.184547 + ,1157.483378 + ,1049.930474 + ,720.8534348 + ,756.8141819 + ,587.8054359 + ,440.0632504 + ,476.8424862 + ,376.9041092 + ,408.9909215 + ,335.6074609 + ,510.7385144 + ,784.0262709 + ,868.9048671 + ,930.5891366 + ,1232.387738 + ,1433.973937 + ,1441.341759 + ,1560.894767 + ,1570.121112 + ,1539.736335 + ,1509.516021 + ,1264.261299 + ,1280.1511 + ,1104.198071 + ,867.0732077 + ,832.9038416 + ,551.1656185 + ,578.9382082 + ,548.7690841 + ,526.7505509 + ,543.7872669 + ,387.4285031 + ,583.0257696 + ,858.5103593 + ,835.2939603 + ,1234.576103 + ,1307.198241 + ,1550.368145 + ,1513.93417 + ,1607.433912 + ,1768.513076 + ,1778.655313 + ,1668.394241 + ,1383.577733 + ,1271.618447 + ,1140.579064 + ,998.7028247 + ,804.5968421 + ,743.1134557 + ,661.133487 + ,635.0605076 + ,334.5931783 + ,502.1494165 + ,450.8321675 + ,700.3681247 + ,799.3587889 + ,1068.293463 + ,1229.161035 + ,1369.983001 + ,1586.670588 + ,1649.664042 + ,1871.680788 + ,1816.035687 + ,1919.694672 + ,1817.473725 + ,1707.303794 + ,1606.456459 + ,1446.737592 + ,1005.045182 + ,913.67958 + ,694.7422417 + ,647.2193014 + ,603.2233095 + ,561.3616255 + ,477.9286605 + ,648.8516322 + ,676.4550378 + ,1016.256499 + ,1139.927185 + ,1269.321991 + ,1546.025319 + ,1753.304467 + ,1958.22963 + ,2094.065774 + ,1977.440699 + ,2027.739055 + ,1842.633768 + ,1852.639287 + ,1706.985147 + ,1471.71997 + ,1159.935346 + ,888.3265125 + ,747.4889418 + ,573.6363 + ,696.6030203 + ,736.0360216 + ,625.9859074 + ,668.0129992 + ,878.1341576 + ,925.7355157 + ,1384.068603 + ,1504.264376 + ,1677.525248 + ,1935.129054 + ,1995.385689 + ,2158.635275 + ,2278.786793 + ,2004.468115 + ,2055.40499 + ,1967.431468 + ,1770.334016 + ,1699.341376 + ,1476.810831 + ,970.7915825 + ,997.474492 + ,652.0843291 + ,708.677725 + ,656.5517255 + ,770.8461221 + ,901.3881145 + ,832.0016083 + ,1028.128263 + ,1296.071512 + ,1785.233557 + ,1804.294853 + ,2165.319782 + ,2274.425758 + ,2444.192672 + ,2254.896853 + ,2475.21364 + ,2096.602738 + ,2180.683121 + ,2069.506046 + ,1776.663609 + ,1612.449679 + ,1322.927331 + ,914.8881288 + ,749.3597793 + ,985.6467572 + ,880.7232311 + ,819.4581121 + ,760.5542696 + ,985.0475722 + ,1295.758114 + ,1683.545809 + ,1787.214405 + ,1972.790239 + ,2134.412385 + ,2263.189757 + ,2432.266646 + ,2369.774565 + ,2360.715385 + ,2432.992026 + ,2437.706015 + ,1921.308588 + ,1960.743986 + ,1481.140265 + ,1436.91711 + ,1299.84893 + ,985.736701 + ,805.8439046 + ,736.9963963 + ,898.3310247 + ,1065.843227 + ,1113.559476 + ,1211.918524 + ,1462.155718 + ,1801.38398 + ,2045.731198 + ,2405.387519 + ,2376.281401 + ,2542.194732 + ,2535.172687 + ,2518.76254 + ,2467.712934 + ,2483.547793 + ,2111.5245 + ,1987.469819 + ,1900.284914 + ,1545.174509 + ,1241.063215 + ,1244.17204 + ,1001.510714 + ,1004.787213 + ,1064.602774 + ,1250.752996 + ,1244.505238 + ,1565.513983 + ,1904.45973 + ,2200.393469 + ,2489.302736 + ,2382.022655 + ,2740.656964 + ,2692.201467 + ,2707.985974 + ,2793.734301 + ,2909.368555 + ,2611.616903 + ,2367.927913 + ,2036.392713 + ,1794.090508 + ,1658.074271 + ,1450.206111 + ,1159.117531 + ,1144.297116 + ,1188.107289 + ,1082.864685 + ,1152.30001 + ,1370.470201 + ,1560.414285 + ,1878.82661 + ,2213.171169 + ,2306.794427 + ,2878.274067 + ,3043.563683 + ,3163.511145 + ,3218.690493 + ,3177.601319 + ,2941.518453 + ,2922.823356 + ,2325.88093 + ,2414.009426 + ,1874.014382 + ,1866.949762 + ,1330.453111 + ,1413.735476 + ,988.2221384 + ,1046.533458 + ,1398.652585 + ,1444.958119 + ,1637.387943 + ,1926.364707 + ,2088.421239 + ,2250.892557 + ,2803.393628 + ,2920.006864 + ,3028.392467 + ,3284.085805 + ,3116.539112 + ,3120.244711 + ,2946.135624 + ,2740.67997 + ,2810.140837 + ,2233.823039 + ,2114.011418 + ,2076.542437 + ,1571.481405 + ,1567.958655 + ,1217.444043 + ,1136.643661 + ,1481.287919 + ,1528.477337 + ,1797.720002 + ,1819.469046 + ,2395.358987 + ,2707.314708 + ,2921.060577 + ,3246.433366 + ,3051.477548 + ,3444.481052 + ,3432.580153 + ,3421.04804 + ,3381.830601 + ,3169.679136 + ,2872.11508 + ,2601.76563 + ,2143.011809 + ,2159.598897 + ,1645.12941 + ,1622.54215 + ,1350.064447 + ,1372.486802 + ,1475.078831 + ,1356.08523 + ,1974.230192 + ,1835.493872 + ,2495.225532 + ,2813.660064 + ,3199.803837 + ,3128.428211 + ,3614.588977 + ,3741.816099 + ,3711.62971 + ,3501.116488 + ,3620.888016 + ,3348.935195) > par9 = '1' > par8 = '2' > par7 = '1' > par6 = '3' > par5 = '12' > par4 = '0' > par3 = '1' > par2 = '0.5' > par1 = 'FALSE' > 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] [,5] [,6] [,7] [1,] -0.1235382 0.2870331 0.1757423 -0.01949244 -0.4752536 0.2037007 0.1932868 [2,] -0.1421908 0.2854274 0.1809053 0.00000000 -0.4761955 0.2026367 0.1940168 [3,] -0.1533887 0.2716049 0.1740479 0.00000000 -0.3085534 0.2751930 0.0000000 [4,] NA NA NA NA NA NA NA [5,] NA NA NA NA NA NA NA [6,] NA NA NA NA NA NA NA [7,] NA NA NA NA NA NA NA [8,] NA NA NA NA NA NA NA [9,] NA NA NA NA NA NA NA [10,] NA NA NA NA NA NA NA [11,] NA NA NA NA NA NA NA [12,] NA NA NA NA NA NA NA [13,] NA NA NA NA NA NA NA [14,] NA NA NA NA NA NA NA [[2]] [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0.68116 3e-05 0.08027 0.94928 0.00078 0.01840 0.17125 [2,] 0.03085 1e-05 0.00165 NA 0.00073 0.01694 0.16918 [3,] 0.02289 5e-05 0.00266 NA 0.00001 0.00000 NA [4,] NA NA NA NA NA NA NA [5,] NA NA NA NA NA NA NA [6,] NA NA NA NA NA NA NA [7,] NA NA NA NA NA NA NA [8,] NA NA NA NA NA NA NA [9,] NA NA NA NA NA NA NA [10,] NA NA NA NA NA NA NA [11,] NA NA NA NA NA NA NA [12,] NA NA NA NA NA NA NA [13,] NA NA NA NA NA NA NA [14,] NA NA NA NA NA NA NA [[3]] [[3]][[1]] Call: arima(x = series, order = order, seasonal = seasonal, include.mean = include.mean, method = "ML") Coefficients: ar1 ar2 ar3 ma1 sar1 sar2 sma1 -0.1235 0.2870 0.1757 -0.0195 -0.4753 0.2037 0.1933 s.e. 0.3004 0.0679 0.1001 0.3062 0.1400 0.0859 0.1409 sigma^2 estimated as 5.06: log likelihood = -695.67, aic = 1407.33 [[3]][[2]] Call: arima(x = series, order = order, seasonal = seasonal, include.mean = include.mean, method = "ML") Coefficients: ar1 ar2 ar3 ma1 sar1 sar2 sma1 -0.1235 0.2870 0.1757 -0.0195 -0.4753 0.2037 0.1933 s.e. 0.3004 0.0679 0.1001 0.3062 0.1400 0.0859 0.1409 sigma^2 estimated as 5.06: log likelihood = -695.67, aic = 1407.33 [[3]][[3]] Call: arima(x = series, order = order, seasonal = seasonal, include.mean = include.mean, fixed = last.arma$next.vector, method = "ML") Coefficients: ar1 ar2 ar3 ma1 sar1 sar2 sma1 -0.1422 0.2854 0.1809 0 -0.4762 0.2026 0.1940 s.e. 0.0656 0.0640 0.0570 0 0.1396 0.0844 0.1408 sigma^2 estimated as 5.06: log likelihood = -695.67, aic = 1405.34 [[3]][[4]] NULL [[3]][[5]] NULL [[3]][[6]] NULL [[3]][[7]] NULL $aic [1] 1407.333 1405.337 1405.052 > postscript(file="/var/fisher/rcomp/tmp/1haeu1386182322.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 = 312 Frequency = 1 [1] 0.03683578 -1.01906390 0.20816181 -2.27886656 -1.83765124 -0.59449790 [7] -2.40441268 -1.21595268 -2.42855507 -3.40046058 3.15508360 -0.37355334 [13] -0.76588445 3.59973623 1.20826233 2.19729052 1.88934281 2.17280300 [19] -2.49057505 2.71040404 -1.27837150 -2.58907920 2.33984394 -1.61763854 [25] -1.41555898 1.02889905 -0.39405483 0.23335228 -3.92711639 1.45998979 [31] -0.97315556 -1.52676013 1.89955118 -0.04073670 0.05766258 -1.60028866 [37] 4.07214853 5.04197077 0.85524932 -2.50431949 0.98534969 2.30658658 [43] -1.13894516 -1.84272354 0.05578312 -0.96521926 -0.56448586 -3.24658615 [49] 1.39361818 0.68973358 -2.98291313 -0.16391565 -1.43764634 1.47720705 [55] 1.09283275 1.15994464 0.02978365 -3.38215003 3.51255729 6.09045932 [61] -1.43806073 1.75006326 -0.33234944 1.69912949 -3.69496555 -0.53190838 [67] 2.19118821 0.04870038 -1.87256490 -4.99101231 -0.35722118 1.87469197 [73] -1.18166835 -0.90577726 0.70939856 0.15951530 1.00197623 -6.36559974 [79] 3.71435989 1.48487550 4.43347933 1.77391849 1.85334592 -0.58657520 [85] 0.35355830 -0.29225466 -0.44909341 1.04832238 -0.83014980 -1.57666634 [91] -0.67127717 -1.32123373 0.70458739 -0.09922919 -4.43513703 -0.55439589 [97] -1.36263559 1.48112688 0.66423333 0.60632709 -1.88955706 5.44794503 [103] 0.51622840 4.39239667 0.11289616 -0.83217482 -0.34168321 1.25371806 [109] 0.56738539 -0.11788685 -2.21582170 -0.93948300 -2.09063752 0.58023760 [115] -0.22310099 -0.85871705 -3.10004395 -3.04631733 1.10513135 -0.62275845 [121] 4.35208192 2.71481177 -2.78937710 -0.16744349 4.17270530 0.55096362 [127] 4.77553502 -0.62005022 -1.49154398 0.41528461 -1.10967484 -0.52858090 [133] 1.30444061 -2.84707914 -0.54867766 -0.21445100 -0.38068389 -0.38018998 [139] -0.07279149 -5.53713991 1.64649539 -1.94185664 1.99675701 1.56187491 [145] 2.20944741 1.07047844 -1.01746526 1.95183559 2.53600662 5.40375256 [151] -2.71862636 -1.00484904 0.31863516 -0.86798132 -2.52171183 1.23273846 [157] -2.66235703 1.80002817 -0.66109620 -2.41430271 -0.31000878 -0.83395361 [163] -4.82072047 0.07120947 6.17039971 1.98015385 -3.03982009 -1.22743346 [169] 2.60280525 4.78003345 5.01293253 -1.44059480 -1.85997052 -1.63186523 [175] -0.76770747 -0.38897880 0.46777658 -1.08699543 0.82637051 -0.40956665 [181] -3.51070087 1.26118373 -2.77650797 0.34906631 0.48454640 -2.41225926 [187] -1.39975472 1.03614929 2.50809812 3.58439421 1.03213368 0.78129416 [193] 0.02909416 2.52911581 -0.26652421 2.08123329 -1.58738810 -1.42614655 [199] -1.77211328 -1.01086560 0.99119583 1.53154895 -3.75766642 -1.95779168 [205] 2.45130316 -1.74653903 -2.24259910 1.70755550 -1.92342835 1.30741333 [211] 2.71550199 3.42372633 -1.43675398 2.29355430 3.08163265 2.07111738 [217] 0.38978291 -4.42017455 -0.03261981 -0.59418393 -0.89083409 0.19368113 [223] 1.73682306 -1.81273878 -2.84585208 -2.15936850 0.09302383 0.65478756 [229] -0.77585527 -3.02066499 2.03345305 2.08877131 -0.51243066 0.73967591 [235] 3.40716275 1.14499292 2.10508435 1.16885365 -1.88926376 3.07126868 [241] 0.52628540 -1.07041097 -1.47568183 -0.17612574 -2.59607569 -0.35079531 [247] -4.40626481 2.26826618 -2.26532476 1.73998689 -4.47291405 2.67819410 [253] -3.22608795 1.60686038 6.58335639 1.34923759 0.37403709 2.39810746 [259] -0.84905740 -0.20545247 2.50767119 0.05103514 -2.35821666 0.37253912 [265] -3.22625940 -0.77417475 0.52827938 -0.93647081 1.71292770 -3.91065650 [271] -0.01915561 1.14183431 -2.05351987 -0.02576432 -1.77788563 -0.55799795 [277] 6.62708136 1.95570769 0.02845095 -1.47443919 5.14457941 1.23307814 [283] -0.60839579 1.30135077 -5.17191093 1.53805619 -0.55376472 -1.26283959 [289] 0.93760262 -0.85206330 -1.47882861 -1.85846543 -2.63076793 3.05051817 [295] -3.26890111 -0.18834969 -1.15999193 1.71369202 3.33647384 -0.80869941 [301] 5.10011890 -1.52187984 3.47042679 2.47067033 -0.22926283 -3.21482807 [307] 1.10463275 0.83071787 -1.37198280 -3.13097191 1.08886896 -1.69814462 > postscript(file="/var/fisher/rcomp/tmp/2a0ki1386182322.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/fisher/rcomp/tmp/35e9q1386182322.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/fisher/rcomp/tmp/4u90s1386182322.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/fisher/rcomp/tmp/5vl4h1386182322.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/fisher/rcomp/tmp/6jgk51386182322.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/fisher/rcomp/tmp/72orl1386182322.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/fisher/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/fisher/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/fisher/rcomp/tmp/8jdhd1386182323.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/fisher/rcomp/tmp/90opv1386182323.tab") > > try(system("convert tmp/1haeu1386182322.ps tmp/1haeu1386182322.png",intern=TRUE)) character(0) > try(system("convert tmp/2a0ki1386182322.ps tmp/2a0ki1386182322.png",intern=TRUE)) character(0) > try(system("convert tmp/35e9q1386182322.ps tmp/35e9q1386182322.png",intern=TRUE)) character(0) > try(system("convert tmp/4u90s1386182322.ps tmp/4u90s1386182322.png",intern=TRUE)) character(0) > try(system("convert tmp/5vl4h1386182322.ps tmp/5vl4h1386182322.png",intern=TRUE)) character(0) > try(system("convert tmp/6jgk51386182322.ps tmp/6jgk51386182322.png",intern=TRUE)) character(0) > try(system("convert tmp/72orl1386182322.ps tmp/72orl1386182322.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 17.326 3.052 20.357