using r as geo-statistical tool: a few examples r as geo-statistical tool: a few examples french...

26
Using R as geo-statistical tool: a few examples French Institute of Pondicherry 19th august 2015 Maxime Réjou-Méchain [email protected]

Upload: vanthuy

Post on 03-May-2018

216 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Using R as geo-statistical tool: a few examples R as geo-statistical tool: a few examples French Institute of Pondicherry 19th august 2015 Maxime Réjou-Méchain Maxime.rejou@ifpindia.org

Using R as geo-statistical tool:

a few examples French Institute of Pondicherry

19th august 2015

Maxime Réjou-Méchain [email protected]

Page 2: Using R as geo-statistical tool: a few examples R as geo-statistical tool: a few examples French Institute of Pondicherry 19th august 2015 Maxime Réjou-Méchain Maxime.rejou@ifpindia.org

in a nutshell

French Institute of Pondicherry Using R as geo-statistical tool: a few examples

• Free and open-source! • Command line based program • Environment for analyzing data

• Great tool for graphical visualization

Page 3: Using R as geo-statistical tool: a few examples R as geo-statistical tool: a few examples French Institute of Pondicherry 19th august 2015 Maxime Réjou-Méchain Maxime.rejou@ifpindia.org

in a nutshell

French Institute of Pondicherry Using R as geo-statistical tool: a few examples

• Free and open-source! • Command line based program • Environment for analyzing data

• Great tool for graphical visualization

Scientists and researches have implemented thousands of specialized procedures for a wide variety of applications as contributed packages

R is also a social movement: MANY forums on the net!!!

Specific add-ons, analogous to extentions in ArcGIS and QGIS

Page 4: Using R as geo-statistical tool: a few examples R as geo-statistical tool: a few examples French Institute of Pondicherry 19th august 2015 Maxime Réjou-Méchain Maxime.rejou@ifpindia.org

activity?

http://spatial.ly/2013/06/r_activity/

Map scaled according to the number of server requests made.

French Institute of Pondicherry Using R as geo-statistical tool: a few examples

India is already converted to the R power!

Page 5: Using R as geo-statistical tool: a few examples R as geo-statistical tool: a few examples French Institute of Pondicherry 19th august 2015 Maxime Réjou-Méchain Maxime.rejou@ifpindia.org

as a geospatial tool?!

French Institute of Pondicherry Using R as geo-statistical tool: a few examples

R has increasingly gained GIS capabilities, and is now able to perform most (if not all) the

operations we typically do with purely GIS software (e.g. SAGA, GRASS, DIVA-GIS, or QGIS)

Page 6: Using R as geo-statistical tool: a few examples R as geo-statistical tool: a few examples French Institute of Pondicherry 19th august 2015 Maxime Réjou-Méchain Maxime.rejou@ifpindia.org

R has increasingly gained GIS capabilities, and is now able to perform most (if not all) the

operations we typically do with purely GIS software (e.g. SAGA, GRASS, DIVA-GIS, or QGIS)

as a geospatial tool?!

French Institute of Pondicherry Using R as geo-statistical tool: a few examples

Page 7: Using R as geo-statistical tool: a few examples R as geo-statistical tool: a few examples French Institute of Pondicherry 19th august 2015 Maxime Réjou-Méchain Maxime.rejou@ifpindia.org

R has increasingly gained GIS capabilities, and is now able to perform most (if not all) the

operations we typically do with purely GIS software (e.g. SAGA, GRASS, DIVA-GIS, or QGIS)

as a geospatial tool?!

French Institute of Pondicherry Using R as geo-statistical tool: a few examples

Incorporated in QGIS

Page 8: Using R as geo-statistical tool: a few examples R as geo-statistical tool: a few examples French Institute of Pondicherry 19th august 2015 Maxime Réjou-Méchain Maxime.rejou@ifpindia.org

“ “spatial” packages

ade4 adehabitat adehabitatHR adehabitatHS adehabitatLT adehabitatMA ads akima AMOEBA ash aspace automap CARBayes classInt (core) CompRandFld constrainedKriging cshapes dbmss DCluster (core) deldir (core) DSpat ecespa fields FieldSim gdistance Geneland GEOmap geomapdata geonames geoR (core) geoRglm georob geospacom geosphere geospt GeoXp

ggmap glmmBUGS gmt Grid2Polygons GriegSmith gstat (core) Guerry GWmodel gwrr hdeco intamap landsat latticeDensity leafletR mapdata mapproj maps maptools (core) marmap MBA McSpatial micromap ModelMap ncdf ncf ngspatial nlme OpenStreetMap osmar pastecs PBSmapping PBSmodelling plotGoogleMaps plotKML PReMiuM psgp

