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(353.4 + ,329.08 + ,331.89 + ,339.94 + ,330.8 + ,361.26 + ,358.02 + ,356.15 + ,322.56 + ,306.1 + ,303.99 + ,322.23 + ,330.2 + ,343.91 + ,367.07 + ,375.22 + ,375.35 + ,389.81 + ,371.18 + ,387.18 + ,395.43 + ,387.86 + ,392.46 + ,375.11 + ,417.03 + ,408.79 + ,412.68 + ,403.67 + ,414.95 + ,415.35 + ,408.2 + ,424.19 + ,414.03 + ,417.8 + ,418.66 + ,431.35 + ,435.7 + ,438.78 + ,443.38 + ,451.67 + ,440.19 + ,450.23 + ,450.54 + ,448.13 + ,463.55 + ,458.93 + ,467.83 + ,461.93 + ,466.51 + ,481.6 + ,467.19 + ,445.66 + ,450.91 + ,456.5 + ,444.27 + ,458.28 + ,475.49 + ,462.69 + ,472.26 + ,453.55 + ,459.21 + ,470.42 + ,487.39 + ,500.7 + ,514.76 + ,533.4 + ,544.75 + ,562.06 + ,561.88 + ,584.41 + ,581.5 + ,605.37 + ,615.93 + ,636.02 + ,640.43 + ,645.5 + ,654.17 + ,669.12 + ,670.63 + ,639.95 + ,651.99 + ,687.31 + ,705.27 + ,757.02 + ,740.74 + ,786.16 + ,790.82 + ,757.12 + ,801.34 + ,848.28 + ,885.14 + ,954.29 + ,899.47 + ,947.28 + ,914.62 + ,955.4 + ,970.43 + ,980.28 + ,1049.34 + ,1101.75 + ,1111.75 + ,1090.82 + ,1133.84 + ,1120.67 + ,957.28 + ,1017.01 + ,1098.67 + ,1163.63 + ,1129.23 + ,1279.64 + ,1238.33 + ,1286.37 + ,1335.18 + ,1301.84 + ,1372.71 + ,1328.72 + ,1320.41 + ,1282.71 + ,1362.93 + ,1388.91 + ,1469.25 + ,1394.46 + ,1366.42 + ,1498.58 + ,1452.43 + ,1420.6 + ,1454.6 + ,1430.83 + ,1517.68 + ,1436.52 + ,1429.4 + ,1314.95 + ,1320.28 + ,1366.01 + ,1239.94 + ,1160.33 + ,1249.46 + ,1255.82 + ,1224.42 + ,1211.23 + ,1133.58 + ,1040.94 + ,1059.78 + ,1139.45 + ,1148.08 + ,1130.2 + ,1106.73 + ,1147.39 + ,1076.92 + ,1067.14 + ,989.82 + ,911.62 + ,916.07 + ,815.28 + ,885.76 + ,936.31 + ,879.82 + ,855.7 + ,841.15 + ,848.18 + ,916.92 + ,963.59 + ,974.5 + ,990.31 + ,1008.01 + ,995.97 + ,1050.71 + ,1058.2 + ,1111.92 + ,1131.13 + ,1144.94 + ,1113.89 + ,1107.3 + ,1120.68 + ,1140.84 + ,1101.72 + ,1104.24 + ,1114.58 + ,1130.2 + ,1173.78 + ,1211.92 + ,1181.27 + ,1203.6 + ,1180.59 + ,1156.85 + ,1191.5 + ,1191.33 + ,1234.18 + ,1220.33 + ,1228.81 + ,1207.01 + ,1249.48 + ,1248.29 + ,1280.08 + ,1280.66 + ,1302.88 + ,1310.61 + ,1270.05 + ,1270.06 + ,1278.53 + ,1303.8 + ,1335.83 + ,1377.76 + ,1400.63 + ,1418.03 + ,1437.9 + ,1406.8 + ,1420.83 + ,1482.37 + ,1530.63 + ,1504.66 + ,1455.18 + ,1473.96 + ,1527.29 + ,1545.79 + ,1479.63 + ,1467.97 + ,1378.6 + ,1330.45 + ,1326.41 + ,1385.97 + ,1399.62 + ,1276.69 + ,1269.42 + ,1287.83 + ,1164.17 + ,968.67 + ,888.61 + ,902.99 + ,823.09 + ,729.57 + ,793.59 + ,872.74 + ,923.26 + ,920.82 + ,990.22 + ,1019.52 + ,1054.91 + ,1036.18 + ,1098.89) > par9 = '1' > par8 = '2' > par7 = '1' > par6 = '3' > par5 = '12' > par4 = '0' > par3 = '1' > par2 = '0.0' > 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.58819140 -0.02126989 0.08002403 -0.52799238 0.13525457 0.08110964 [2,] 0.57544113 -0.02058703 0.08043218 -0.51487439 0.06334341 0.08553938 [3,] 0.54143511 0.00000000 0.07433559 -0.48842471 0.06358272 0.08734134 [4,] 0.63624150 0.00000000 0.06293508 -0.58740608 0.00000000 0.09007764 [5,] 0.03904347 0.00000000 0.00000000 0.03186976 0.00000000 0.09692931 [6,] 0.06952569 0.00000000 0.00000000 0.00000000 0.00000000 0.09331935 [7,] 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.09677752 [8,] 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 [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.07262091 [2,] 0.00000000 [3,] 0.00000000 [4,] 0.00000000 [5,] 0.00000000 [6,] 0.00000000 [7,] 0.00000000 [8,] 0.00000000 [9,] NA [10,] NA [11,] NA [12,] NA [13,] NA [14,] NA [[2]] [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0.24907 0.79601 0.30758 0.30122 0.78266 0.33143 0.88157 [2,] 0.25518 0.80149 0.29415 0.30921 0.36207 0.25696 NA [3,] 0.24937 NA 0.33420 0.31694 0.35917 0.24539 NA [4,] 0.28599 NA 0.50996 0.34462 NA 0.23229 NA [5,] 0.00010 NA NA 0.08033 NA 0.00000 NA [6,] 0.29666 NA NA NA NA 0.21941 NA [7,] NA NA NA NA NA 0.20011 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.5882 -0.0213 0.0800 -0.5280 0.1353 0.0811 -0.0726 s.e. 0.5090 0.0822 0.0783 0.5096 0.4897 0.0833 0.4869 sigma^2 estimated as 0.001958: log likelihood = 405.93, aic = -795.86 [[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.5882 -0.0213 0.0800 -0.5280 0.1353 0.0811 -0.0726 s.e. 0.5090 0.0822 0.0783 0.5096 0.4897 0.0833 0.4869 sigma^2 estimated as 0.001958: log likelihood = 405.93, aic = -795.86 [[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.5754 -0.0206 0.0804 -0.5149 0.0633 0.0855 0 s.e. 0.5045 0.0818 0.0765 0.5052 0.0694 0.0753 0 sigma^2 estimated as 0.001958: log likelihood = 405.92, aic = -797.84 [[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.5414 0 0.0743 -0.4884 0.0636 0.0873 0 s.e. 0.4689 0 0.0768 0.4870 0.0692 0.0750 0 sigma^2 estimated as 0.001958: log likelihood = 405.88, aic = -799.77 [[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.6362 0 0.0629 -0.5874 0 0.0901 0 s.e. 0.5950 0 0.0954 0.6203 0 0.0752 0 sigma^2 estimated as 0.001966: log likelihood = 405.47, aic = -800.93 [[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.0390 0 0 0.0319 0 0.0969 0 s.e. 0.0099 0 0 0.0181 0 0.0179 0 sigma^2 estimated as 0.001988: log likelihood = 404.12, aic = -800.23 [[3]][[7]] 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.0695 0 0 0 0 0.0933 0 s.e. 0.0665 0 0 0 0 0.0758 0 sigma^2 estimated as 0.001988: log likelihood = 404.11, aic = -802.22 [[3]][[8]] 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 0 0 0 0 0.0968 0 s.e. 0 0 0 0 0 0.0753 0 sigma^2 estimated as 0.001998: log likelihood = 403.54, aic = -803.09 $aic [1] -795.8619 -797.8391 -799.7682 -800.9324 -800.2340 -802.2186 -803.0863 [8] -803.4457 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 6: In max(i) : no non-missing arguments to max; returning -Inf 7: In max(i) : no non-missing arguments to max; returning -Inf 8: In max(try.data.frame[, 4], na.rm = TRUE) : no non-missing arguments to max; returning -Inf > postscript(file="/var/www/html/rcomp/tmp/19imt1261230947.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 = 240 Frequency = 1 [1] 5.867598e-03 -7.096500e-02 8.462795e-03 2.385305e-02 -2.712723e-02 [6] 8.767049e-02 -8.966782e-03 -5.212279e-03 -9.859783e-02 -5.213146e-02 [11] -6.884572e-03 5.799725e-02 2.431827e-02 4.049051e-02 6.486665e-02 [16] 2.185688e-02 3.447774e-04 3.762308e-02 -4.874245e-02 4.200448e-02 [21] 2.098511e-02 -1.923860e-02 1.173483e-02 -4.500307e-02 1.054410e-01 [26] -1.305638e-02 8.648027e-03 -2.439409e-02 3.019801e-02 -7.561040e-03 [31] -1.649241e-02 3.893103e-02 -1.465598e-02 1.413336e-02 2.725700e-03 [36] 2.422139e-02 7.669547e-03 3.107164e-03 4.121802e-03 1.639940e-02 [41] -2.577890e-02 1.889387e-02 5.427720e-03 -9.447756e-03 3.179042e-02 [46] -8.145916e-03 1.806627e-02 -8.315792e-03 -3.864073e-04 3.376579e-02 [51] -3.129444e-02 -4.504336e-02 9.044214e-03 1.222769e-02 -2.547574e-02 [56] 2.732926e-02 3.921168e-02 -2.816580e-02 2.027340e-02 -4.331401e-02 [61] 1.143103e-02 2.343657e-02 3.442941e-02 2.514973e-02 3.018523e-02 [66] 3.338830e-02 2.098875e-02 3.180070e-02 -3.594371e-03 4.028387e-02 [71] -6.850653e-03 4.145713e-02 1.633866e-02 2.901583e-02 9.849711e-03 [76] 1.245132e-02 1.220864e-02 2.140377e-02 4.882264e-03 -4.983226e-02 [81] 1.507142e-02 5.539712e-02 2.381401e-02 7.472112e-02 -2.294023e-02 [86] 5.717654e-02 2.480377e-03 -4.615605e-02 5.408344e-02 5.348299e-02 [91] 4.049737e-02 7.219443e-02 -5.913091e-02 4.798426e-02 -3.460295e-02 [96] 3.972817e-02 1.393555e-02 6.992735e-03 6.740971e-02 4.797530e-02 [101] 7.744315e-03 -2.119244e-02 3.846224e-02 -7.151530e-03 -1.593899e-01 [106] 5.542068e-02 7.473700e-02 5.059136e-02 -2.790450e-02 1.192835e-01 [111] -3.338705e-02 4.227513e-02 3.174838e-02 -3.079657e-02 4.889180e-02 [116] -3.985059e-02 -5.482355e-04 -3.397928e-02 6.405731e-02 1.466090e-02 [121] 5.472218e-02 -5.322218e-02 -2.690152e-02 8.760703e-02 -3.215441e-02 [126] -2.031938e-02 1.990824e-02 -1.534556e-02 7.417895e-02 -6.081692e-02 [131] -1.244320e-02 -8.901543e-02 6.949336e-03 2.194891e-02 -9.365533e-02 [136] -7.004195e-02 7.040284e-02 7.524546e-03 -3.045149e-02 -7.678767e-03 [141] -6.564845e-02 -8.245323e-02 1.206649e-02 7.065695e-02 2.103221e-03 [146] -1.064025e-02 -1.901904e-02 2.714521e-02 -6.035748e-02 -6.978478e-03 [151] -7.750329e-02 -8.070534e-02 -8.333768e-04 -1.112423e-01 8.339528e-02 [156] 6.357726e-02 -6.262076e-02 -3.109279e-02 -7.778771e-03 1.474489e-02 [161] 7.076513e-02 4.915430e-02 1.370918e-02 1.714169e-02 2.412740e-02 [166] -3.765308e-03 5.176835e-02 8.836942e-05 4.878868e-02 1.864794e-02 [171] 1.416597e-02 -3.098558e-02 2.004390e-04 1.289392e-02 2.510825e-02 [176] -2.692746e-02 1.813458e-03 2.060084e-02 5.892704e-03 3.246349e-02 [181] 3.799896e-02 -2.292558e-02 2.038665e-02 -2.010822e-02 -2.785514e-02 [186] 2.470764e-02 -1.232269e-03 3.377896e-02 -1.299992e-02 8.087809e-03 [191] -2.307800e-02 3.389381e-02 -5.745166e-03 2.349027e-02 -7.214109e-04 [196] 1.986241e-02 6.489735e-03 -3.259881e-02 -1.717591e-03 1.002362e-02 [201] 1.935099e-02 2.336774e-02 2.955932e-02 1.280159e-02 9.251836e-03 [206] 1.639416e-02 -2.367844e-02 1.179166e-02 4.436684e-02 2.918114e-02 [211] -1.709865e-02 -3.685713e-02 1.391523e-02 3.487209e-02 1.377250e-02 [216] -4.708974e-02 -7.819348e-03 -6.524576e-02 -3.559510e-02 -4.705917e-03 [221] 4.335173e-02 1.284285e-02 -9.193074e-02 -6.353952e-03 1.250439e-02 [226] -1.032990e-01 -1.868307e-01 -8.785881e-02 1.485818e-02 -9.399260e-02 [231] -1.184941e-01 8.315126e-02 9.096727e-02 5.317271e-02 -9.902064e-04 [236] 7.589855e-02 2.791908e-02 3.068383e-02 -1.907980e-02 6.299305e-02 > postscript(file="/var/www/html/rcomp/tmp/2tvqy1261230947.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/3so5u1261230947.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/47icy1261230947.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/5o5fm1261230947.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/62f5s1261230947.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/7yoa41261230947.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/8vm8b1261230947.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/90itf1261230947.tab") > > try(system("convert tmp/19imt1261230947.ps tmp/19imt1261230947.png",intern=TRUE)) character(0) > try(system("convert tmp/2tvqy1261230947.ps tmp/2tvqy1261230947.png",intern=TRUE)) character(0) > try(system("convert tmp/3so5u1261230947.ps tmp/3so5u1261230947.png",intern=TRUE)) character(0) > try(system("convert tmp/47icy1261230947.ps tmp/47icy1261230947.png",intern=TRUE)) character(0) > try(system("convert tmp/5o5fm1261230947.ps tmp/5o5fm1261230947.png",intern=TRUE)) character(0) > try(system("convert tmp/62f5s1261230947.ps tmp/62f5s1261230947.png",intern=TRUE)) character(0) > try(system("convert tmp/7yoa41261230947.ps tmp/7yoa41261230947.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 7.336 1.637 8.702