[GRASS-dev] [GRASS GIS] #359: r.quantile computes incorrect values
with default number of bins
GRASS GIS
trac at osgeo.org
Sun Nov 9 23:12:30 EST 2008
#359: r.quantile computes incorrect values with default number of bins
------------------------+---------------------------------------------------
Reporter: dylan | Owner: grass-dev at lists.osgeo.org
Type: defect | Status: new
Priority: major | Milestone: 6.4.0
Component: default | Version: svn-develbranch6
Keywords: r.quantile | Platform: Linux
Cpu: x86-32 |
------------------------+---------------------------------------------------
I noticed that when computing quantiles from a highly skewed distribution,
incorrect values are returned with the default number of bins. Reducing
the number of bins seems to correct the problem
Example, based on attached raster file in GRASS ASCII format:
{{{
r.quantile in=beam_150 quantiles=5
0:20.000000:7440.040527
1:40.000000:7512.872559
2:60.000000:7611.160645
3:80.000000:7611.161133
r.quantile in=beam_150 quantiles=5 bins=10')
0:20.000000:7440.040527
1:40.000000:7512.872559
2:60.000000:7570.587402
3:80.000000:7611.161133
}}}
Quantiles computed in R:
{{{
library(spgrass6)
x <- readRAST6('beam_150')
quantile(x at data$beam_150, prob=c(0,0.2,0.4,0.6,0.8,1), na.rm=TRUE)
0% 20% 40% 60% 80% 100%
6429.886 7440.040 7512.871 7570.580 7611.161 7638.599
}}}
--
Ticket URL: <http://trac.osgeo.org/grass/ticket/359>
GRASS GIS <http://grass.osgeo.org>
More information about the grass-dev
mailing list