R version 2.8.1 (2008-12-22) Copyright (C) 2008 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(11310000,64305000,15310000,37299000,21302000,61308000,72300000,26303000,18301000,54305000,66309000,50301000,31298000,52291000,87286000,81288000,14293000,90302000,50306000,15310000,44310000,26314000,98313000,76310000,25313000,48309000,95307000,10320000,87327000,63328000,34333000,90333000,81332000,7342000,30424000,13344000,88347000,40339000,23330000,1339000,10341000,46342000,81342000,2342000,76350000,35368000,93367000,88377000,39376000,41366000,77375000,56382000,79397000,26385000,73397000,28404000,98413000,73414000,47423000,52431000,24441000,92439000,90441000,441000,13448000,18458000,18459000,69477000,41491000,10492000,73508000,82515000,13525000,55533000,19550000,85558000,57563000,60570000,49568000,51570000,26561000,61558000,78548000,77537000,539000,18540000,47542000,86542000,81544000,16543000,22538000,25538000,99527000,63518000,95508000,65496000,5488000,96475000,81465000,5463000,81458000,74445000,21434000,67427000,27418000,81407000,82395000,97359000) > par1 = '0' > ylab = 'Density' > xlab = 'Value' > #'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/html/rcomp/tmp/13c9s1234859575.ps",horizontal=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 (108 obs.); Bandwidth 'bw' = 1.058e+07 x y Min. :-31287620 Min. :1.600e-11 1st Qu.: 9348190 1st Qu.:1.498e-09 Median : 49984000 Median :8.285e-09 Mean : 49984000 Mean :6.146e-09 3rd Qu.: 90619810 3rd Qu.:9.579e-09 Max. :131255620 Max. :1.126e-08 > postscript(file="/var/www/html/rcomp/tmp/2jgep1234859575.ps",horizontal=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/html/rcomp/tmp/326xo1234859575.ps",horizontal=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/html/rcomp/tmp/46hsa1234859575.ps",horizontal=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/html/rcomp/tmp/5avxa1234859575.ps",horizontal=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/html/rcomp/tmp/63vry1234859575.ps",horizontal=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/html/rcomp/tmp/7z0841234859575.ps",horizontal=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/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,'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/html/rcomp/tmp/8bh3c1234859575.tab") > > system("convert tmp/13c9s1234859575.ps tmp/13c9s1234859575.png") > system("convert tmp/2jgep1234859575.ps tmp/2jgep1234859575.png") > system("convert tmp/326xo1234859575.ps tmp/326xo1234859575.png") > system("convert tmp/46hsa1234859575.ps tmp/46hsa1234859575.png") > system("convert tmp/5avxa1234859575.ps tmp/5avxa1234859575.png") > system("convert tmp/63vry1234859575.ps tmp/63vry1234859575.png") > system("convert tmp/7z0841234859575.ps tmp/7z0841234859575.png") > > > proc.time() user system elapsed 1.305 1.085 1.690