R version 2.8.0 (2008-10-20) 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(20.050,19.260,19.280,19.100,18.955,18.265,17.760,18.760,19.280,18.920,18.950,18.490,18.470,18.570,18.900,18.485,18.635,18.865,18.860,18.400,18.515,18.950,18.830,18.840,19.200,19.340,20.780,20.270,20.270,20.270,20.250,20.310,19.660,19.760,19.750,19.470,19.320,19.360,19.600,20.140,19.660,19.790,19.670,19.590,19.340,19.330,19.430,19.520,19.400,19.910,19.800,19.830,20.100,20.260,20.310,20.450,19.990,20.095,20.365,19.740,20.100,19.910,20.060,20.440,20.740,21.480,21.050,21.850,22.490,21.660,21.650,21.680,23.020,23.100,22.650,22.440,22.910,22.980,22.535) > par1 = '0' > ylab = 'Density' > xlab = 'goudprijs in euro/kg' > #'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/1h2ud1236020631.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 (79 obs.); Bandwidth 'bw' = 0.3251 x y Min. :16.78 Min. :0.0001757 1st Qu.:18.61 1st Qu.:0.0398207 Median :20.43 Median :0.0775067 Mean :20.43 Mean :0.1370182 3rd Qu.:22.25 3rd Qu.:0.2438993 Max. :24.08 Max. :0.3972051 > postscript(file="/var/www/html/rcomp/tmp/2xll11236020631.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/352ba1236020631.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/4rkxf1236020631.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/5xd7n1236020631.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/6ohy71236020631.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/707aq1236020631.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/8ntj91236020631.tab") > > system("convert tmp/1h2ud1236020631.ps tmp/1h2ud1236020631.png") > system("convert tmp/2xll11236020631.ps tmp/2xll11236020631.png") > system("convert tmp/352ba1236020631.ps tmp/352ba1236020631.png") > system("convert tmp/4rkxf1236020631.ps tmp/4rkxf1236020631.png") > system("convert tmp/5xd7n1236020631.ps tmp/5xd7n1236020631.png") > system("convert tmp/6ohy71236020631.ps tmp/6ohy71236020631.png") > system("convert tmp/707aq1236020631.ps tmp/707aq1236020631.png") > > > proc.time() user system elapsed 1.320 1.110 3.281