ramps RandomFields (core) rangeMapper RArcInfo raster (core) rasterVis RColorBrewer (core) regress rgdal (core) rgeos (core) RgoogleMaps rgrass7 RPyGeo RSAGA RSurvey rtop rworldmap rworldxtra seg sgeostat shapefiles siplab sp (core) spacetime (core) spacom spaMM sparr spatcounts spatgraphs spatial spatial.tools spatialCovariance SpatialEpi SpatialExtremes spatialkernel spatialprobit

spatialsegregation SpatialTools spatstat (core) spBayes spcosa spdep (core) spgrass6 spgwr sphet splancs (core) splm spsurvey spTimer SSN Stem taRifx tgp tmap trip tripack tripEstimation UScensus2000cdp UScensus2000tract vardiag vec2dtransf vegan wkb

> 130 packages!

French Institute of Pondicherry Using R as geo-statistical tool: a few examples

containing R functions, datasets and documentation including examples of how to use the

functions

Page 9: Using R as geo-statistical tool: a few examples R as geo-statistical tool: a few examples French Institute of Pondicherry 19th august 2015 Maxime Réjou-Méchain Maxime.rejou@ifpindia.org

French Institute of Pondicherry Using R as geo-statistical tool: a few examples

“ “spatial” forums

Page 10: Using R as geo-statistical tool: a few examples R as geo-statistical tool: a few examples French Institute of Pondicherry 19th august 2015 Maxime Réjou-Méchain Maxime.rejou@ifpindia.org

Geo-examples

1) Mapping the westernGhats diversity

2) Modelling anthropic disturbance in Africa

French Institute of Pondicherry Using R as geo-statistical tool: a few examples

Page 11: Using R as geo-statistical tool: a few examples R as geo-statistical tool: a few examples French Institute of Pondicherry 19th august 2015 Maxime Réjou-Méchain Maxime.rejou@ifpindia.org

Modelling anthropic disturbance in Central Africa

gROADSv1 (NASA)

Grumpv1 (NASA)

FAO rivers (Strahler index <6)

French Institute of Pondicherry Using R as geo-statistical tool: a few examples

Page 12: Using R as geo-statistical tool: a few examples R as geo-statistical tool: a few examples French Institute of Pondicherry 19th august 2015 Maxime Réjou-Méchain Maxime.rejou@ifpindia.org

Shorter distance to a road, river or railway

= DistTransport

gROADSv1 (NASA)

Steps 1) Shapefile to raster

with 0/1 2) Distance to the

closest 1 3) Distance from

points (towns) 4) Weibull model

construction 5) InflVilles=X%*POP

Modelling anthropic disturbance in Central Africa

Grumpv1 (NASA)

French Institute of Pondicherry Using R as geo-statistical tool: a few examples

Page 13: Using R as geo-statistical tool: a few examples R as geo-statistical tool: a few examples French Institute of Pondicherry 19th august 2015 Maxime Réjou-Méchain Maxime.rejou@ifpindia.org

Distance to nearest town

b=POP^Beta

0%

100%

DistTransport

Steps 1) Shapefile to raster

with 0/1 2) Distance to the

closest 1 3) Distance from

points (towns) 4) Weibull model

construction 5) TownInfluence

POPXnceTownInflue %

Modelling anthropic disturbance in Central Africa

Grumpv1 (NASA)

French Institute of Pondicherry Using R as geo-statistical tool: a few examples

gROADSv1 (NASA)

Page 14: Using R as geo-statistical tool: a few examples R as geo-statistical tool: a few examples French Institute of Pondicherry 19th august 2015 Maxime Réjou-Méchain Maxime.rejou@ifpindia.org

DistTransport

TownInfluence

Steps 1) Shapefile to raster

with 0/1 2) Distance to the

closest 1 3) Distance from

points (towns) 4) Weibull model

construction 5) TownInfluence

6) Normalisation

