R version 2.8.0 (2008-10-20) Copyright (C) 2008 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(358.59 + ,362.96 + ,362.42 + ,364.97 + ,364.04 + ,361.06 + ,358.48 + ,352.96 + ,359.59 + ,360.39 + ,357.40 + ,362.93 + ,364.55 + ,365.73 + ,364.70 + ,364.65 + ,359.43 + ,362.14 + ,356.97 + ,354.82 + ,353.17 + ,357.06 + ,356.18 + ,355.01 + ,355.65 + ,357.31 + ,357.07 + ,357.91 + ,358.48 + ,358.97 + ,351.77 + ,352.16 + ,359.08 + ,360.35 + ,359.53 + ,359.30 + ,358.41 + ,359.68 + ,355.31 + ,357.08 + ,349.71 + ,354.13 + ,345.49 + ,341.69 + ,344.25 + ,340.17 + ,342.47 + ,344.43 + ,333.23 + ,339.72 + ,342.61 + ,346.36 + ,339.09 + ,339.73 + ,341.12 + ,335.94 + ,333.46 + ,335.66 + ,341.12 + ,342.21 + ,342.62 + ,346.06 + ,344.43 + ,346.65 + ,343.74 + ,335.67 + ,342.75 + ,341.77 + ,345.84 + ,346.52 + ,350.79 + ,345.44 + ,345.87 + ,338.48 + ,337.21 + ,340.81 + ,339.86 + ,342.86 + ,343.33 + ,341.73 + ,351.38 + ,351.13 + ,345.99 + ,347.55 + ,346.02 + ,345.29 + ,347.03 + ,348.01 + ,345.48 + ,349.40 + ,351.05 + ,349.70 + ,350.86 + ,354.45 + ,355.30 + ,357.48 + ,355.24 + ,351.79 + ,355.22 + ,351.02 + ,350.28 + ,350.17 + ,348.16 + ,340.30 + ,343.75 + ,344.71 + ,344.13 + ,342.14 + ,345.04 + ,346.02 + ,346.43 + ,347.07 + ,339.33 + ,339.10 + ,337.19 + ,339.58 + ,327.85 + ,326.81 + ,321.73 + ,320.45 + ,327.69 + ,323.95 + ,320.47 + ,322.13 + ,316.34 + ,314.78 + ,308.90 + ,308.62 + ,314.41 + ,306.88 + ,310.60 + ,321.60 + ,321.50 + ,325.68 + ,324.35 + ,320.01 + ,326.88 + ,332.39 + ,331.48 + ,332.62 + ,324.79 + ,327.12 + ,328.91 + ,328.37 + ,324.83 + ,325.90 + ,326.18 + ,328.94 + ,333.78 + ,328.06 + ,325.87 + ,325.41 + ,318.86 + ,319.13 + ,310.16 + ,311.73 + ,306.54 + ,311.16 + ,311.98 + ,306.72 + ,308.05 + ,300.76 + ,301.90 + ,293.09 + ,292.76 + ,294.58 + ,289.90 + ,296.69 + ,297.21 + ,293.31 + ,296.25 + ,298.60 + ,296.87 + ,301.02 + ,304.73 + ,301.92 + ,295.72 + ,293.18 + ,298.35 + ,297.99 + ,299.85 + ,299.85 + ,304.45 + ,299.45 + ,298.14 + ,298.78 + ,297.02 + ,301.33 + ,294.96 + ,296.69 + ,300.73 + ,301.96 + ,297.38 + ,293.87 + ,285.96 + ,285.41 + ,283.70 + ,284.76 + ,277.11 + ,274.73 + ,274.73 + ,274.73 + ,274.73 + ,274.69 + ,275.42 + ,264.15 + ,276.24 + ,268.88 + ,277.97 + ,280.49 + ,281.09 + ,276.16 + ,272.58 + ,270.94 + ,284.31 + ,283.94 + ,284.18 + ,282.83 + ,283.84 + ,282.71 + ,279.29 + ,280.70 + ,274.47 + ,273.44 + ,275.49 + ,279.46 + ,280.19 + ,288.21 + ,284.80 + ,281.41 + ,283.39 + ,287.97 + ,290.77 + ,290.60 + ,289.67 + ,289.84 + ,298.55 + ,296.07 + ,297.14 + ,295.34 + ,296.25 + ,294.30 + ,296.15 + ,296.49 + ,298.05 + ,301.03 + ,300.52 + ,301.50 + ,296.93 + ,289.84 + ,291.44 + ,286.88 + ,286.74 + ,288.93 + ,292.19 + ,295.39 + ,295.86 + ,293.36 + ,292.86 + ,292.73 + ,296.73 + ,285.02 + ,285.24 + ,288.62 + ,283.36 + ,285.84 + ,291.48 + ,291.41 + ,287.77 + ,284.97 + ,286.05 + ,278.19 + ,281.21 + ,277.92 + ,280.08 + ,269.24 + ,268.48 + ,268.83 + ,269.54 + ,262.37 + ,265.12 + ,265.34 + ,263.32 + ,267.18 + ,260.75 + ,261.78 + ,257.27 + ,255.63 + ,251.39 + ,259.49 + ,261.18 + ,261.65 + ,262.01 + ,265.23 + ,268.10 + ,262.27 + ,263.59 + ,257.85 + ,265.69 + ,271.15 + ,266.69 + ,265.77 + ,262.32 + ,270.48 + ,273.03 + ,269.13 + ,280.65 + ,282.75 + ,281.44 + ,281.99 + ,282.86 + ,287.21 + ,283.11 + ,280.66 + ,282.39 + ,280.83 + ,284.71 + ,279.99 + ,283.50 + ,284.88 + ,288.60 + ,284.80 + ,287.20 + ,286.22 + ,286.54 + ,279.58 + ,283.08 + ,288.88 + ,280.18 + ,284.16 + ,290.57 + ,286.82 + ,273.00 + ,278.69 + ,264.54 + ,271.92 + ,283.60 + ,269.25 + ,263.58 + ,264.16 + ,268.85 + ,269.67 + ,249.41 + ,268.99 + ,268.65 + ,260.16 + ,256.55 + ,251.47 + ,234.93 + ,232.96 + ,215.49 + ,213.68 + ,236.07 + ,235.41 + ,214.77 + ,225.85 + ,224.64 + ,238.26 + ,232.44 + ,222.50 + ,225.28 + ,220.49 + ,216.86 + ,234.70 + ,230.06 + ,238.27 + ,238.56 + ,242.70 + ,249.14 + ,234.89 + ,227.78 + ,234.04 + ,230.70 + ,230.17 + ,218.23 + ,232.20 + ,220.76 + ,215.60 + ,217.69 + ,204.35 + ,191.44 + ,203.84 + ,211.86 + ,210.57 + ,219.57 + ,219.98 + ,226.01 + ,207.04 + ,212.52 + ,217.92 + ,210.45 + ,218.53 + ,223.32 + ,218.76 + ,217.63) > par9 = '1' > par8 = '2' > par7 = '1' > par6 = '3' > par5 = '1' > par4 = '0' > par3 = '1' > par2 = '1' > par1 = 'FALSE' > #'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!) > 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] [1,] -0.4290447 -0.03349329 0.08119122 0.08815884 0.007443966 -0.1546112 [2,] -0.4404518 -0.03459751 0.08107848 0.09758168 0.000000000 -0.1567252 [3,] -0.4118908 -0.02905207 0.07869049 0.00000000 0.000000000 -0.1456011 [4,] -0.4128068 0.00000000 0.09188762 0.00000000 0.000000000 -0.1741347 [5,] -0.2461240 0.00000000 0.07620628 0.00000000 0.000000000 -0.1324861 [6,] -0.2424652 0.00000000 0.00000000 0.00000000 0.000000000 -0.1286289 [7,] NA NA NA NA NA NA [8,] NA NA NA NA NA NA [9,] NA NA NA NA NA NA [10,] NA NA NA NA NA NA [11,] NA NA NA NA NA NA [12,] NA NA NA NA NA NA [13,] NA NA NA NA NA NA [14,] NA NA NA NA NA NA [,7] [1,] 0.08815884 [2,] 0.09758168 [3,] 0.16649983 [4,] 0.16756537 [5,] 0.00000000 [6,] 0.00000000 [7,] NA [8,] NA [9,] NA [10,] NA [11,] NA [12,] NA [13,] NA [14,] NA [[2]] [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0.46647 0.92117 0.64777 0.93596 0.9909 0.63213 0.93596 [2,] 0.40260 0.91715 0.59539 0.91867 NA 0.61627 0.91867 [3,] 0.40903 0.92894 0.59427 NA NA 0.64751 0.73876 [4,] 0.33680 NA 0.18234 NA NA 0.14096 0.69727 [5,] 0.00000 NA 0.11863 NA NA 0.01046 NA [6,] 0.00000 NA NA NA NA 0.01147 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.4290 -0.0335 0.0812 0.0882 0.0074 -0.1546 0.0882 s.e. 0.5886 0.3382 0.1776 1.0965 0.6523 0.3227 1.0965 sigma^2 estimated as 28.59: log likelihood = -1219.64, aic = 2455.28 [[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.4290 -0.0335 0.0812 0.0882 0.0074 -0.1546 0.0882 s.e. 0.5886 0.3382 0.1776 1.0965 0.6523 0.3227 1.0965 sigma^2 estimated as 28.59: log likelihood = -1219.64, aic = 2455.28 [[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.4405 -0.0346 0.0811 0.0976 0 -0.1567 0.0976 s.e. 0.5257 0.3324 0.1526 0.9550 0 0.3125 0.9550 sigma^2 estimated as 28.59: log likelihood = -1219.64, aic = 2453.28 [[3]][[4]] 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.4119 -0.0291 0.0787 0 0 -0.1456 0.1665 s.e. 0.4984 0.3256 0.1476 0 0 0.3182 0.4989 sigma^2 estimated as 28.59: log likelihood = -1219.64, aic = 2451.28 [[3]][[5]] 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.4128 0 0.0919 0 0 -0.1741 0.1676 s.e. 0.4293 0 0.0688 0 0 0.1180 0.4304 sigma^2 estimated as 28.59: log likelihood = -1219.65, aic = 2449.3 [[3]][[6]] 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.2461 0 0.0762 0 0 -0.1325 0 s.e. 0.0503 0 0.0487 0 0 0.0515 0 sigma^2 estimated as 28.59: log likelihood = -1219.69, aic = 2447.37 [[3]][[7]] NULL $aic [1] 2455.276 2453.276 2451.285 2449.296 2447.374 2447.812 Warning messages: 1: In arima(series, order = order, seasonal = seasonal, include.mean = include.mean, : some AR parameters were fixed: setting transform.pars = FALSE 2: In arima(series, order = order, seasonal = seasonal, include.mean = include.mean, : some AR parameters were fixed: setting transform.pars = FALSE 3: In arima(series, order = order, seasonal = seasonal, include.mean = include.mean, : some AR parameters were fixed: setting transform.pars = FALSE 4: In arima(series, order = order, seasonal = seasonal, include.mean = include.mean, : some AR parameters were fixed: setting transform.pars = FALSE 5: In arima(series, order = order, seasonal = seasonal, include.mean = include.mean, : some AR parameters were fixed: setting transform.pars = FALSE > postscript(file="/var/www/html/rcomp/tmp/1yp861229896533.ps",horizontal=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 = 395 Frequency = 1 [1] 0.35858981 4.21451188 0.42054793 3.03370478 -0.56052437 [6] -2.83834291 -3.59195797 -6.50381016 5.03375858 1.82235223 [11] -1.64396871 4.63706987 2.60578532 2.37478952 -0.77412162 [16] -0.18761552 -5.47604520 1.44715849 -5.20431491 -2.82544185 [21] -2.98176622 3.47715585 -0.07480416 -0.74708342 0.08755685 [26] 1.71753599 0.26509247 0.98183896 0.68438704 0.74558098 [31] -7.05726451 -1.33960277 6.03224455 3.33300055 0.38743073 [36] -0.49257124 -1.11455446 0.98636219 -4.17812975 0.90977670 [41] -7.56637230 3.04007635 -8.61854541 -4.97548322 0.26947416 [46] -3.50227103 1.75602621 1.96116227 -10.19663213 3.86696107 [51] 2.95924102 5.78621232 -6.26689154 -0.66541967 0.35532725 [56] -4.46531531 -3.63653075 0.91613278 5.89228480 2.81939650 [61] 1.35803171 3.47231289 -0.79874794 2.20156902 -2.74053994 [66] -8.42517613 4.57672521 -0.16327665 5.09622422 1.27259287 [71] 5.10078592 -4.45788639 -0.34080048 -8.22022364 -2.80550233 [76] 2.24649198 0.14399545 3.29416047 1.00016800 -1.03262283 [81] 9.15132862 1.90221947 -3.88357188 -0.16366759 -1.79997138 [86] -0.77322540 1.29213652 1.43014116 -2.04219611 3.36672886 [91] 2.24426040 -0.33181379 0.86553503 3.65025409 1.90654942 [96] 2.79759763 -1.73372425 -3.76126838 2.15281341 -3.72379326 [101] -1.19088952 -0.97549975 -1.91716848 -8.37165027 1.29636821 [106] 0.86289106 0.45714904 -2.13568582 2.37087360 1.42056725 [111] 1.11247933 0.75016808 -7.55079605 -2.09736341 -3.02984805 [116] 2.22274242 -11.39124599 -3.44897535 -6.99190848 -2.13740406 [121] 6.27314404 -1.78773571 -3.37499874 0.04362800 -5.66650492 [126] -2.68650629 -7.06566099 -1.64631862 4.99332058 -5.82722272 [131] 2.66173814 10.72489330 3.43133453 5.39209155 -0.71800617 [136] -4.14675144 5.33231545 6.68487784 1.50333690 1.35993339 [141] -7.86638958 0.52419599 1.22077048 0.55981664 -3.54885060 [146] 0.12819134 0.07437073 3.10694038 5.51520028 -4.13956480 [151] -3.08773106 -1.97067461 -6.73184519 -1.35644177 -9.69352449 [156] -0.29428186 -5.99911269 4.00782646 1.19831499 -4.12925402 [161] -0.07324898 -7.64288277 -0.29535560 -9.56150679 -1.97638085 [166] 0.50844660 -3.81807210 5.88214187 1.58074662 -2.66506333 [171] 1.73460157 2.58148838 -0.66061987 3.90211875 4.43913335 [176] -1.30132062 -6.60474422 -4.58253793 3.80404284 0.80879870 [181] 2.59545852 0.24728955 4.88776402 -4.00111994 -1.92754953 [186] -0.56418400 -1.55804605 3.97228368 -5.51980245 0.82316399 [191] 3.42748808 2.74903243 -3.86096359 -4.58611395 -9.45177404 [196] -2.80297613 -2.75272164 0.95736378 -7.55624277 -3.96799907 [201] -1.63995496 0.03547450 0.09306183 0.03723648 0.74418416 [206] -11.09562890 9.41464090 -5.90930533 9.37204019 3.24769656 [211] 2.85919930 -4.96683283 -4.74945892 -3.29221450 12.68155326 [216] 2.85342520 2.04154883 -1.88671428 0.74221846 -1.20572167 [221] -3.50171593 0.37208917 -6.27317151 -2.23763851 0.92103917 [226] 4.64424006 2.00937936 8.69916362 -1.50205637 -3.21926866 [231] 0.30412167 4.75949758 4.25639656 1.07403727 -0.76633376 [236] -0.22348375 8.58979981 -0.30146020 1.60787085 -2.23556415 [241] 0.71514419 -2.09909075 1.59413610 0.48650417 1.99197134 [246] 3.31915436 0.43499223 1.16259387 -4.52972192 -8.07846554 [251] -0.82329400 -4.90113470 -0.75113049 1.52778882 4.05085425 [256] 4.28245860 1.64006033 -2.10108311 -1.21466692 -0.63768226 [261] 3.97844844 -10.72567317 -2.10125965 1.71339031 -3.88710559 [266] 1.58321384 5.52437599 1.87381075 -3.05225627 -3.89795336 [271] -0.11338352 -7.86339235 1.35133195 -3.59838174 2.12131185 [276] -10.88682204 -2.91901960 -1.39786641 1.20127595 -6.93755507 [281] 1.17353998 -0.07636573 -1.29245009 3.26491280 -5.68478447 [286] 0.01912250 -5.27888826 -2.31282740 -5.32503348 7.10070413 [291] 3.18296568 2.18947774 0.36299169 3.34000023 3.60794340 [296] -4.72977691 0.12020027 -6.31627183 6.82379758 6.54261630 [301] -1.76835655 -1.64947668 -4.44741599 7.30427839 4.08627990 [306] -1.99585387 10.55148248 4.34230970 0.82074783 -0.02219925 [311] 0.77963054 4.57779994 -2.95927877 -2.90749845 0.38859776 [316] -1.28882718 3.78814441 -4.00574733 2.95508973 1.43193321 [321] 4.74621133 -2.89379125 1.94506569 -1.09037291 0.54850561 [326] -7.15327064 1.91046440 5.70114848 -6.49544101 2.45131544 [331] 6.05434482 -1.30108234 -14.12580881 1.60011569 -14.45720158 [336] 5.18900170 11.41150416 -9.74107801 -8.03364544 -3.08306411 [341] 4.63268051 2.18044138 -19.31722406 14.55493563 1.75333412 [346] -5.14365525 -6.60657135 -6.87394075 -18.09612055 -6.55309836 [351] -19.83898763 -5.61322157 19.76716126 5.53957139 -17.73727592 [356] 5.11277575 -1.17040936 15.46394847 -3.10450408 -9.30684047 [361] -1.14321701 -5.15672845 -4.14476724 16.24951853 -0.42087907 [366] 9.56173030 0.96651093 5.53803215 6.95931521 -12.08226563 [371] -10.02744433 2.33843065 -2.16176284 -0.27772769 -12.64200255 [376] 11.17846411 -9.62362666 -5.57054349 -1.29935760 -12.88991529 [381] -15.83247655 7.47955532 9.99524034 2.86849463 9.33910412 [386] 2.23489401 7.25433361 -17.90490929 1.60506705 3.88173470 [391] -4.59198680 6.65707929 5.74510677 -2.04022682 -2.02451113 > postscript(file="/var/www/html/rcomp/tmp/2ze021229896533.ps",horizontal=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/www/html/rcomp/tmp/3sls31229896533.ps",horizontal=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/www/html/rcomp/tmp/4cxdx1229896533.ps",horizontal=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/www/html/rcomp/tmp/567211229896533.ps",horizontal=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/www/html/rcomp/tmp/6p1z91229896533.ps",horizontal=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/www/html/rcomp/tmp/7l7zt1229896533.ps",horizontal=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/www/html/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/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/www/html/rcomp/tmp/83sh51229896533.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/www/html/rcomp/tmp/92m2q1229896533.tab") > > system("convert tmp/1yp861229896533.ps tmp/1yp861229896533.png") > system("convert tmp/2ze021229896533.ps tmp/2ze021229896533.png") > system("convert tmp/3sls31229896533.ps tmp/3sls31229896533.png") > system("convert tmp/4cxdx1229896533.ps tmp/4cxdx1229896533.png") > system("convert tmp/567211229896533.ps tmp/567211229896533.png") > system("convert tmp/6p1z91229896533.ps tmp/6p1z91229896533.png") > system("convert tmp/7l7zt1229896533.ps tmp/7l7zt1229896533.png") > > > proc.time() user system elapsed 2.517 1.107 2.886