[GRASS-dev] [GRASS GIS] #1874: latitudinal bias in sample points created with r.random

#1874: latitudinal bias in sample points created with r.random
------------------------+---------------------------------------------------
Reporter: pvanbosgeo | Owner: grass-dev@…
     Type: defect | Status: new
Priority: major | Milestone: 7.0.0
Component: Default | Version: svn-trunk
Keywords: | Platform: Linux
      Cpu: x86-64 |
------------------------+---------------------------------------------------
Point patterns generated with r.random show a strong latitudinal bias,
with considerably higher density at higher latitudes.

The attached screenshot illustrates this. It shows the sum of number of
points in a moving window (21x21 - created with r.neighbors.

This is fairly serious because especially at lower sample densities, one
may not always notice this bias, thus introducing unknowingly such bias in
analysis.

Note that points created with v.random do no show a bias. However, this is
not really an alternative for creating random points within a irregular
area.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1874&gt;
GRASS GIS <http://grass.osgeo.org>

#1874: latitudinal bias in sample points created with r.random
------------------------+---------------------------------------------------
Reporter: pvanbosgeo | Owner: grass-dev@…
     Type: defect | Status: new
Priority: major | Milestone: 7.0.0
Component: Raster | Version: svn-trunk
Keywords: r.random | Platform: Linux
      Cpu: x86-64 |
------------------------+---------------------------------------------------
Changes (by martinl):

  * keywords: => r.random
  * component: Default => Raster

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1874#comment:1&gt;
GRASS GIS <http://grass.osgeo.org>

#1874: latitudinal bias in sample points created with r.random
------------------------+---------------------------------------------------
Reporter: pvanbosgeo | Owner: grass-dev@…
     Type: defect | Status: new
Priority: major | Milestone: 7.0.0
Component: Raster | Version: svn-trunk
Keywords: r.random | Platform: Linux
      Cpu: x86-64 |
------------------------+---------------------------------------------------

Comment(by pvanbosgeo):

I just checked, and for sample points layers generated with r.random in
grass 6.4.3 there is not noticeable bias.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1874#comment:2&gt;
GRASS GIS <http://grass.osgeo.org>

#1874: latitudinal bias in sample points created with r.random
------------------------+---------------------------------------------------
Reporter: pvanbosgeo | Owner: grass-dev@…
     Type: defect | Status: new
Priority: major | Milestone: 7.0.0
Component: Raster | Version: svn-trunk
Keywords: r.random | Platform: Linux
      Cpu: x86-64 |
------------------------+---------------------------------------------------

Comment(by mmetz):

Replying to [comment:2 pvanbosgeo]:
> I just checked, and for sample points layers generated with r.random in
grass 6.4.3 there is not noticeable bias.

Trunk should be fixed in r54956.

Markus M

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1874#comment:3&gt;
GRASS GIS <http://grass.osgeo.org>

#1874: latitudinal bias in sample points created with r.random
------------------------+---------------------------------------------------
Reporter: pvanbosgeo | Owner: grass-dev@…
     Type: defect | Status: new
Priority: major | Milestone: 7.0.0
Component: Raster | Version: svn-trunk
Keywords: r.random | Platform: Linux
      Cpu: x86-64 |
------------------------+---------------------------------------------------

Comment(by pvanbosgeo):

I can confirm the problem is solved, the clear bias has disappeared.
Thanks! Can this be marked as fixed?

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1874#comment:4&gt;
GRASS GIS <http://grass.osgeo.org>

#1874: latitudinal bias in sample points created with r.random
------------------------+---------------------------------------------------
Reporter: pvanbosgeo | Owner: grass-dev@…
     Type: defect | Status: new
Priority: major | Milestone: 7.0.0
Component: Raster | Version: svn-trunk
Keywords: r.random | Platform: Linux
      Cpu: x86-64 |
------------------------+---------------------------------------------------

Comment(by hamish):

Replying to [ticket:1874 pvanbosgeo]:
> Note that points created with v.random do no show a bias.
> However, this is not really an alternative for creating
> random points within a irregular area.

the v.random.cover addon script for grass 6 exists to do that.
   http://grasswiki.osgeo.org/wiki/AddOns/GRASS_6#v.random.cover

'' v.random.cover is a shell script for creating random points constrained
within an irregularly shaped vector area. (v.random places points only in
current region rectangle). Optionally the user can upload raster values at
the points. See also 'r.random cover= vector_output=' ''

It's internal method is not especially efficient, but it gets the job done
all the same.

Hamish

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/1874#comment:5&gt;
GRASS GIS <http://grass.osgeo.org>

#1874: latitudinal bias in sample points created with r.random
------------------------+---------------------------------------------------
Reporter: pvanbosgeo | Owner: grass-dev@…
     Type: defect | Status: new
Priority: major | Milestone: 7.0.0
Component: Raster | Version: svn-trunk
Keywords: r.random | Platform: Linux
      Cpu: x86-64 |
------------------------+---------------------------------------------------

Comment(by hamish):

> It's internal

(a friend was terrible with apostrophes and to/too/two & after too many
emails it begins to look natural and the bad habit has rubbed off on me!
argh!)

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/1874#comment:6&gt;
GRASS GIS <http://grass.osgeo.org>

Thanks pointing it out. I have actually used the script some time ago. I think I found that it becomes a bit slow when working with large number of points, but I am going to try in grass 7, see if it is any faster due to faster vector handling.

Cheers,

Paulo

···

On Thu, Feb 7, 2013 at 2:44 AM, GRASS GIS <trac@osgeo.org> wrote:

#1874: latitudinal bias in sample points created with r.random
------------------------±--------------------------------------------------
Reporter: pvanbosgeo | Owner: grass-dev@…
Type: defect | Status: new
Priority: major | Milestone: 7.0.0

Component: Raster | Version: svn-trunk
Keywords: r.random | Platform: Linux
Cpu: x86-64 |
------------------------±--------------------------------------------------

Comment(by hamish):

It’s internal

(a friend was terrible with apostrophes and to/too/two & after too many
emails it begins to look natural and the bad habit has rubbed off on me!
argh!)


Ticket URL: <https://trac.osgeo.org/grass/ticket/1874#comment:6>
GRASS GIS <http://grass.osgeo.org>

On Thu, Feb 7, 2013 at 8:34 AM, Paulo van Breugel
<p.vanbreugel@gmail.com> wrote:

Thanks pointing it out. I have actually used the script some time ago. I
think I found that it becomes a bit slow when working with large number of
points, but I am going to try in grass 7, see if it is any faster due to
faster vector handling.

In theory, r.random should work for irregular areas if you set a MASK.

Markus M

Cheers,

Paulo

On Thu, Feb 7, 2013 at 2:44 AM, GRASS GIS <trac@osgeo.org> wrote:

#1874: latitudinal bias in sample points created with r.random

------------------------+---------------------------------------------------
Reporter: pvanbosgeo | Owner: grass-dev@…
     Type: defect | Status: new
Priority: major | Milestone: 7.0.0
Component: Raster | Version: svn-trunk
Keywords: r.random | Platform: Linux
      Cpu: x86-64 |

------------------------+---------------------------------------------------

Comment(by hamish):

> It's internal

(a friend was terrible with apostrophes and to/too/two & after too many
emails it begins to look natural and the bad habit has rubbed off on me!
argh!)

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/1874#comment:6&gt;
GRASS GIS <http://grass.osgeo.org>

_______________________________________________
grass-dev mailing list
grass-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-dev

Not only in theory, I actually use it all the time :-). And you can achieve the same by setting all the areas outside your target area to NULL. I like how the combination of the two gives you a fine control over how you want to sample an area. You can even do the same with the cover layer. Although to be honest, I don’t really see the added value of having this option to define a cover layer, but that is another point.

