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(136524,132111,125326,122716,116615,113719,110737,112093,143565,149946,149147,134339,122683,115614,116566,111272,104609,101802,94542,93051,124129,130374,123946,114971,105531,104919,104782,101281,94545,93248,84031,87486,115867,120327,117008,108811,104519,106758,109337,109078,108293,106534,99197,103493,130676,137448,134704,123725,118277,121225,120528,118240,112514,107304,100001,102082,130455,135574,132540,119920,112454,109415,109843,106365,102304,97968,92462,92286,120092,126656,124144,114045,108120,105698,111203,110030,104009,99772,96301,97680,121563,134210,133111,124527,117589,115699,117830,115874,111267,107985,102185,102101,128932,135782,136971,126292,119260) > par1 = '12' > par1 <- '12' > #'GNU S' R Code compiled by R2WASP v. 1.2.327 () > #Author: root > #To cite this work: Wessa P., (2012), Variance Reduction Matrix (v1.0.4) 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,signif(var(myx), digits=6)) + a<-table.element(a,'Range',header=TRUE) + a<-table.element(a,signif(max(myx)-min(myx), digits=6)) + a<-table.element(a,'Trim Var.',header=TRUE) + smyx <- sort(myx) + sn <- length(smyx) + a<-table.element(a,signif(var(smyx[smyx>quantile(smyx,0.05) & smyx a<-table.end(a) > table.save(a,file="/var/fisher/rcomp/tmp/1gaj21387310787.tab") > postscript(file="/var/fisher/rcomp/tmp/2uxt01387310787.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/2uxt01387310787.ps tmp/2uxt01387310787.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.632 0.578 2.224