7) Index calculation

))1(max(

)1(

Xsqrt

XsqrtXnorm

ortDistTransp

nceTownInflueAI log

POPXnceTownInflue %

Modelling anthropic disturbance in Central Africa

gROADSv1 (NASA)

Grumpv1 (NASA)

French Institute of Pondicherry Using R as geo-statistical tool: a few examples

Page 15: Using R as geo-statistical tool: a few examples R as geo-statistical tool: a few examples French Institute of Pondicherry 19th august 2015 Maxime Réjou-Méchain Maxime.rejou@ifpindia.org

Beta=0.05 Beta=0.1 Beta=0.2

Modelling anthropic disturbance in Central Africa

Beta=0.25 Beta=0.3 Beta=0.4

French Institute of Pondicherry Using R as geo-statistical tool: a few examples

Page 16: Using R as geo-statistical tool: a few examples R as geo-statistical tool: a few examples French Institute of Pondicherry 19th august 2015 Maxime Réjou-Méchain Maxime.rejou@ifpindia.org

MODIS forest map

Modelling anthropic disturbance in Central Africa

Two calibration/validation areas

French Institute of Pondicherry Using R as geo-statistical tool: a few examples

Page 17: Using R as geo-statistical tool: a few examples R as geo-statistical tool: a few examples French Institute of Pondicherry 19th august 2015 Maxime Réjou-Méchain Maxime.rejou@ifpindia.org

Markov Chain Monte Carlo…… (Beta ≈0.29) (performance AUC=0.78 et 0.68)

Modelling anthropic disturbance in Central Africa

French Institute of Pondicherry Using R as geo-statistical tool: a few examples

Page 18: Using R as geo-statistical tool: a few examples R as geo-statistical tool: a few examples French Institute of Pondicherry 19th august 2015 Maxime Réjou-Méchain Maxime.rejou@ifpindia.org

POP 2000 POP 2000 x 2

Modelling anthropic disturbance in Central Africa

French Institute of Pondicherry Using R as geo-statistical tool: a few examples

Page 19: Using R as geo-statistical tool: a few examples R as geo-statistical tool: a few examples French Institute of Pondicherry 19th august 2015 Maxime Réjou-Méchain Maxime.rejou@ifpindia.org

POP 2000 POP 2000 x 2

DIFFERENCES

Modelling anthropic disturbance in Central Africa

French Institute of Pondicherry Using R as geo-statistical tool: a few examples

Page 20: Using R as geo-statistical tool: a few examples R as geo-statistical tool: a few examples French Institute of Pondicherry 19th august 2015 Maxime Réjou-Méchain Maxime.rejou@ifpindia.org

POP 2000 POP 2000 x 2

DIFFERENCES

Modelling anthropic disturbance in Central Africa

All the procedure includes geostatistical and purely statistical tools thanks to R!

=

AUTOMATED, EASILY REPRODUCTIBLE, EFFICIENT

French Institute of Pondicherry Using R as geo-statistical tool: a few examples

Page 21: Using R as geo-statistical tool: a few examples R as geo-statistical tool: a few examples French Institute of Pondicherry 19th august 2015 Maxime Réjou-Méchain Maxime.rejou@ifpindia.org

French Institute of Pondicherry Using R as geo-statistical tool: a few examples

maps from the web

http://spatial.ly/2012/03/mapped-british-shipping-1750-1800/

Page 22: Using R as geo-statistical tool: a few examples R as geo-statistical tool: a few examples French Institute of Pondicherry 19th august 2015 Maxime Réjou-Méchain Maxime.rejou@ifpindia.org

French Institute of Pondicherry Using R as geo-statistical tool: a few examples

maps from the web

Page 23: Using R as geo-statistical tool: a few examples R as geo-statistical tool: a few examples French Institute of Pondicherry 19th august 2015 Maxime Réjou-Méchain Maxime.rejou@ifpindia.org

French Institute of Pondicherry Using R as geo-statistical tool: a few examples

maps from the web

Page 24: Using R as geo-statistical tool: a few examples R as geo-statistical tool: a few examples French Institute of Pondicherry 19th august 2015 Maxime Réjou-Méchain Maxime.rejou@ifpindia.org

French Institute of Pondicherry Using R as geo-statistical tool: a few examples

Trade-offs

Summary of the relative merits of R compared with more traditional GIS software

http://www.r-bloggers.com/r-an-integrated-statistical-programming-environment-and-gis/

Page 25: Using R as geo-statistical tool: a few examples R as geo-statistical tool: a few examples French Institute of Pondicherry 19th august 2015 Maxime Réjou-Méchain Maxime.rejou@ifpindia.org

Let’s use R as a GIS, the investment quickly pay off!

Toward a FOSS5G?

Useful links: https://cran.r-project.org/web/views/Spatial.html http://www.r-bloggers.com/r-an-integrated-statistical-programming-environment-and-gis/ https://stat.ethz.ch/mailman/listinfo/r-sig-geo

French Institute of Pondicherry Using R as geo-statistical tool: a few examples

Conclusion

Page 26: Using R as geo-statistical tool: a few examples R as geo-statistical tool: a few examples French Institute of Pondicherry 19th august 2015 Maxime Réjou-Méchain Maxime.rejou@ifpindia.org

Thanks

French Institute of Pondicherry Using R as geo-statistical tool: a few examples