R version 2.12.0 (2010-10-15) Copyright (C) 2010 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i486-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(12559,12070,11221,11338,10761,11012,10923,10790,11427,10788,11772,12104,12634,12722,11764,11956,11646,11750,11485,11198,12265,11704,12419,13259,13945,13839,12387,12546,12083,11977,12336,11793,12877,11923,13306,13988,14002,14336,12867,12721,12449,12686,12810,12015,12888,12431,13499,13014,14296,14125,12817,12862,12449,12489,12621,12380,13023,12302,13339,13825,14428,14151,13355,13094,12656,13287,12434,13209,12817,13746,14259,14590,14354,13254,13464,13302,13456,13171,12517,13489,12509,13785,13921,14603,14749,13540,13457,13243,13590,13487,12776,13812,13032,14268,14473,15359) > par1 = '0' > ylab = 'Density' > xlab = 'm KwH' > #'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: > if (par1 == '0') bw <- 'nrd0' > if (par1 != '0') bw <- as.numeric(par1) > postscript(file="/var/www/rcomp/tmp/11grt1316291437.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > mydensity1<-density(x,bw=bw,kernel='gaussian',na.rm=TRUE) > plot(mydensity1,main='Gaussian Kernel',xlab=xlab,ylab=ylab) > grid() > dev.off() null device 1 > mydensity1 Call: density.default(x = x, bw = bw, kernel = "gaussian", na.rm = TRUE) Data: x (96 obs.); Bandwidth 'bw' = 327.9 x y Min. : 9777 Min. :1.426e-07 1st Qu.:11419 1st Qu.:2.088e-05 Median :13060 Median :1.264e-04 Mean :13060 Mean :1.522e-04 3rd Qu.:14701 3rd Qu.:2.661e-04 Max. :16343 Max. :3.781e-04 > postscript(file="/var/www/rcomp/tmp/2m3k71316291437.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > mydensity2<-density(x,bw=bw,kernel='epanechnikov',na.rm=TRUE) > plot(mydensity2,main='Epanechnikov Kernel',xlab=xlab,ylab=ylab) > grid() > dev.off() null device 1 > postscript(file="/var/www/rcomp/tmp/32xrq1316291437.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > mydensity3<-density(x,bw=bw,kernel='rectangular',na.rm=TRUE) > plot(mydensity3,main='Rectangular Kernel',xlab=xlab,ylab=ylab) > grid() > dev.off() null device 1 > postscript(file="/var/www/rcomp/tmp/48wb71316291437.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > mydensity4<-density(x,bw=bw,kernel='triangular',na.rm=TRUE) > plot(mydensity4,main='Triangular Kernel',xlab=xlab,ylab=ylab) > grid() > dev.off() null device 1 > postscript(file="/var/www/rcomp/tmp/5gia71316291438.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > mydensity5<-density(x,bw=bw,kernel='biweight',na.rm=TRUE) > plot(mydensity5,main='Biweight Kernel',xlab=xlab,ylab=ylab) > grid() > dev.off() null device 1 > postscript(file="/var/www/rcomp/tmp/631fp1316291438.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > mydensity6<-density(x,bw=bw,kernel='cosine',na.rm=TRUE) > plot(mydensity6,main='Cosine Kernel',xlab=xlab,ylab=ylab) > grid() > dev.off() null device 1 > postscript(file="/var/www/rcomp/tmp/702b11316291438.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > mydensity7<-density(x,bw=bw,kernel='optcosine',na.rm=TRUE) > plot(mydensity7,main='Optcosine Kernel',xlab=xlab,ylab=ylab) > grid() > dev.off() null device 1 > > #Note: the /var/www/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/rcomp/createtable") > > a<-table.start() > a<-table.row.start(a) > a<-table.element(a,'Properties of Density Trace',2,TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Bandwidth',header=TRUE) > a<-table.element(a,mydensity1$bw) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'#Observations',header=TRUE) > a<-table.element(a,mydensity1$n) > a<-table.row.end(a) > a<-table.end(a) > table.save(a,file="/var/www/rcomp/tmp/87tw81316291438.tab") > > try(system("convert tmp/11grt1316291437.ps tmp/11grt1316291437.png",intern=TRUE)) character(0) > try(system("convert tmp/2m3k71316291437.ps tmp/2m3k71316291437.png",intern=TRUE)) character(0) > try(system("convert tmp/32xrq1316291437.ps tmp/32xrq1316291437.png",intern=TRUE)) character(0) > try(system("convert tmp/48wb71316291437.ps tmp/48wb71316291437.png",intern=TRUE)) character(0) > try(system("convert tmp/5gia71316291438.ps tmp/5gia71316291438.png",intern=TRUE)) character(0) > try(system("convert tmp/631fp1316291438.ps tmp/631fp1316291438.png",intern=TRUE)) character(0) > try(system("convert tmp/702b11316291438.ps tmp/702b11316291438.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.770 0.210 2.976