R version 2.15.2 (2012-10-26) -- "Trick or Treat" Copyright (C) 2012 The R Foundation for Statistical Computing ISBN 3-900051-07-0 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(369.07,369.32,370.38,371.63,371.32,371.51,369.69,368.18,366.87,366.94,368.27,369.62,370.47,371.44,372.39,373.32,373.77,373.13,371.51,369.59,368.12,368.38,369.64,371.11,372.38,373.08,373.87,374.93,375.58,375.44,373.91,371.77,370.72,370.5,372.19,373.71,374.92,375.63,376.51,377.75,378.54,378.21,376.65,374.28,373.12,373.1,374.67,375.97,377.03,377.87,378.88,380.42,380.62,379.66,377.48,376.07,374.1,374.47,376.15,377.51,378.43,379.7,380.91,382.2,382.45,382.14,380.6,378.6,376.72,376.98,378.29,380.07,381.36,382.19,382.65,384.65,384.94,384.01,382.15,380.33,378.81,379.06,380.17,381.85,382.88,383.77,384.42,386.36,386.53,386.01,384.45,381.96,380.81,381.09,382.37,383.84,385.42,385.72,385.96,387.18,388.5,387.88,386.38,384.15,383.07,382.98,384.11,385.54,386.92,387.41,388.77,389.46,390.18,389.43,387.74,385.91,384.77,384.38,385.99,387.26,388.45,389.7,391.08,392.46,392.96,392.03,390.13,388.15,386.8,387.18,388.59) > par1 = '12' > par1 <- '12' > #'GNU S' R Code compiled by R2WASP v. 1.2.291 () > #Author: root > #To cite this work: Wessa P., (2012), Variance Reduction Matrix (v1.0.3) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_variancereduction.wasp/ > #Source of accompanying publication: > # > par1 <- as.numeric(par1) > n <- length(x) > sx <- sort(x) > > #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,'Variance Reduction Matrix',6,TRUE) > a<-table.row.end(a) > for (bigd in 0:2) { + for (smalld in 0:3) { + mylabel <- 'V(Y[t],d=' + mylabel <- paste(mylabel,as.character(smalld),sep='') + mylabel <- paste(mylabel,',D=',sep='') + mylabel <- paste(mylabel,as.character(bigd),sep='') + mylabel <- paste(mylabel,')',sep='') + a<-table.row.start(a) + a<-table.element(a,mylabel,header=TRUE) + myx <- x + if (smalld > 0) myx <- diff(myx,lag=1,differences=smalld) + if (bigd > 0) myx <- diff(myx,lag=par1,differences=bigd) + a<-table.element(a,var(myx)) + a<-table.element(a,'Range',header=TRUE) + a<-table.element(a,max(myx)-min(myx)) + a<-table.element(a,'Trim Var.',header=TRUE) + smyx <- sort(myx) + sn <- length(smyx) + a<-table.element(a,var(smyx[smyx>quantile(smyx,0.05) & smyx a<-table.end(a) > table.save(a,file="/var/fisher/rcomp/tmp/113fa1354112750.tab") > postscript(file="/var/fisher/rcomp/tmp/2gaz41354112750.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > op <- par(mfrow=c(2,2)) > plot(x,type='l',xlab='time',ylab='value',main='d=0, D=0') > plot(diff(x,lag=1,differences=1),type='l',xlab='time',ylab='value',main='d=1, D=0') > plot(diff(x,lag=par1,differences=1),type='l',xlab='time',ylab='value',main='d=0, D=1') > plot(diff(diff(x,lag=1,differences=1),lag=par1,differences=1),type='l',xlab='time',ylab='value',main='d=1, D=1') > par(op) > dev.off() null device 1 > > try(system("convert tmp/2gaz41354112750.ps tmp/2gaz41354112750.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.889 0.201 1.074