By the way, it seems the issue of under-sampling was solved too? At least, in the limited trials I did, when generating random points I am actually getting the requested number of sample points, which I didn’t previously! Super!!

Cheers,

Paulo

···

On 02/07/2013 09:39 AM, Markus Metz wrote:

On Thu, Feb 7, 2013 at 8:34 AM, Paulo van Breugel
[<p.vanbreugel@gmail.com>](mailto:p.vanbreugel@gmail.com) wrote:

Thanks pointing it out. I have actually used the script some time ago. I
think I found that it becomes a bit slow when working with large number of
points, but I am going to try in grass 7, see if it is any faster due to
faster vector handling.

In theory, r.random should work for irregular areas if you set a MASK.

Markus M

Cheers,

Paulo

On Thu, Feb 7, 2013 at 2:44 AM, GRASS GIS [<trac@osgeo.org>](mailto:trac@osgeo.org) wrote:

#1874: latitudinal bias in sample points created with r.random

------------------------+---------------------------------------------------
 Reporter:  pvanbosgeo  |       Owner:  grass-dev@…
     Type:  defect      |      Status:  new
 Priority:  major       |   Milestone:  7.0.0
Component:  Raster      |     Version:  svn-trunk
 Keywords:  r.random    |    Platform:  Linux
      Cpu:  x86-64      |

------------------------+---------------------------------------------------

Comment(by hamish):

 > It's internal

 (a friend was terrible with apostrophes and to/too/two & after too many
 emails it begins to look natural and the bad habit has rubbed off on me!
 argh!)

--
Ticket URL: [<https://trac.osgeo.org/grass/ticket/1874#comment:6>](https://trac.osgeo.org/grass/ticket/1874#comment:6)
GRASS GIS [<http://grass.osgeo.org>](http://grass.osgeo.org)

_______________________________________________
grass-dev mailing list
[grass-dev@lists.osgeo.org](mailto:grass-dev@lists.osgeo.org)
[http://lists.osgeo.org/mailman/listinfo/grass-dev](http://lists.osgeo.org/mailman/listinfo/grass-dev)

#1874: latitudinal bias in sample points created with r.random
-------------------------+--------------------------------------------------
  Reporter: pvanbosgeo | Owner: grass-dev@…
      Type: defect | Status: closed
  Priority: major | Milestone: 7.0.0
Component: Raster | Version: svn-trunk
Resolution: fixed | Keywords: r.random
  Platform: Linux | Cpu: x86-64
-------------------------+--------------------------------------------------
Changes (by pvanbosgeo):

  * status: new => closed
  * resolution: => fixed

Comment:

This was fixed by Markus M, so marking it as such

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1874#comment:7&gt;
GRASS GIS <http://grass.osgeo.org>