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(1.262,1.743,1.964,3.258,4.966,4.944,5.907,5.561,5.321,3.582,1.757,1.894,1.442,2.238,2.179,3.218,5.139,4.990,4.914,6.084,5.672,3.548,1.793,2.086,1.376,2.202,2.683,3.303,5.202,5.231,4.880,7.998,4.977,3.531,2.025,2.205,1.504,2.090,2.702,2.939,4.500,6.208,6.415,5.657,5.964,3.163,1.997,2.422,1.507,1.992,2.487,3.490,4.647,5.594,5.611,5.788,6.204,3.013,1.931,2.549,1.580,2.111,2.192,3.601,4.665,4.876,5.813,5.589,5.331,3.075,2.002,2.306,1.594,2.467,2.222,3.607,4.685,4.962,5.770,5.480,5.000,3.228,1.993,2.288,1.351,2.218,2.461,3.028,4.784,4.975,4.607,6.249,4.809,3.157,1.910,2.228,1.169,2.154,2.249,2.687,4.359,5.382,4.459,6.398,4.596,3.024,1.887,2.070,1.511,2.059,2.635,2.867,4.403,5.720,4.502,5.749,5.627,2.846,1.762,2.429,1.579,2.146,2.462,3.695,4.831,5.134,6.250,5.760,6.249,2.917,1.741,2.359) > 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/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,'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/wessaorg/rcomp/tmp/16ykr1355687628.tab") > postscript(file="/var/wessaorg/rcomp/tmp/2y7wp1355687628.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/2y7wp1355687628.ps tmp/2y7wp1355687628.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.866 0.134 0.981